-
Notifications
You must be signed in to change notification settings - Fork 5
/
commanderrors.py
38 lines (29 loc) · 1.13 KB
/
commanderrors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""
Stores various specific errors. These can be used to better describe why specific
exceptions occurred, avoiding the need to use general exceptions.
"""
from discord.ext import commands
class CommandNotAllowedInChannel(commands.CommandError):
"""
There was an attempt to execute a command in a channel that the command was not
permitted to be executed in. Currently not used.
"""
def __init__(self, channel, *args, **kwargs):
self.channel = channel
super().__init__(*args, **kwargs)
class CommandNotInvokedInBotSpam(commands.CommandError):
"""
A command which was only permitted to be invoked in #bot-spam was invoked in
another channel. Currently not used.
"""
def __init__(self, channel, message, *args, **kwargs):
self.channel = channel
self.message = message
super().__init__(*args, **kwargs)
class SelfMuteCommandStaffInvoke(commands.CommandError):
"""
A staff member attempted to self-mute themselves. Currently not used.
"""
def __init__(self, message, *args, **kwargs):
self.message = message
super().__init__(*args, **kwargs)