Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

DM score check raises an error #8

@dudeofawesome

Description

@dudeofawesome

DM to bot with message "/myvirginity" leads to this error in console:

Ignoring exception in command myvirginity:
Traceback (most recent call last):
  File "/home/virginitybot/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 83, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/virginitybot/bot.py", line 87, in myvirginity
    virgin = Virgin.get(guild_id=str(ctx.message.guild.id),
AttributeError: 'NoneType' object has no attribute 'id'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/virginitybot/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
    await ctx.command.invoke(ctx)
  File "/home/virginitybot/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 797, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/virginitybot/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 92, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'id'

Not sure what the expected behavior here should be though, since we can't really tell what server the user is asking for the score on. Maybe we send a message asking the user what server?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions