Limit autoreact to TextChannels, closes #40

This commit is contained in:
Zeva Rose 2021-07-11 16:54:07 -06:00
parent 8a7a2a63ff
commit 8eaba58992

View file

@ -4,7 +4,7 @@ from datetime import datetime
from discord import TextChannel
from discord.ext import commands
from discord.utils import find
from discord_slash import cog_ext
from discord_slash import SlashContext, cog_ext
from discord_slash.utils.manage_commands import create_option
import jarvis
@ -35,7 +35,10 @@ class AutoReactCog(commands.Cog):
],
)
@commands.has_permissions(administrator=True)
async def _autoreact_create(self, ctx, channel: TextChannel):
async def _autoreact_create(self, ctx: SlashContext, channel: TextChannel):
if not isinstance(channel, TextChannel):
await ctx.send("Channel must be a text channel", hidden=True)
return
exists = self.db.jarvis.autoreact.find_one(
{"guild": ctx.guild.id, "channel": channel.id}
)