Add DM messages to intents when adding message callback
@@ -105,21 +105,24 @@ setcb_ready(client *client, idle_cb *user_cb){
void
setcb_message_create(client *client, message_cb *user_cb)
{
- client->ws.intents |= websockets::intents::GUILD_MESSAGES;
+ using namespace websockets;
+ client->ws.intents |= (websockets::intents::GUILD_MESSAGES | websockets::intents::DIRECT_MESSAGES);
client->ws.cbs.on_message.create = user_cb;
}
void
setcb_message_update(client *client, message_cb *user_cb)
{
- client->ws.intents |= websockets::intents::GUILD_MESSAGES;
+ using namespace websockets;
+ client->ws.intents |= (websockets::intents::GUILD_MESSAGES | websockets::intents::DIRECT_MESSAGES);
client->ws.cbs.on_message.update = user_cb;
}
void
setcb_message_delete(client *client, message_delete_cb *user_cb)
{
- client->ws.intents |= websockets::intents::GUILD_MESSAGES;
+ using namespace websockets;
+ client->ws.intents |= (websockets::intents::GUILD_MESSAGES | websockets::intents::DIRECT_MESSAGES);
client->ws.cbs.on_message.del = user_cb;
}
