Malarne / discord_cogs

GNU General Public License v3.0
26 stars 25 forks source link

heist errors: AttributeError: 'NoneType' object has no attribute 'display_name' #60

Closed fuzzysomeone closed 3 years ago

fuzzysomeone commented 3 years ago

Upon starting the RedBot v3 instance I get this msg:

[2020-10-31 12:46:08] [WARNING] red: Owner with ID 766009006359183390 is missing in user cache, ignoring owner notification destination.

This is the error when trying to start a Heist using !heist play It used to work but no longer. Any ideas how I can fix this?

[2020-10-31 12:47:09] [WARNING] red: Detected significant difference (7198 seconds) in system clock to discord's clock. Any time sensitive code may fail. [2020-10-31 12:49:15] [ERROR] red: Exception in command 'heist play' Traceback (most recent call last): File "c:\users\virtualbox1\redenv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped ret = await coro(*args, **kwargs) File "C:\Users\VirtualBox1\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\LouBot\cogs\CogManager\cogs\heist\heist.py", line 501, in _play_heist await self.heist_game(ctx, guild, t_heist, t_crew, t_vault) File "C:\Users\VirtualBox1\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\LouBot\cogs\CogManager\cogs\heist\heist.py", line 519, in heist_game results = await self.thief.game_outcomes(guild, players, target) File "C:\Users\VirtualBox1\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\LouBot\cogs\CogManager\cogs\heist\thief.py", line 322, in game_outcomes dropout_msg = (bad_thing[0] + "\n{0} dropped out of the game.").format(escape(player.display_name, formatting=True)) AttributeError: 'NoneType' object has no attribute 'display_name'

Malarne commented 3 years ago

as the first line suggest it, you simply doesn't have intents enabled, if you're bot is not verified, just get into developper section of discord.com, get into your bot's page, in the bot tab you can enable intents, enable them both and restart your bot, it'll fix your issue

Flame442 commented 3 years ago

Please make sure you are on Red 3.4.1 or later. If you aren't you can find Red's updating instructions below https://docs.discord.red/en/stable/update_red.html

Red requires that you have both privileged intents enabled in order to function correctly. If you are unsure how to do this, follow this guide https://docs.discord.red/en/stable/bot_application_guide.html#enabling-privileged-intents

fuzzysomeone commented 3 years ago

Thanks! Enabling intents fixed it.