Admin Module
- class Admin(*args: Any, **kwargs: Any)
A module to assist admins with various utils for their server.
Attention
All commands assume minimum bot permissions: View Channel, Send Messages.
- async check_permissions(ctx, *, member: Member = None)
Checks and displays the permissions of the user or a mentioned user in the server.
Aliases:
perms
,permissions
Syntax:
!!perms [member]
Example:
!!perms !!perms @User
- Parameters:
member (discord.Member, optional) – The member whose permissions you want to check. Defaults to the command invoker if not specified.
- Returns:
An embedded message showing the permissions of the specified member.
- Return type:
discord.Embed
- async edit_message(ctx, channel: channel_converter, message_id: int, *, new_content: str)
Edits a message sent by Chisato in a specified channel.
Aliases:
msgedit
Syntax:
!!edit_message <channel_id> <message_id> <new_content>
Example:
!!msgedit 123456789012345678 987654321098765432 "Updated content of the message."
- Parameters:
channel (discord.TextChannel) – The channel where the message is located.
message_id (int, required) – The ID of the message to be edited.
new_content (str, required) – The new content to set for the message.
- Returns:
Confirmation of message edit or an error message.
- Return type:
discord.Message
- async embededit(ctx, channel: channel_converter, message_id: int)
Edits an embedded message in a specified channel using JSON data. Note that the command accepts the json within a markdown code block only.
Whilst unusual, it vastly improves the readability of it for reference or other mods.
Syntax:
!!embededit <channel_id> <message_id> ```json { "title": "New Title", "description": "New Description" }```
Example:
!!embededit 123456789012345678 987654321098765432 ```json { "title": "Updated Title", "description": "Updated Description" } ```
- Parameters:
channel (discord.TextChannel) – The channel where the message is located.
message_id (int) – The ID of the message to be edited.
- Returns:
Confirmation of message edit or an error message.
- Return type:
discord.Embed
- async force_bday_idol(ctx, name=None)
Manually force Birthday Idol name into newidol embeds
Aliases:
fbi
Syntax:
!!force_bday_idol [name]
Example:
!!fbi Mari
- Parameters:
name (str, optional) – The name of the Birthday Idol to force into embeds, optional. If not set, the currently forced name will be removed.
- Returns:
Confirmation message
- Return type:
discord.Message
- async get_reactions(ctx, channel_id, message_id)
Lists all reactions on a specified message.
Syntax:
!!get_reactions <channel_id> <message_id>
Example:
!!get_reactions 1086415482342621235 1266428523695050792
- Parameters:
channel_id (int, required) – The ID of the channel where the message is located.
message_id (int, required) – The ID of the message whose reactions will be listed.
- Returns:
A list of reactions on the specified message, including emoji names and IDs.
- Return type:
discord.Message
- async guild_setup(ctx, setting_number: int = None, *, new_value: str = None)
Basic guild setup for how Chii-chan handles things in your Guild.
Aliases:
gs
Syntax:
!!guild_setup [setting_number] [new_value]
Example:
!!gs !!gs 0 help !!gs 9 true !!gs 17 #my-channel
- Parameters:
setting_number (int, optional) – The number relevant to the setting you wish to access
new_value (see below) – The new value for the setting
- Returns:
Updated guild settings
- Return type:
discord.Embed
Options:
0 is used as a default prefix for other options, such as
help
andshow
.- type 0:
int, required
1 Public update channel is automatically generated if you are a community server, else defaults to None This is where I will send important communications to Admins if the situation arises.
- type 1:
discord.TextChannel, required
2 System channel is automatically generated if you have this enabled, else defaults to None This is a backup if your server does not have 1.
- type 2:
discord.TextChannel, required
3 Announcement channel is automatically generated if you are a community server, else defaults to None This is where I will send Character birthday announcements.
- type 3:
discord.TextChannel, required
4 Logging channel is None by default, and will be used for 8, 9 and 10 if any are enabled.
- type 4:
discord.TextChannel, required
5 Member join channel is None by default. This needs to be set for your Welcome Message to be sent alongside 6 and 7.
- type 5:
discord.TextChannel, required
6 Member join message is None by default. This needs to contain a message in order for your Welcome Message to be sent alongside 6 and 8. For detailed information on Welcome Message use
gs 0 whelp
or see below.- type 6:
json, required
7 Member join send message is False by default. This needs to be True for your Welcome Message to be sent alongside 5 and 6.
- type 7:
bool, required
8 Member logging is False by default. This needs to be True alongside 4 to get detailed logs of members joining and leaving your server.
- type 8:
bool, required
9 Role logging is False by default. This needs to be True alongside 4 to get updates on members roles.
- type 9:
bool, required
10 Message logging is False by default. This needs to be True alongside 4 to log messages within your server. It will track edited and deleted messages.
- type 10:
bool, required
11 Moderator Role is None by default. You can set one mod role to whitelist for my Administrator commands. (Currently inactive)
- type 11:
bool, required
12 Twitter Embeds is False by default. If a message sent contains https://twitter.com/ or https://x.com/ it will embed the tweet. Note this has a global over-ride for when the API is down.
- type 12:
bool, required
13 Character birthday announcements is False by default and needs 3. Note: The bot needs send messages in the announcements channel.
- type 13:
bool, required
14 Blacklist users is True by default. This helps protect your Guild from serial offenders including severe harrassment, gore posters and raiders. Guild owners can disable this feature if they wish to opt-out with
gs 14 false
.- type 14:
bool, required
15 Starboard is False be default. This lets members ⭐ react messages and have it sent to a special channel when it receives enough star reactions. Requires 16 and 17.
- type 15:
bool, required
16 Stardboard Threshold is 5 by default. This is the minimum number of ⭐ reactions required on a message for it to be posted to your starboard channel. If a message is posted and later falls underneath this limit it will be deleted from your Starboard. Requires 15 and 17.
- type 16:
int, required
17 Starboard Channel is None by default. This is where your Starboard posts will be posted to. Requires 15 and 16.
- type 17:
discord.TextChannel, required
Welcome Message:
Welcome Message can accept plain text or embeds. You will need settings 5, 6 & 7 set correctly in order for it to work.
You can use three operators within it:
{{member}}
will use the new members plain text name.{{mention}}
will mention the new member.{{guild}}
will display your Guild’s name.
Embeds must be in JSON format in order to work correctly. If you are unfamiliar with embeds and/or json, use this visualizer.
If you want to test your Welcome Message, you can run the command
tmj
. Note if you have 4 and 8 enabled, it will trigger a member log as well.To see the current value of your welcome message in plain text run
gs 0 show
- async icon(ctx, idol)
Manually changes the server icon to a specified idol.
Syntax:
!!icon <idol>
Example:
!!icon mia
- Parameters:
idol (str, required) – The name of the idol, which determines the image file used for the server icon.
- Returns:
An embed message indicating whether the icon was successfully updated or if the file was not found.
- Return type:
discord.Message
- async lockdown(ctx: Context, channel: TextChannel = None, role1: Role = None)
Initiates a server lockdown to prevent message sending in specified channels or server wide in case of raids.
Syntax:
!!lockdown [channel] [role]
Example:
!!lockdown !!lockdown #my-channel
- Parameters:
channel (discord.TextChannel, optional) – The channel to lockdown. Defaults to the all if none supplied.
role1 (discord.Role, optional) – The role to be restricted from sending messages. Defaults to all if none supplied.
- Returns:
A confirmation message and an embedded report of the lockdown status.
- Return type:
discord.Message
- async ping(ctx)
Ping’s a pre-determined server to see latency of the bot
Syntax:
!!ping
- Returns:
Latency statistics including web socket latency and total latency
- Return type:
discord.Message
- async purge(ctx, limit: int | None, channel: TextChannel = None)
Deletes the last Nth number of messages from a specified channel.
Defaults to deleting 1 message if no limit is provided.
The channel can be specified; otherwise, it defaults to the current channel.
If the current channel is defaulted to, the message executing the command will automatically be deleted and is not counted in the ‘limit’.
Syntax:
!!purge [limit] [channel]
Example:
!!purge !!purge 5 !!purge #my-channel 50
- Parameters:
limit (int, optional) – The number of messages to delete. Defaults to 1 if not specified.
channel (discord.TextChannel, optional) – The channel from which to delete messages. If not specified, the current channel is used.
- Returns:
A confirmation message of the number of messages deleted.
- Return type:
discord.Message
- async raffleany(ctx, role: Role = None)
Raffles a random user from the specified role.
Syntax:
!!raffleany <role>
Example:
!!raffleany @YourRole
- Parameters:
role (discord.Role) – The role from which to select a random member.
- Returns:
The mention of the randomly selected member or an error message if no members are in the role.
- Return type:
discord.Message
- async react(ctx, channel: TextChannel, message_id: int, emoji: str)
Add a reaction as Chisato to a message. The emote used must be from a guild that Chii-chan is also in.
Syntax:
!!react <ch_mention> <msg_id> <emoji>
Example:
!!react #general 1234567890123456789 😊
- Parameters:
channel (discord.TextChannel) – The channel containing the message
message_id (int) – The ID of the message to react to
emoji (discord.Emoji) – The emoji to react with
- Returns:
Confirmation message or error message, a reaction on the message given.
- Return type:
discord.Message, discord.Emoji
- async remove(ctx, role: Role)
Removes all members from the specified role.
Syntax:
!!remove <role>
Example:
!!remove @RoleName
- Parameters:
role (discord.Role) – The role from which all members will be removed.
- Returns:
Confirmation message about the removal or an error message if the operation fails.
- Return type:
discord.Message
- async report(ctx)
Returns total member counts for server, bots, boosts, and patrons.
Syntax:
!!report
- Returns:
A message displaying the total member counts for the server, including bots, boosts, and patrons.
- Return type:
discord.Message
- async revert_general_2(ctx)
Manually reverts the name of #general-2.
Aliases:
gen2
Syntax:
!!revert_general_2
- Returns:
Confirmation message.
- Return type:
discord.Message
Deprecated since version —: 04/06/2024
- async role(ctx, *args)
Returns a list of all members in the role given.
Syntax:
!!role <role_name>
Example:
!!role Admins
- Parameters:
role_name (str, required) – The name of the role to list members from.
- Returns:
A message listing all members in the specified role.
- Return type:
discord.Message
- async roleall(ctx, roleid: int)
Issues the specified role to all guild members with the “School Idol” role.
Syntax:
!!roleall <role_id>
Example:
!!roleall 123456789012345678
- Parameters:
roleid (int) – The ID of the role to apply to eligible members.
- Returns:
A message indicating the number of members who received the role and any errors encountered.
- Return type:
discord.Message
- async roleallu(ctx, roleid: int)
Issues the specified role to all guild members who do not have the “School Idol” role.
Syntax:
!!roleallu <role_id>
Example:
!!roleallu 123456789012345678
- Parameters:
roleid (int) – The ID of the role to apply to unverified members.
- Returns:
A message indicating the number of unverified members who received the role, the total number of unverified members, and any errors encountered.
- Return type:
discord.Message
- async roleinfo(ctx, *, role_input)
Returns detailed information about a role based on its name or ID.
Syntax:
!!roleinfo <role_name_or_ID>
Example:
!!roleinfo Admin !!roleinfo 1087209602619293738
- Parameters:
role_input (str or int, required) – The name or ID of the role to retrieve information about.
- Returns:
An embed message containing detailed information about the specified role.
- Return type:
discord.Message
- async roles(ctx)
List all server roles
Syntax:
!!roles
- Returns:
A list of all server roles
- Return type:
discord.Embed
- async rreact(ctx, channel_id, message_id, emoji_name)
Removes all reactions of a specified emoji from a particular message. To prevent API time-outs the rate is set to 1 reaction per second.
Syntax:
!!rreact <channel_id> <message_id> <emoji_name>
Example:
!!rreact 123456789012345678 987654321098765432 :thumbsup:
- Parameters:
channel_id (int, required) – The ID of the channel where the message is located.
message_id (int, required) – The ID of the message from which reactions will be removed.
emoji_name (str or int, required) – The name or ID of the emoji whose reactions will be removed.
- Returns:
A message indicating whether reactions of the specified emoji were found and removed.
- Return type:
discord.Message
- async say(ctx, opt: int | None, channel: TextChannel | None, *, msg=None)
Used to send messages to any channel as Chisato
Syntax:
!!say <channel> <msg>
Example:
!!say #general This is a message.
- Parameters:
channel (discord.TextChannel, optional) – The channel to send the message to.
msg (str, optional) – The message content to send.
- Returns:
A message sent as Chisato
- Return type:
discord.Message
- async server_stats(ctx)
LLR Stats for Nations.
Aliases:
ss
Syntax:
!!server_stats
- Returns:
Server statistics including total members, members with a nation, and percentages of each nation role
- Return type:
discord.Message
- async supporters(ctx)
View all of LLR’s Supporters (Premium Members)
Syntax:
!!supporters
- Returns:
A message listing all supporters in the server, categorized by their roles.
- Return type:
discord.Message
- async unlock(ctx: Context, channel: TextChannel = None, role1: Role = None)
Restores normal functionality to the server after a lockdown.
Syntax:
!!unlock
- Parameters:
channel (discord.TextChannel, optional) – The channel to unlock. Defaults to the all if none supplied.
role1 (discord.Role, optional) – The role to be allowed to send messages again. Defaults to all if none supplied.
- Returns:
A confirmation message and an embedded report of the unlock status.
- Return type:
discord.Message