[Question] Get new events after bot reconnect? #2393
-
Hi, one question about the event : UserJoined But here is my case. My bot is offline and someone joined my server so he the bot can't send the welcome message. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Nope, discord doesn't work like that |
Beta Was this translation helpful? Give feedback.
-
Most you can do is cache the list of users and check it after the bot starts up |
Beta Was this translation helpful? Give feedback.
-
As mentioned above, Discord does not send any messages to offline bots, no socket connection is established. An alternative has also been mentioned. You can store the users last inside the server with json or an alternative, fetch the list when the bot starts back up, and compare it to the new list. You can extract the new entries that don't exist in the prior, and send a message to those users. Please be careful though; If you do this for a large amount of users, it is considered mass DM, which is against the Discord TOS. |
Beta Was this translation helpful? Give feedback.
As mentioned above, Discord does not send any messages to offline bots, no socket connection is established. An alternative has also been mentioned. You can store the users last inside the server with json or an alternative, fetch the list when the bot starts back up, and compare it to the new list. You can extract the new entries that don't exist in the prior, and send a message to those users.
Please be careful though; If you do this for a large amount of users, it is considered mass DM, which is against the Discord TOS.