Skip to content

Commit

Permalink
fix(cogs.core): use blacklist check util, del cog_check
Browse files Browse the repository at this point in the history
  • Loading branch information
samsunghappytree123 committed Oct 20, 2022
1 parent 45f8595 commit 3263045
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions cogs/core.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
import asyncio
import datetime

import discord
from discord.commands import Option, permissions, slash_command
from discord.ext import commands

import config
from utils.database import *
from utils.embed import *
from utils.checks import blacklist_check


class core(commands.Cog):
def __init__(self, bot):
self.bot = bot

async def cog_check(self):
if await BLACKLIST.search(self.author.id):
embed = Embed.ban_info(await BLACKLIST.search(self.author.id))
await self.respond(embed=embed, ephemeral=True)
return False
else:
return True

@commands.slash_command(
name="가이드라인",
description="'짤방러' 봇의 가이드라인을 확인할 수 있어요.",
checks=[cog_check],
checks=[blacklist_check],
)
async def 가이드라인(self, ctx):
embed = discord.Embed(
Expand Down Expand Up @@ -56,7 +44,7 @@ async def 가이드라인(self, ctx):
@commands.slash_command(
name="정보",
description="'짤방러' 봇의 자세한 정보를 알아볼 수 있어요.",
checks=[cog_check],
checks=[blacklist_check],
)
async def 정보(self, ctx):
embed = discord.Embed(
Expand Down Expand Up @@ -94,7 +82,7 @@ async def 정보(self, ctx):
@commands.slash_command(
name="크레딧",
description="'짤방러' 봇의 크레딧(기타 정보)을 알아볼 수 있어요.",
checks=[cog_check],
checks=[blacklist_check],
)
async def 크레딧(self, ctx):
embed = discord.Embed(
Expand Down

0 comments on commit 3263045

Please sign in to comment.