chore: snapshot 2026-02-08
This commit is contained in:
@@ -76,8 +76,7 @@ class DiscodromeClient(commands.Bot):
|
||||
async def on_ready(self) -> None:
|
||||
''' Event called when the client is done preparing. '''
|
||||
|
||||
activity = discord.Activity(type=discord.ActivityType.playing, name=env.BOT_STATUS)
|
||||
await self.change_presence(activity=activity)
|
||||
await self.set_default_presence()
|
||||
|
||||
logger.info(
|
||||
"Logged as: %s | Connected Guilds: %s | Loaded Extensions: %s",
|
||||
@@ -87,6 +86,22 @@ class DiscodromeClient(commands.Bot):
|
||||
)
|
||||
logger.info("Bot status set to: '%s'", env.BOT_STATUS)
|
||||
|
||||
async def set_default_presence(self) -> None:
|
||||
''' Sets the default bot presence (idle status). '''
|
||||
activity = discord.Activity(type=discord.ActivityType.playing, name=env.BOT_STATUS)
|
||||
await self.change_presence(activity=activity)
|
||||
|
||||
async def set_now_playing(self, song_title: str, artist: str, cover_url: str = None) -> None:
|
||||
''' Sets the bot presence to show the currently playing song. '''
|
||||
activity = discord.Activity(
|
||||
type=discord.ActivityType.listening,
|
||||
name=f"{song_title} - {artist}",
|
||||
large_image=cover_url,
|
||||
large_text=f"{song_title} - {artist}"
|
||||
)
|
||||
await self.change_presence(activity=activity)
|
||||
logger.debug("Bot presence updated: Listening to '%s - %s'", song_title, artist)
|
||||
|
||||
if __name__ == "__main__":
|
||||
logs.setup_logging()
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
Reference in New Issue
Block a user