mugman174 / badcord.py

discord.py but it works on spacebar
3 stars 0 forks source link

Key Error from snowflake parser on attempting to create a message #1

Open MetaverseRPN opened 6 days ago

MetaverseRPN commented 6 days ago

It appears that when discord attempts to create a message, the snowflake parser runs into an error as it is unable to find the webhook_id key that discord is expecting.

  File "/home/nix/ElysiumDev/patcher.py", line 78, in parse_message_create
    message = discord.Message(channel=channel, data=data, state=self)
  File "/home/nix/.local/share/virtualenvs/ElysiumDev-vUgg1EBe/lib/python3.10/site-packages/discord/message.py", line 547, in __init__
    self.webhook_id = utils._get_as_snowflake(data, 'webhook_id')
  File "/home/nix/ElysiumDev/patcher.py", line 36, in _get_as_snowflake
    value = data[key]

The relevant line discord.py is yelling about appears to be here. Which is odd since it is supposed to be optional: self.webhook_id: Optional[int] = utils._get_as_snowflake(data, 'webhook_id')

mugman174 commented 4 days ago

Can you send me a sample of the code where this happens and/or more of the error, especially what type of exception (TypeError, KeyError, etc.), if you're open to sharing? On the instance at https://app.spacebar.chat, I have had no trouble with the bot receiving messages, and the webhook_id attribute of received messages has been shown as None in my testing.