WIP: Events and Stages
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from logging import Logger
|
||||
from typing import Any
|
||||
|
||||
from bson import ObjectId
|
||||
from discord import Guild, User
|
||||
from libbot.cache.classes import CacheMemcached, CacheRedis
|
||||
from libbot.cache.manager import create_cache_client
|
||||
@@ -90,3 +91,12 @@ class PycordBot(LibPycordBot):
|
||||
self.scheduler.shutdown()
|
||||
|
||||
await super().close(**kwargs)
|
||||
|
||||
async def find_event(self, event_id: str | ObjectId | None = None, event_name: str | None = None):
|
||||
if event_id is None and event_name is None:
|
||||
raise AttributeError("Either event's ID or name must be provided!")
|
||||
|
||||
if event_id is not None:
|
||||
await PycordEvent.from_id(event_id, cache=self.cache)
|
||||
else:
|
||||
await PycordEvent.from_name(event_name, cache=self.cache)
|
||||
|
Reference in New Issue
Block a user