i said iâd make one of these ages ago, the idea was to start this early so that i didnât have to cover much, but i got ahead of myself.Â
anyway, since this is a very long post, iâll put the rest under the cut for yâall.
( Disclaimer; iâm not a professional programmer, this is just a hobby of mine. iâm self-taught and some of the stuff i post here isnât the best way you could make a bot. if you actually wanna learn from professionals invest into some courses )
so, for the record; benrybot (passbotry) is a bot coded on python using the discord.py API. itâs quite small, i only started work on it five days ago.
if yâall are interested in making a bot yourselves, the discord.py website has everything you need to install it and get started; bithub and stackoverflow are your friends.
anyways, iâm explaining the code from the start;
these are all the imports iâm using for the bot, they always go at the top of your code so that python recognizes and unpacks/processes all these imports before touching any of the other code. imports are basically like additional code packs that you download and then can use on python.
most of these are just here to let me access discord.pyâs features, except the ârandomâ import which is a randomizing commandset,
these lines of code and basically an authentication process telling me what the bot is online, and setting itâs status ( you can see i tried to label it with comments (the red writing))
-
now hereâs where the actual commands begin;
â@client.event â is the line that lets the bot know this is the start of a command, referred to as an event.  âclient. â is the prefix to most lines of code featuring the bot.
âasync def on_message(message):â tells the program that the next line is defining what the bot will do during the command/event. âon_messageâ means this event is triggered when any message is sent on the server.
â if message.content == âbenbot testâ: â just means if thereâs a message that says âbenbot testâ, weâll initiate the next line of code. if not, the bot does nothing.
â await client.send_message(message.channel, âsuccessâ)â. âawaitâ lets the bot multitask, instead of waiting to finish any other processes it skips to the await line,  âclient.sned_messageâ send the message, â(message.channel,â means it will be sent in the same channel and âsuccessâ was the content of our message.
so the result of these lines of code is:
the bot processes that âbenbot testâ has been sent and replies in the same channel with itâs predetermined response (please donât mind the botâs nickname on this example.)
anyway, thatâd be it for part one of benrybotâs behind the scenes.Â
on the next post iâll go into detail on benrybotâs more complex commands, formatting and the random.choice function.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
â Live Streamingâ Interactive Chatâ Private Showsâ HD Qualityâ Free Actions
Free to watch ⢠No registration required ⢠HD streaming