You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/bot-api.md
+5-108Lines changed: 5 additions & 108 deletions
Original file line number
Diff line number
Diff line change
@@ -6,66 +6,7 @@ zmq commands:
6
6
7
7
*[sogs.sub](#sub)
8
8
*[sogs.unsub](#unsub)
9
-
10
-
*[sogs.user.info](#user-info)
11
-
*[sogs.user.send](#user-send)
12
-
*[sogs.user.perm](#user-perm)
13
-
*[sogs.user.ban](#user-ban)
14
-
*[sogs.user.unban](#user-unban)
15
-
16
-
*[sogs.room.info](#room-info)
17
-
*[sogs.room.send](#room-send)
18
-
*[sogs.room.perm](#room-perm)
19
-
20
-
*[sogs.file.info](#file-info)
21
-
*[sogs.file.upload](#file-upload)
22
-
*[sogs.file.del](#file-del)
23
-
*[sogs.file.ban](#file-ban)
24
-
*[sogs.file.unban](#file-ban)
25
-
26
-
27
-
# Objects
28
-
29
-
## UserInfo
30
-
31
-
a dict containing info on a user
32
-
33
-
* id - the integer id for this user
34
-
* pubkey - the user's 32 byte public x25519 key, session id is 0x05 then the pubkey bytes all hex encoded
35
-
* names - a dict of room token as key and displayed name in that room
36
-
* mod - if the user is a moderator positive non zero otherwise zero
37
-
38
-
## RoomInfo
39
-
40
-
a dict containing info on a room
41
-
42
-
* id - the integer id for this room
43
-
* token - the name of this room used in the url
44
-
* users - a list of UserInfo of all the users in the room (optional)
45
-
46
-
## FileInfo
47
-
48
-
a dict describing a file
49
-
50
-
* id - internal id for referring to this file
51
-
* public-url - a public url to fetch the file at
52
-
* size - the size of this file in bytes
53
-
* mimetype - the implied mimetpye of this file
54
-
* uploaded - the time this file was uploaded at in milliseconds since unix epoch
55
-
* hashes - a dict of hash algorithm name to the digest value of the file with that algorithm (currently supported algorithms: blake2 / sha2-256 / sha1 / md5 )
56
-
* user - the user id of who uploaded this file
57
-
58
-
## PostInfo
59
-
60
-
a dict describing a post made to a room
61
-
62
-
* id - the post's id
63
-
* user - the id of the user that posted the message
64
-
* room - the id of the room that the message was posted in
65
-
* when - the time this message was recieved in the room as milliseconds since unix epoch
66
-
* text - the plaintext body of the message as a string
67
-
* files - a list of file ids this message uploaded files with (optional)
68
-
* cites - a post id this post is citing (optional)
9
+
*[sogs.request](#request)
69
10
70
11
71
12
# Events
@@ -112,54 +53,10 @@ subscribe to events
112
53
113
54
unsubscribe to events
114
55
115
-
## sogs.user.info <spanid="user-info" />
116
-
117
-
fetch info of a user
118
-
119
-
## sogs.user.send <spanid="user-send" />
120
-
121
-
send a whisper to a user
122
-
123
-
## sogs.user.perm <spanid="user-perm" />
124
-
125
-
get/set user permissions (read/write/upload)
126
-
127
-
## sogs.user.ban <spanid="user-ban" />
128
-
129
-
ban user
130
-
131
-
## sogs.user.unban <spanid="user-unban" />
132
-
133
-
unban user
134
-
135
-
## sogs.room.info <spanid="room-info" />
136
-
137
-
get/set room info
138
-
139
-
## sogs.room.send <spanid="room-send" />
140
-
141
-
send a message to the room
142
-
143
-
## sogs.room.perm <spanid="room-perm" />
144
-
145
-
get/set room permissions (read/write/upload)
146
-
147
-
## sogs.file.info <spanid="file-info" />
148
-
149
-
get uploaded file info
150
-
151
-
## sogs.file.upload <spanid="file-upload" />
152
-
153
-
upload a file
154
-
155
-
## sogs.file.del <spanid="file-del" />
156
-
157
-
delete a file
158
-
159
-
## sogs.file.ban <spanid="file-ban" />
56
+
## sogs.request <spanid="request" />
160
57
161
-
ban file uploads by mimetype/hash/etc optionally per room
58
+
call an http api endpoint
162
59
163
-
## sogs.file.unban <spanid="file-unban" />
60
+
args: [method, path, headers_dict, optional_body]
164
61
165
-
unban uploads by mimetype/hash/etc optionally per room
0 commit comments