Created by Sean Yang
This python script using discord.py records the latest deleted message in a discord server and upon being called using '!snipe' sends the deleted message back along with the server name of the sender and the EST (by default) timestamp
- Install libraries in requirements.txt
- Setup your bot through discord.com/developers/applications
- Copy your bot's token and create .env 'DISCORD_API_TOKEN'
- Download files and run main.py
- profit???
- !snipe recalls the last deleted message
- !snipeall recalls ALL deleted messages
- !snipen recalls 'n' deleted messages where 'n' is an integer greater than 0 but not greater than 10
- !clear clears all logged messages
Initial upload: 2023/05/29
- Reworked code to use a class and objects to store message data
- Bot can now remember much more than just the last deleted message
- New commands added to make use of new capabilities
- Bot token reader reworked to use relative file path by default
- Added Commands and Updates section to README
- Reworked code to make it friendly for hosting
- Bot Token.txt has been removed as the program now uses env variable 'DISCORD_API_TOKEN'
- deletedEntry class has been replaced by better named messageEntry
- snipeBot.py has been replaced by main.py for friendlier hosting
- requirements.txt has been added for user and friendlier hosting
- limited list to only 10 remembered messages to reduce memory usage and fix !snipeall giving a wall of text
- Updates changed to Changelog
- Bugfix: added check for requested recall length smaller than 10 but larger than current list size
- Bugfix: replaced 'chanel' with 'channel' in line 47 (oops)
- Support for recalling edited messages added
- Support for recalling images and other attachments added
- Contributed by @BillJJ and edited by @ShurnYurnYang
- !clear function added which clears all logged messages
- Bugfix: added error catch for calling a snipe when no messages have been logged
- Bugfix: fixed error where recording message edits did not account for attachments
- Added author and time of message to file only recalls
- The UTC conversion timezone is EST by default, to change the timezone replace 'US/Eastern' with the pytz timezone of your choice
- Program has been rewritten to make it easy for hosting services to host (personally tested and hosted with railway)
- If multiple attachments from the same message are recalled, the attachment link will be retained in the recall message