mirror of
https://github.com/wlinator/luminara.git
synced 2024-10-02 20:23:12 +00:00
Fix guild_only checks
This commit is contained in:
parent
8a3c78232f
commit
82c09c567a
6 changed files with 22 additions and 7 deletions
5
main.py
5
main.py
|
@ -1,13 +1,10 @@
|
|||
import os
|
||||
import platform
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
import discord
|
||||
from discord.ext import commands, bridge
|
||||
from discord.ext import bridge
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from lib.embeds.error import GenericErrors
|
||||
from lib.embeds.greet import Greet
|
||||
from config import json_loader
|
||||
from handlers.ReactionHandler import ReactionHandler
|
||||
|
|
|
@ -21,6 +21,7 @@ class Admin(commands.Cog):
|
|||
help="Awards cash to a specific user. This command can only be performed by a bot administrator.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
@commands.check(checks.bot_owner)
|
||||
async def award_command(self, ctx, *, user: discord.User, amount: int):
|
||||
|
|
|
@ -43,10 +43,12 @@ class Birthdays(commands.Cog):
|
|||
|
||||
@birthday.command(
|
||||
name="set",
|
||||
description="Set your birthday."
|
||||
description="Set your birthday.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.cooldown(1, 10, commands.BucketType.user)
|
||||
@commands.check(checks.birthday_module)
|
||||
@commands.check(checks.channel)
|
||||
async def set_birthday(self, ctx, *,
|
||||
month: discord.Option(choices=months),
|
||||
day: discord.Option(int)):
|
||||
|
@ -67,10 +69,12 @@ class Birthdays(commands.Cog):
|
|||
|
||||
@birthday.command(
|
||||
name="upcoming",
|
||||
description="See upcoming birthdays!"
|
||||
description="See upcoming birthdays!",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.cooldown(1, 10, commands.BucketType.user)
|
||||
@commands.check(checks.birthday_module)
|
||||
@commands.check(checks.channel)
|
||||
async def upcoming_birthdays(self, ctx):
|
||||
upcoming_birthdays = Birthday.get_upcoming_birthdays(ctx.guild.id)
|
||||
icon = ctx.guild.icon if ctx.guild.icon else "https://i.imgur.com/79XfsbS.png"
|
||||
|
|
|
@ -19,6 +19,7 @@ class Economy(commands.Cog):
|
|||
"all servers.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
async def balance_command(self, ctx):
|
||||
return await balance.cmd(ctx)
|
||||
|
@ -35,6 +36,7 @@ class Economy(commands.Cog):
|
|||
help="Start a game of blackjack.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
async def blackjack_command(self, ctx, *, bet: int):
|
||||
return await blackjack.cmd(ctx, bet)
|
||||
|
@ -56,6 +58,7 @@ class Economy(commands.Cog):
|
|||
help="Claim your daily reward! The daily reset is at 7 AM EST.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
async def daily_command(self, ctx):
|
||||
return await daily.cmd(ctx)
|
||||
|
@ -71,6 +74,7 @@ class Economy(commands.Cog):
|
|||
help="Give another server member some cash.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
async def give_command(self, ctx, *, user: discord.Member, amount: int):
|
||||
return await give.cmd(ctx, user, amount)
|
||||
|
@ -85,6 +89,8 @@ class Economy(commands.Cog):
|
|||
help="Give another user some cash. You can use someone's user ID or mention someone. The user has to be in the "
|
||||
"guild you invoke this command in."
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
async def give_command_prefixed(self, ctx, user: discord.User, *, amount: int):
|
||||
|
||||
try:
|
||||
|
@ -111,6 +117,7 @@ class Economy(commands.Cog):
|
|||
help="Display your inventory, this will also show your Racu badges if you have any.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
async def inventory(self, ctx):
|
||||
return await inventory.cmd(self, ctx)
|
||||
|
@ -122,6 +129,7 @@ class Economy(commands.Cog):
|
|||
"it will lead you through the process of selling items.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
async def sell_command(self, ctx):
|
||||
return await sell.cmd(self, ctx)
|
||||
|
@ -133,6 +141,7 @@ class Economy(commands.Cog):
|
|||
help="Starts a slots game.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
async def slots_command(self, ctx, *, bet: int):
|
||||
return await slots.cmd(self, ctx, bet)
|
||||
|
@ -151,6 +160,7 @@ class Economy(commands.Cog):
|
|||
description="Display your stats (BETA)",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
async def stats_command(self, ctx, *, game: discord.Option(choices=["BlackJack", "Slots"])):
|
||||
return await stats.cmd(self, ctx, game)
|
||||
|
@ -165,6 +175,7 @@ class Economy(commands.Cog):
|
|||
aliases=["stat"],
|
||||
help="Display your gambling stats, you can choose between \"blackjack\" or \"slots\"."
|
||||
)
|
||||
@commands.guild_only()
|
||||
async def stats_command_prefix(self, ctx, *, game: str):
|
||||
|
||||
if game.lower() == "blackjack" or game.lower() == "bj":
|
||||
|
|
|
@ -16,7 +16,9 @@ class Levels(commands.Cog):
|
|||
help="Displays your level and rank in the current server.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
@commands.cooldown(1, 30, commands.BucketType.user)
|
||||
async def level_command(self, ctx):
|
||||
await level.cmd(ctx)
|
||||
|
||||
|
@ -27,6 +29,7 @@ class Levels(commands.Cog):
|
|||
help="Shows the guild's level leaderboard by default. You can switch to currency and /daily leaderboard.",
|
||||
guild_only=True
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
@commands.cooldown(1, 180, commands.BucketType.user)
|
||||
async def leaderboard_command(self, ctx):
|
||||
|
|
|
@ -28,7 +28,6 @@ class Misc(commands.Cog):
|
|||
description="Racu uptime",
|
||||
help="See how long Racu has been online, the uptime shown will reset when the Misc module is reloaded.",
|
||||
)
|
||||
@commands.guild_only()
|
||||
@commands.check(checks.channel)
|
||||
async def uptime(self, ctx):
|
||||
|
||||
|
|
Loading…
Reference in a new issue