GloryBot/classes/errors/member.py

22 lines
617 B
Python
Raw Normal View History

2024-05-01 22:15:35 +03:00
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)}."