feat: Refactored all cogs implementation
Some checks failed
CI / Run tests (pull_request) Has been cancelled
Some checks failed
CI / Run tests (pull_request) Has been cancelled
This commit is contained in:
@@ -5,11 +5,12 @@ import random
|
||||
import discord
|
||||
from discord import option
|
||||
from discord.ext import commands
|
||||
from cogs import FeatureCog
|
||||
|
||||
|
||||
class RouletteCog(commands.Cog):
|
||||
class RouletteCog(FeatureCog):
|
||||
def __init__(self, bot: discord.Bot):
|
||||
self.bot = bot
|
||||
super().__init__(bot, feature_name="roulette")
|
||||
self.cooldown = 60 * 3
|
||||
self.active_games = {}
|
||||
|
||||
@@ -155,6 +156,10 @@ class RouletteCog(commands.Cog):
|
||||
ctx: discord.ApplicationContext,
|
||||
target: discord.Member,
|
||||
):
|
||||
# ensure feature enabled for this guild
|
||||
if not ctx.guild or not self.is_enabled(ctx.guild.id):
|
||||
await ctx.respond("Roulette feature is disabled for this guild.", ephemeral=True)
|
||||
return
|
||||
author = ctx.author
|
||||
self_test = author.id == target.id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user