staciax / valorant-discord-bot

A discord bot with valorant api.
GNU General Public License v3.0
338 stars 201 forks source link

Error running bot.py #101

Open pizza-yute opened 1 year ago

pizza-yute commented 1 year ago

I get this error when i run the bot.py file: TypeError: expected token to be a str, received <class 'NoneType'> instead

I just downloaded and unziped the lastest release didnt touch the code yet.I have evey dependencies installed and Python 3.8.16 running with PATH added to env variables

This is the entire log

Traceback (most recent call last): File "c:/GitHub/.not on repository/Valorant-DiscordBot-3.4.0/bot.py", line 108, in <module> run_bot() File "c:/GitHub/.not on repository/Valorant-DiscordBot-3.4.0/bot.py", line 104, in run_bot asyncio.run(bot.start()) File "C:\Users\Admin\miniconda3\envs\valbot\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\Admin\miniconda3\envs\valbot\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "c:/GitHub/.not on repository/Valorant-DiscordBot-3.4.0/bot.py", line 99, in start return await super().start(os.getenv(TOKEN), reconnect=True) File "C:\Users\Admin\miniconda3\envs\valbot\lib\site-packages\discord\client.py", line 745, in start
await self.login(token) File "C:\Users\Admin\miniconda3\envs\valbot\lib\site-packages\discord\client.py", line 577, in login
raise TypeError(f'expected token to be a str, received {token.__class__!r} instead') TypeError: expected token to be a str, received <class 'NoneType'> instead

Any ideas whats going on?

pizza-yute commented 1 year ago

Turns out the program was not reading the .env file because the string was commented (#), removing the hashtags fixed it