WIP: Events and Stages

This commit is contained in:
2025-04-21 14:34:13 +02:00
parent ec733097ea
commit b72f930c94
4 changed files with 124 additions and 33 deletions

View File

@@ -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)