chalda / DiscordBot

A chat bot for discord app based off discord.js
GNU General Public License v2.0
583 stars 355 forks source link

Update Presence events and functions. New msglist command #202

Open Kyrisx opened 3 years ago

Kyrisx commented 3 years ago

Updated the presence event code to properly detect user status changes. Msgs command will now send stored messages to users when their status changes to "online" or "idle". Currently, if a Msg is created while a user is already online/idle, it won't be sent until the status changes. Msglist command retrieves messages the caller has sent to the target.

chalda commented 3 years ago

can we move these commands to a separate folder similar to other plugins. its a fairly large chunk of isolated code

F9Alejandro commented 3 years ago

Be sure to also put in checks for user allowing DMs for the messagelist. It would help prevent crashes and could possible keep the messages until the user switches the permissions for DMs for that server.

It would also be beneficial if this is converted to a sqlite db instead of storing the data in memory just incase the bot crashes.