Adure/discord-colour-changing-bot

Bot Token

robotrono opened this issue · 8 comments

Hello, I'm new in python sorry but where I can set the bot token?
Sorry for my bad english.

Adure commented

in client.run()

Thanks for the response @Adure, I set the bot token in client.run('token') but I get this error:

E:\bot>python color.py
Traceback (most recent call last):
File "color.py", line 5, in
from auth import bot_token
ImportError: cannot import name 'bot_token'

Adure commented

auth is just the file I have my bot token in, you need to get your own token from https://discordapp.com/developers/applications/

@Adure done, so I need remove "from auth import bot_token" and works fine?

Adure commented

yep

Now I get this Q_Q:

Ignoring exception in on_ready
Traceback (most recent call last):
  File "C:\Python3\lib\site-packages\discord\client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "color.py", line 38, in on_ready
    await client.edit_role(flash_server, flash_role, colour=colours[colour_index])
  File "C:\Python3\lib\site-packages\discord\client.py", line 2860, in edit_role
    yield from self.http.edit_role(server.id, role.id, **payload)
  File "C:\Python3\lib\site-packages\discord\http.py", line 196, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions
Adure commented

You need to enter your own server and role id and the bot's role needs to be higher than the role you're trying to change

Thanks now works fine!