I'm trying to make a Discord Bot with DSharp+ that deletes all messages sent in a server during a certain timeframe. However, when looking through the DSharp+ API and extensive research, I could not find any way to have the bot detect if a message is sent and decide whether to delete it. How would I go about doing this, if it is possible?
DSharpPlus has a MessageCreated event. Subscribe the event and it'll invoke when a message is created. Be aware this also gets invoked for DM Messages as well, but there's likely some property you can null check.
Note: Discord won't let you bulk delete messages older than 2 weeks