Skip to content

Commit

Permalink
use guild commands for moderation stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
FO-nTTaX committed Aug 25, 2021
1 parent c773adb commit fa91148
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 5 additions & 4 deletions ftsbot/cogs/channelmoderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ def __init__(self, bot):
@slash_commands.has_any_role('Discord Admins', 'Liquipedia Employee', 'Administrator')
@slash_commands.command(description='Purge channel (admin only)', options=[
Option('channel', 'Which channel do you want to purge?', Type.CHANNEL)
])
], guild_ids=config.guild_ids)
async def channelpurge(self, ctx, channel=None):
if channel is None:
channel = ctx.channel
await ctx.send(embed=discord.Embed(colour=discord.Colour(0x00ff00), description='Channel ' + channel.name + ' is being purged'))
if channel is None or not channel.name.startswith('temp_'):
await ctx.send(embed=discord.Embed(colour=discord.Colour(0xff0000), description='Invalid channel'))
else:
Expand All @@ -29,7 +30,7 @@ async def channelpurge(self, ctx, channel=None):
@slash_commands.has_any_role('Discord Admins', 'Liquipedia Employee', 'Administrator')
@slash_commands.command(description='Creates a temp. private channel and invites the specified user to it (admin only)', options=[
Option('member', 'Who do you want to invite?', Type.USER, required=True)
])
], guild_ids=config.guild_ids)
async def channelcreate(self, ctx, member):
await ctx.send(embed=discord.Embed(colour=discord.Colour(0x00ff00), description='Channel with ' + member.name + ' is being created'))
guild = ctx.guild
Expand All @@ -53,7 +54,7 @@ async def channelcreate(self, ctx, member):
@slash_commands.has_any_role('Discord Admins', 'Liquipedia Employee', 'Administrator')
@slash_commands.command(description='Copies the specified temp. or active channel to the archive (admin only)', options=[
Option('channel', 'Where do you want to copy things from?', Type.CHANNEL)
])
], guild_ids=config.guild_ids)
async def channelcopy(self, ctx, channel=None):
if channel is None:
channel = ctx.channel
Expand All @@ -79,7 +80,7 @@ async def channelcopy(self, ctx, channel=None):
@slash_commands.has_any_role('Discord Admins', 'Liquipedia Employee', 'Administrator')
@slash_commands.command(description='Copies the specified temp. or active channel to the archive and deletes it (admin only)', options=[
Option('channel', 'Which do you want to delete?', Type.CHANNEL)
])
], guild_ids=config.guild_ids)
async def channelkill(self, ctx, channel=None):
if channel is None:
channel = ctx.channel
Expand Down
6 changes: 3 additions & 3 deletions ftsbot/cogs/rolecommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import discord
from dislash import *
from discord.ext import commands
from ftsbot import data
from ftsbot import config, data
from ftsbot.functions import rolefunctions

class rolecommands(commands.Cog):
Expand All @@ -19,7 +19,7 @@ def __init__(self, bot):
async def discordid(self, ctx):
await ctx.send(embed=discord.Embed(colour=discord.Colour(0x00ffff), description='User "' + ctx.author.name + '" has ID "' + str(ctx.author.id) + '"'))

@slash_commands.command(description='Get your wiki roles')
@slash_commands.command(description='Get your wiki roles', guild_ids=config.guild_ids)
async def wikiroles(self, ctx):
apidata = rolefunctions.wikiroles(ctx.author.id)
if apidata == False:
Expand All @@ -44,7 +44,7 @@ async def wikiroles(self, ctx):
await message.delete(delay=30)

@slash_commands.is_owner()
@slash_commands.command(description='Form setup (admin only)')
@slash_commands.command(description='Form setup (admin only)', guild_ids=config.guild_ids)
async def setup(self, ctx):
# Clean up channel
async for message in ctx.channel.history():
Expand Down
5 changes: 5 additions & 0 deletions ftsbot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,10 @@
# Copyright 2016-2021 Alex Winkler
# Version 3.0.0

guild_ids = [
93055209017729024,
223949725068427264
]

logtarget = 339287109988909057 # Here the channel id of the channel we want the private channel logs to be stored in
privcat = 360564294401916929 # This is the id of the "Private Channels" Category

0 comments on commit fa91148

Please sign in to comment.