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

Error running bot.py #101

Open
pizza-yute opened this issue Apr 17, 2023 · 1 comment
Open

Error running bot.py #101

pizza-yute opened this issue Apr 17, 2023 · 1 comment

Comments

@pizza-yute
Copy link

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
Copy link
Author

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

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

1 participant