I followed Beau’s Youtube tutorial for making a Replit Discord Bot using python, it was great. It’s working and integrated with UptimeRobot. Here is my bot: https://replit.com/@drewshields/EducatedTechnoSpellchecker
I previously had a Discord bot I wrote in Visual Studio Code and used several commands which worked great. However, when I try to use the Discord.py commands in Repl.it, they do nothing. I don’t get a traceback error or any feedback. The bot just won’t respond. Commands as simple as:
async def test(ctx):
await ctx.send (“Hello”)
Can anyone suggest anything I might try? Like I said, I know the commands work with the discord.py API because I’ve run them with other programs.
@drewshields Welcome to the forum.
I am not familiar with discord or bots but I would say is that when Python does not do anything is when no function is being called OR you need to wrap the function in a
print() statement to see output.
I had a look at the bot’s code. I think the issue here is the
Generally on any message sent, this first event triggered, and thus this over-rides the commands-processing.
async def on_message(message):
if message.author == client.user:
msg = message.content
quote = get_quote()
This can be resolved by either of the following methods-
I tried this single line of code change, it worked like a dream. At least for the single test command that I tried. But I think this is my solution.
I was ready to write this project off, thank you so much. I am pretty new so this aid is really special.
I have almost the same code as OP and whenever I try to use “await client.process_commands(message)” I get the error: “AttributeError: ‘NoneType’ object has no attribute ‘id’”
I had the same issue as Drew. Using this code made the command work but do I have to use this code for every command?
Only when you are doing anything with
Could you send some surrounding code, for some better context?
hello, i actually figured it out. sorry i did not respond.
What did you do to make it work? I have the same issue
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.