Skip to content

AttributeError: 'NoneType' object has no attribute 'ban' #1912

@sentry

Description

@sentry

Sentry Issue: BOT-1PD

AttributeError: 'NoneType' object has no attribute 'ban'
(3 additional frame(s) were not displayed)
...
  File "discord/ext/commands/context.py", line 187, in invoke
    return await command(self, *args, **kwargs)
  File "discord/ext/commands/core.py", line 468, in __call__
    return await self.callback(self.cog, context, *args, **kwargs)  # type: ignore
  File "bot/exts/moderation/infraction/infractions.py", line 186, in tempban
    await self.apply_ban(ctx, user, reason, expires_at=duration)
  File "bot/decorators.py", line 199, in wrapper
    await func(*args, **kwargs)
  File "bot/exts/moderation/infraction/infractions.py", line 380, in apply_ban
    action = ctx.guild.ban(user, reason=reason, delete_message_days=purge_days)

Unhandled exception in on_message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions