activity ¶
Bot activity status management and rotation.
This module handles automatic cycling through different bot activities to display various status messages, version information, and statistics.
Classes:
-
ActivityHandler–Discord cog for managing bot activity status rotation.
Functions:
-
setup–Cog setup for activity handler.
Classes¶
ActivityHandler ¶
Bases: Cog
Discord cog for managing bot activity status rotation.
Initialize the activity handler.
Parameters:
-
bot(Tux) –The bot instance to attach this cog to.
-
delay(int, default:30) –Seconds between activity changes, by default 30.
Methods:
-
build_activity_list–Build activity list from config or return default.
-
on_ready–Start activity rotation when bot is ready.
-
cog_unload–Cancel activity task when cog is unloaded.
Functions¶
build_activity_list staticmethod ¶
_substitute_placeholders ¶
Substitute placeholders in text.
Available placeholders: {member_count} -> Total member count {guild_count} -> Total guild count {bot_name} -> Bot name {bot_version} -> Bot version {prefix} -> Bot prefix
Parameters:
-
text(str) –Text to substitute placeholders in.
Returns:
-
str–Text with placeholders substituted.
_create_activity_with_substitution ¶
_activity_loop async ¶
_activity_loop() -> None
Rotate activities.
Raises:
-
CancelledError–If task is cancelled during execution.