Add modlog setting for eventual modlog command
This commit is contained in:
parent
ca91bc1e26
commit
e3273ea081
1 changed files with 22 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
import discord
|
||||
import jarvis
|
||||
from discord import Role
|
||||
from discord import Role, TextChannel
|
||||
from discord.ext import commands
|
||||
from discord_slash import cog_ext
|
||||
from discord_slash.utils.manage_commands import create_option
|
||||
|
@ -45,6 +45,27 @@ class SettingsCog(commands.Cog):
|
|||
self.update_settings("mute", role.id, ctx.guild.id)
|
||||
await ctx.send(f"Settings applied. New mute role is `{role.name}`")
|
||||
|
||||
@cog_ext.cog_subcommand(
|
||||
base="settings",
|
||||
name="modlog",
|
||||
description="Set modlog channel",
|
||||
options=[
|
||||
create_option(
|
||||
name="channel",
|
||||
description="Modlog channel",
|
||||
option_type=7,
|
||||
required=True,
|
||||
)
|
||||
],
|
||||
)
|
||||
@admin_or_permissions(mute_members=True)
|
||||
async def _modlog(self, ctx, channel: TextChannel):
|
||||
await ctx.defer()
|
||||
self.update_settings("modlog", channel.id, ctx.guild.id)
|
||||
await ctx.send(
|
||||
f"Settings applied. New modlog channel is `{channel.name}`"
|
||||
)
|
||||
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(SettingsCog(bot))
|
||||
|
|
Loading…
Add table
Reference in a new issue