mirror of
https://github.com/neoarz/Syntrel.git
synced 2025-12-25 03:40:11 +01:00
feat(bot): make syntrel work in dms and group chats
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import discord
|
||||
from discord import app_commands
|
||||
from discord.ext import commands
|
||||
from discord.ext.commands import Context
|
||||
|
||||
@@ -8,6 +9,9 @@ from .minesweeper import minesweeper_command
|
||||
from .randomfact import randomfact_command
|
||||
from .rockpaperscissors import rps_command
|
||||
|
||||
|
||||
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
|
||||
@app_commands.allowed_installs(guilds=True, users=True)
|
||||
class Fun(commands.GroupCog, name="fun"):
|
||||
def __init__(self, bot) -> None:
|
||||
self.bot = bot
|
||||
@@ -66,6 +70,8 @@ class Fun(commands.GroupCog, name="fun"):
|
||||
name="coinflip",
|
||||
description="Make a coin flip, but give your bet before."
|
||||
)
|
||||
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
|
||||
@app_commands.allowed_installs(guilds=True, users=True)
|
||||
async def coinflip(self, context):
|
||||
return await coinflip_command()(self, context)
|
||||
|
||||
@@ -74,6 +80,8 @@ class Fun(commands.GroupCog, name="fun"):
|
||||
name="8ball",
|
||||
description="Ask any question to the bot.",
|
||||
)
|
||||
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
|
||||
@app_commands.allowed_installs(guilds=True, users=True)
|
||||
async def eight_ball(self, context, *, question: str):
|
||||
return await eightball_command()(self, context, question=question)
|
||||
|
||||
@@ -82,11 +90,15 @@ class Fun(commands.GroupCog, name="fun"):
|
||||
name="minesweeper",
|
||||
description="Play a buttoned minesweeper mini-game."
|
||||
)
|
||||
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
|
||||
@app_commands.allowed_installs(guilds=True, users=True)
|
||||
async def minesweeper(self, context):
|
||||
return await minesweeper_command()(self, context)
|
||||
|
||||
@commands.check(_require_group_prefix)
|
||||
@commands.hybrid_command(name="randomfact", description="Get a random fact.")
|
||||
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
|
||||
@app_commands.allowed_installs(guilds=True, users=True)
|
||||
async def randomfact(self, context):
|
||||
return await randomfact_command()(self, context)
|
||||
|
||||
@@ -94,6 +106,8 @@ class Fun(commands.GroupCog, name="fun"):
|
||||
@commands.hybrid_command(
|
||||
name="rps", description="Play the rock paper scissors game against the bot."
|
||||
)
|
||||
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
|
||||
@app_commands.allowed_installs(guilds=True, users=True)
|
||||
async def rock_paper_scissors(self, context):
|
||||
return await rps_command()(self, context)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user