Skip to content

Strange library error when using some slash commands #170

Closed
@randomairborne

Description

@randomairborne

Summary

Random error with slash commands

Reproduction Steps

ran https://github.com/GlaceonBot/Sylveon with default settings
Tried to run /hug
Noted error

Minimal Reproducible Code

see https://github.com/GlaceonBot/Sylveon/blob/master/bot.py#L78 to line 99

Expected Results

I expected the command to complete correctly, as there don't seem to be issues with the bot code

Actual Results

Nothing, the command failed and i got a traceback

Ignoring exception in on_interaction
Traceback (most recent call last):
  File "/home/Glaceon/Sylveon/venv/lib/python3.9/site-packages/discord/client.py", line 351, in _run_event
    await coro(*args, **kwargs)
  File "/home/Glaceon/Sylveon/venv/lib/python3.9/site-packages/discord/bot.py", line 373, in on_interaction
    await self.handle_interaction(interaction)
  File "/home/Glaceon/Sylveon/venv/lib/python3.9/site-packages/discord/bot.py", line 248, in handle_interaction
    await command.invoke(context)
  File "/home/Glaceon/Sylveon/venv/lib/python3.9/site-packages/discord/app/commands.py", line 154, in invoke
    arg = await get_or_fetch(ctx.guild, name, int(arg))
  File "/home/Glaceon/Sylveon/venv/lib/python3.9/site-packages/discord/utils.py", line 453, in get_or_fetch
    getter = getattr(obj, f'get_{attr}')(id)
AttributeError: 'NoneType' object has no attribute 'get_member'

Intents

discord.Intents.none()

System Information

  • Python v3.9.2-final
  • pycord v2.0.0-alpha
    • pycord pkg_resources: v2.0.0a3840+ge6226504
  • aiohttp v3.7.4.post0
  • system info: Linux 5.10.0-8-amd64 Update README.rst #1 SMP Debian 5.10.46-4 (2021-08-03)

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

Sometimes this is fixed by restarting the bot, but then a few hours later it crops up on a different command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmed bugA bug report that needs triaging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions