The best discord python bot 💯
This is a discord chatbot, made in Python, that reacts to some message, and can do a few things useful.
It is open to everyone, to use and modify it.
-> Invite link
At this time, using:
- python 3.10.2
- pip 21.3.1
- discord.py 2.6.4
- requests 2.32.5
- beautifulsoup4 4.14.3
- pillow 12.0.0
- python-dotenv 1.2.1
- Clone/Fork this repository : https://github.com/NozyZy/Le-ptit-bot/fork
- All the packages should be in the
venv/Scriptsfolder, but if not, thy are quoted above
- All the packages should be in the
- Make your changes, here are the things you need to know.
- The main file is
bot.py, where every commands and reaction are, you can use and add functions infunctions.py - in the
on_message(message)function : -channelis thje variable of the channel, useawait channel.send(text)to send message containingtext-Messageis the variable where the content of the message sent is stocked, but in lowercase. Usemessage.contentif you want to match the case. -rdnbis a random int variable, between 1 and 5, it is used to add probabilities of each reaction to happen (ex :if rdnb > 3=> 2/5 chance to happen) - To add reactions, take the example inside of the
on_message()function, here is one :
- The main file is
if Message.startswith('quoi'):
reponses = ['feur', 'hein ?', 'nan laisse', 'oublie', 'rien']
await channel.send(random.choice(reponses))- To add commands, the prexif is set at the beginning of the file (
bot = commands.Bot(command_prefix="--", description="Le p'tit bot !"), so this is --) Then, use@bot.command()to begin a new command, next line has to beasync def command_name(ctx, other_parameters):, and then the command call will be the prexif, past top the name (so here it'll be--command_name) - Be creative, and do be affraid to add things in english, even if it's firstly programed for french users, mixity is good !
- When you're done, make a pull request to the
dev_improvebranch of my repository, and hope I'll accept your changes (I'm sure you'll do good stuff that I'll approve !)
