mirror of
https://github.com/wlinator/luminara.git
synced 2024-10-02 20:23:12 +00:00
chore: Update mod-log channel configuration and add info embed
This commit is contained in:
parent
0bdf2ea7c4
commit
4842c41b0a
2 changed files with 35 additions and 2 deletions
|
@ -49,6 +49,13 @@
|
|||
"config_level_type_whimsical": "level announcements will be **sarcastic comments**.",
|
||||
"config_level_type_whimsical_example": "📈 | **lucas** Lol it took you this long to reach **Level 15**.",
|
||||
"config_modlog_channel_set": "moderation logs will be sent in {0}.",
|
||||
"config_modlog_info_author": "Moderation Log Configuration",
|
||||
"config_modlog_info_commands_name": "📖 Case commands",
|
||||
"config_modlog_info_commands_value": "`/cases` - View all cases in this server\n`/case <case_id>` - View a specific case\n`/editcase <case_id> <new_reason>` - Update a case reason",
|
||||
"config_modlog_info_description": "This channel has been set as the moderation log channel for **{0}**. All moderation actions issued with Lumi will be logged here as cases.",
|
||||
"config_modlog_info_warning_name": "⚠️ Warning",
|
||||
"config_modlog_info_warning_value": "Changing the mod-log channel in the future will make old cases uneditable in this channel.",
|
||||
"config_modlog_permission_error": "I don't have perms to send messages in that channel. Please fix & try again.",
|
||||
"config_prefix_get": "the current prefix for this server is `{0}`.",
|
||||
"config_prefix_set": "the prefix has been set to `{0}`.",
|
||||
"config_prefix_too_long": "the prefix must be 25 characters or less.",
|
||||
|
|
|
@ -2,16 +2,42 @@ import discord
|
|||
from lib.embed_builder import EmbedBuilder
|
||||
from lib.constants import CONST
|
||||
from services.moderation.modlog_service import ModLogService
|
||||
from lib.exceptions.LumiExceptions import LumiException
|
||||
|
||||
|
||||
async def set_mod_log_channel(ctx, channel: discord.TextChannel):
|
||||
mod_log = ModLogService()
|
||||
|
||||
info_embed = EmbedBuilder().create_success_embed(
|
||||
ctx=ctx,
|
||||
author_text=CONST.STRINGS["config_modlog_info_author"],
|
||||
description=CONST.STRINGS["config_modlog_info_description"].format(
|
||||
ctx.guild.name,
|
||||
),
|
||||
show_name=False,
|
||||
)
|
||||
info_embed.add_field(
|
||||
name=CONST.STRINGS["config_modlog_info_commands_name"],
|
||||
value=CONST.STRINGS["config_modlog_info_commands_value"],
|
||||
inline=False,
|
||||
)
|
||||
info_embed.add_field(
|
||||
name=CONST.STRINGS["config_modlog_info_warning_name"],
|
||||
value=CONST.STRINGS["config_modlog_info_warning_value"],
|
||||
inline=False,
|
||||
)
|
||||
|
||||
try:
|
||||
await channel.send(embed=info_embed)
|
||||
except discord.errors.Forbidden as e:
|
||||
raise LumiException(CONST.STRINGS["config_modlog_permission_error"]) from e
|
||||
|
||||
mod_log.set_modlog_channel(ctx.guild.id, channel.id)
|
||||
|
||||
embed = EmbedBuilder().create_success_embed(
|
||||
success_embed = EmbedBuilder().create_success_embed(
|
||||
ctx=ctx,
|
||||
author_text=CONST.STRINGS["config_author"],
|
||||
description=CONST.STRINGS["config_modlog_channel_set"].format(channel.mention),
|
||||
)
|
||||
|
||||
return await ctx.respond(embed=embed)
|
||||
return await ctx.respond(embed=success_embed)
|
||||
|
|
Loading…
Reference in a new issue