Closed GlaZe08 closed 5 years ago
You are using a version of the library that is no longer supported. The async (0.16.x) version of the library has not received updates for a long long time, you will need to update your code to work with the new version of the library, as well as update your library to the latest version.
Here is a link to the migrating docs, and if you need further help with this migration process, the discord server can help you out with any issues or questions you encounter.
The 0.16.12 version of the library is unsupported. If you need help migrating, visit the migration guide: https://discordpy.readthedocs.io/en/latest/migrating.html
If you need more help consider joining the official Discord server.
Summary
So i played around abit with my code, tried some stuff and whatnot. Decided to scrap it, Anyways. After scraping the code, i noticed that my commands suddenly did not work anymore, tried some stuff and found that on_message is the issue. I had on_message before and it worked perfectly fine so i'm not really sure what i did to break it. its the exact same code, only difference is that the bot dosent recognise commands, while as before it did. I saw alot of posts saying to add; await client.process_commands(message) But this dosent change anything....
import random import time from discord import Game from discord.ext.commands import Bot
BOT_PREFIX = "." TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
client = Bot(command_prefix=BOT_PREFIX)
@client.command(pass_context=True) async def ping(context): await client.say(":ping_pong:Pong!")
@client.command(pass_context=True) async def pong(context): await client.say(":ping_pong:Ping!")
@client.command(name="8ball", description="Answers a yes/no question.", brief="Answers questions", aliases=("eight_ball", "eightball", "8-ball"), pass_context=True) async def eight_ball(context): possible_responses = [ "Sure, why not", "Probably not", "For sure", "Never in a million years", "The chances are pretty high", ] await client.say(random.choice(possible_responses) + ", " + context.message.author.mention)
@client.event async def on_ready(): await client.change_presence(game=Game(name="with rocks")) print ("Logged in as " + client.user.name)
@client.event async def on_message(message): if message.content.startswith("rip"): await client.send_message(message.channel, "RIP") await client.process_commands(message)
client.run(TOKEN)
Reproduction Steps
Expected Results
Expected commands to work like the did before i tried stuff.
Actual Results
No commands work, only on_message gets triggered. No error codes either.
Checklist
System Information
Python 3.6.0 discord.py 0.16.12 Windows 10