MCPcopy Create free account
hub / github.com/antirez/botlib / BotRequest

Class BotRequest

botlib.h:19–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17/* This structure is passed to the thread processing a given user request,
18 * it's up to the thread to free it once it is done. */
19typedef struct BotRequest {
20 int type; /* TB_TYPE_PRIVATE, ... */
21 sds request; /* The request string. */
22 int64_t from; /* ID of user sending the message. */
23 sds from_username; /* Username of the user sending the message. */
24 int64_t target; /* Target channel/user where to reply. */
25 int64_t msg_id; /* Message ID. */
26 sds *argv; /* Request split to single words. */
27 int argc; /* Number of words. */
28 int file_type; /* TB_FILE_TYPE_* */
29 sds file_id; /* File ID if a file is present in the message.
30 * The file format will be given by file_type. */
31 sds file_name; /* Original file name, if available. */
32 sds file_mime; /* MIME type, if available. */
33 int64_t file_size; /* Size of the file. */
34 int bot_mentioned; /* True if the bot was explicitly mentioned. */
35 sds *mentions; /* List of mentioned usernames. NULL if there
36 are no mentions. */
37 int num_mentions; /* Number of elements in 'mentions' array. */
38} BotRequest;
39
40/* Bot callback type. This must be registed when the bot is initialized.
41 * Each time the bot receives a command / message matching the list of

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected