Guilds Module
- class Guilds(*args: Any, **kwargs: Any)
Bases:
CogThis module manages various guild-related commands and background tasks, including adding, removing, and viewing custom reaction roles, and simulating different events.
Attention
All commands assume minimum bot permissions: View Channel, Send Messages.
- async inviteme(ctx)
Get an invite link to the support server for Chii-chan.
Syntax:
!!inviteme- Returns:
A Discord invite link to the support server for Chii-chan.
- Return type:
discord.Message
- async tmj(ctx, member: Member = None)
Simulate the on_member_join event in your server by manually calling the event handler.
Syntax:
!!tmj [member]Example:
!!tmj @username- Parameters:
member (discord.Member, optional) – The member to simulate the event for. Defaults to the command author if none is given.
- Returns:
New member joining functions pre defined in
gs, confirms the on_member_join event has been simulated.- Return type:
discord.Message
- async tmr(ctx, member: Member = None)
Simulate the on_member_remove event in your server by manually calling the event handler.
Syntax:
!!tmr [member]Example:
!!tmr @username- Parameters:
member (discord.Member, optional) – Optional. The member to simulate the event for. Defaults to the command invoker.
- Returns:
Confirmation that the on_member_remove event has been simulated.
- Return type:
discord.Message
- async tgj(ctx)
Test the on_guild_join event by manually triggering it.
Syntax:
!!tgj- Returns:
Runs guild_joined functions. Confirms that the on_guild_join event has been triggered.
- Return type:
discord.Embed
- async tgr(ctx)
Test the on_guild_remove event by manually triggering it.
Syntax:
!!tgr- Returns:
Runs guild_removed functions. Confirms that the on_guild_remove event has been triggered.
- Return type:
discord.Embed
- async resync_guilds(ctx)
Re-run on_guild_join for every guild the bot is currently in. Useful after database schema changes or lost data.
- async guildwhitelist(ctx, guild_id: int, *, name: str = '')
Add a guild ID to the runtime join allowlist (persisted in
guild_allowlist_admin.json).Takes effect immediately —
on_guild_joinreads the refreshed globals on the next join, no bot/cog restart needed. If the bot is already in the named guild the server name is auto-resolved frombot.get_guild(id).name; otherwise pass a name explicitly.Aliases:
gwhitelist,allowguildSyntax:
!!guildwhitelist <guild_id> [name...]Examples:
!!guildwhitelist 1413157697469284458 !!guildwhitelist 1413157697469284458 Starlight Academy
- Returns:
Embed confirming the addition and the new total allowed count.
- Return type:
discord.Embed
- async showguildwhitelist(ctx)
List every guild in the join allowlist (defaults + admin extras + env extras), one per line.
Format:
Name - <id>. Sorted by name (case-insensitive); placeholder entries ((env)/(unknown)) sink to the bottom. Long lists are split across multiple messages so they stay under Discord’s 2000-character limit.Aliases:
gwlist,allowedguildsSyntax:
!!showguildwhitelist- Returns:
One or more text messages listing every allowed guild.
- Return type:
discord.Message
- async emoteid(ctx, emote)
Return the ID of a given emote. Helpful for setting up reaction commands. This will work for animated emotes also.
Syntax:
!!emoteid <emote>Example:
- Parameters:
emote (discord.Emote) – The emote to retrieve the ID for.
- Returns:
A message displaying the ID of the emote.
- Return type:
discord.Message
- async add_reaction_command(ctx, channel, message_id: int, role, emote)
Add a custom reaction role to a message.
Aliases:
acrChii-chan’s role must be higher than the target role. If the target role is managed by an integration (e.g., Twitch, Patreon roles etc), this will always return Forbidden.
Syntax
!!acr <channel> <message_id> <role> <emote>Examples
!!acr #react-roles 1178676725358547006 @Birb <emote> !!acr 1104549057793376297 1178676725358547006 1118694613272764508 1109559058639356094
- Parameters:
channel (discord.TextChannel or int) – The channel mention or ID where the reaction role is to be added.
message_id (int) – The message ID where the reaction role is added.
role (discord.Role or int) – The role mention or ID to be assigned.
emote (discord.Emoji or int) – The emote mention or ID to be used for the reaction role.
- Returns:
A message indicating success or failure of the addition of the reaction role.
- Return type:
discord.Message
- async remove_reaction_command(ctx, message_id: int, emote)
Remove a custom reaction role.
Aliases:
rcrSyntax
!!remove_reaction_command <message_id> <emote>Examples
!!remove_reaction_command 1178676725358547006 <emote> !!remove_reaction_command 1178676725358547006 1109559058639356094
- Parameters:
message_id (int) – The message ID where the reaction role is to be removed.
emote (discord.Emoji or int) – The emote mention or ID to be removed from the reaction role.
- Returns:
A message indicating success or failure of the removal of the reaction role.
- Return type:
discord.Message
- async view_reactions_command(ctx)
View all current reactions in the database for the guild.
Aliases:
vcrSyntax
!!view_reactions_command- Returns:
A message displaying all current reactions in the database for the guild.
- Return type:
discord.Message