22 lines
617 B
Python
22 lines
617 B
Python
from typing import Union
|
|
from bson import ObjectId
|
|
|
|
|
|
class MemberNotFoundError(Exception):
|
|
"""Exception raised when member does not exist in a database.
|
|
|
|
### Attributes:
|
|
* id: Member ID.
|
|
* guild: Member's guild.
|
|
"""
|
|
|
|
def __init__(self, id: Union[int, ObjectId], guild: ObjectId):
|
|
self.id = id
|
|
self.guild = guild
|
|
super().__init__(
|
|
f"Could not find member entry for {str(id)} in the guild with id {str(guild)}."
|
|
)
|
|
|
|
def __str__(self):
|
|
return f"Could not find member entry for {str(self.id)} in the guild with id {str(self.guild)}."
|