Like Dank Memer's sniper bot, but written in Python.
Because Discord.py > Discord.js
Currently, this bot can:
- Store one deleted message per channel
- Handle deleted attachments
- Use the slash command
/snipe
to recover a deleted message
Please install these prerequisites:
- Python 3.8 or higher
- Git (unless you download as a zip)
-
Create the bot
- Go to the Discord developer portal
- Click the blue
New application
button and give your bot a name - Navigate to the
Bot
submenu and pressAdd bot
(and pressYes, do it!
on the dialogue box) - Save the token for the config.json file
- Navigate to the OAuth2 submenu
- For the scopes, select
bot
andapplications.commands
- For the bot permissions, make sure it at least has the following:
- View Channels
- Send Messages
- Read Message History
- Embed Links
- Use Slash Commands
- Then, copy the link in the scopes section. Use that link to add it to your servers
-
Download the bot and install necessary packages
$ git clone https://github.com/sheepy0125/sniper-bot-python $ cd sniper-bot-python $ python3 -m pip install -r requirements.txt
-
Create config file
Use the automated config generator
$ python3 src/utils/automated_config_generator.py
Or make it yourself (save in root directory as config.json, you can rename config.json.example)
{ "token": "", "guild_ids": [], "embed_color": "FFFFFF" }
-
Run the bot!
$ python3 src/bot.py
- Contribute with nice looking, readable, code formatted with Black (if Python) or Prettier (if not Python)
- Keep it clean (no swear words, obviously)
- Keep it on point (no music bot or anything)
- No asking for me to put hashtags / follow you / star a repository / etc. in return for your code