bot package
Submodules
- bot.weakauras_bot module
WeakAurasBot
WeakAurasBot.config
WeakAurasBot.data_dir
WeakAurasBot.__init__()
WeakAurasBot.sanitize_server_name()
WeakAurasBot.get_server_folder()
WeakAurasBot.get_server_macros_file()
WeakAurasBot.load_server_macros()
WeakAurasBot.save_server_macros()
WeakAurasBot.get_server_config_file()
WeakAurasBot.load_server_config()
WeakAurasBot.save_server_config()
WeakAurasBot.is_event_enabled()
WeakAurasBot.has_admin_access()
WeakAurasBot.create_embed()
WeakAurasBot.on_ready()
WeakAurasBot.sync_commands()
Module contents
- class bot.WeakAurasBot(config)[source]
Bases:
Bot
WeakAuras Discord Bot with server-specific macro storage and management.
This bot extends discord.py’s commands.Bot to provide WeakAuras-specific functionality including macro storage, server configuration, and administrative features. Each Discord server gets its own isolated data storage.
- data_dir
Directory path for server data storage.
- Type:
Path
Example
>>> config = {"storage": {"data_directory": "server_data"}} >>> bot = WeakAurasBot(config) >>> # Bot is now ready for command registration and startup
- __init__(config)[source]
Initialize the WeakAuras bot with configuration.
- Parameters:
config (dict[str, Any]) – Configuration dictionary containing bot settings, storage paths, and other options.
Example
>>> config = { ... "storage": {"data_directory": "server_data"}, ... "bot": {"brand_color": 0x9F4AF3} ... } >>> bot = WeakAurasBot(config)
- create_embed(title=None, description=None, color=None, footer_text=None)[source]
Create a branded WeakAuras embed with logo attachment
- get_server_config_file(guild_id, guild_name)[source]
Get the configuration file path for a specific server
- Return type:
Path
- get_server_folder(guild_id, guild_name)[source]
Get or create the server folder path, checking for existing folders by guild ID
- Return type:
Path
- get_server_macros_file(guild_id, guild_name)[source]
Get the macros file path for a specific server
- Return type:
Path
- has_admin_access(member)[source]
Check if member has admin access via role names or Discord permissions
- Return type:
- async is_event_enabled(guild_id, event_type)[source]
Check if a specific event is enabled for a server.
Checks Django database first, then falls back to JSON configuration.
- save_server_config(guild_id, guild_name, config)[source]
Save configuration for a specific server
- Return type: