Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commands not working either with dollar simbol or mine < simbol #13

Open
erosalpe opened this issue Mar 28, 2021 · 1 comment
Open

commands not working either with dollar simbol or mine < simbol #13

erosalpe opened this issue Mar 28, 2021 · 1 comment

Comments

@erosalpe
Copy link

i succesfully run the bot but when i write the commands nothing happen and this is what it says

bot is now online
Ignoring exception in command h:
Traceback (most recent call last):
File "C:\Users\erosa\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "nuker.py", line 110, in h
for user in list(ctx.message.server.members):
AttributeError: 'Message' object has no attribute 'server'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\erosa\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\erosa\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\erosa\AppData\Local\Programs\Python\Python35\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Message' object has no attribute 'server'

@L30777
Copy link

L30777 commented Apr 19, 2023

It looks like you are running a Discord bot using Python and the Discord.py library. The error message suggests that there is an issue with the "rape" command in your code, specifically with the line "for channel in list(ctx.message.server.channels)". The error message states that the 'Message' object (i.e., ctx.message) does not have an attribute 'server'.

This error message is likely caused by the fact that Discord.py version 1.0+ no longer supports the "server" attribute on message objects. Instead, you should use "guild" instead of "server".

To fix this issue, you should modify the "rape" command to use "ctx.guild" instead of "ctx.message.server". For example, you can replace the problematic line with:

for channel in ctx.guild.channels:

This should resolve the AttributeError and allow the "rape" command to run correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants