Archived
1
0
Fork 0

fix slash core locale

This commit is contained in:
多羅狼 2024-01-11 19:16:52 +08:00 committed by GitHub
parent 9440078491
commit 5d7d814f2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 48 deletions

View file

@ -20,7 +20,10 @@ async def hlp(ctx: discord.ApplicationContext, module: str):
@client.slash_command(name="locale", description="Set the bot running languages.")
@discord.option(name="lang", description="Supported language codes.", autocomplete=auto_get_lang)
async def locale(ctx: discord.ApplicationContext, lang: str=None):
await slash_parser(ctx, lang)
if lang:
await slash_parser(ctx, lang)
else:
await slash_parser(ctx, "")
@client.slash_command(name="mute", description="Make the bot stop sending message.")

View file

@ -1,47 +0,0 @@
import discord
from bots.discord.client import client
from bots.discord.slash_parser import slash_parser
mai = client.create_group("maimai", "Queries about Maimai DX.")
@mai.command(name="b50", description="Query the Best50 list.")
@discord.option(name="beta", choices=['false', 'true'], description="Whether to use Beta mode.")
@discord.option(name="username", description="Your MaimaiDX-prober username.")
async def b50(ctx: discord.ApplicationContext, beta: str, username: str = None):
if beta == "true":
await slash_parser(ctx, f"b50 beta {username}")
else:
await slash_parser(ctx, f"b50 {username}")
@mai.command(name="bind", description="Bind user.")
@discord.option(name="username", description="Your MaimaiDX-prober username.")
async def bind(ctx: discord.ApplicationContext, username: str):
await slash_parser(ctx, f"bind {username}")
@mai.command(name="unbind", description="Unbind user.")
async def unbind(ctx: discord.ApplicationContext):
await slash_parser(ctx, "unbind")
chu = client.create_group("chunithm", "Queries about CHUNITHM.")
@chu.command(name="b30", description="Query the Best30 list.")
@discord.option(name="username", description="Your MaimaiDX-prober username.")
async def b50(ctx: discord.ApplicationContext, username: str = None):
await slash_parser(ctx, f"b30 {username}")
@chu.command(name="bind", description="Bind user.")
@discord.option(name="username", description="Your MaimaiDX-prober username.")
async def bind(ctx: discord.ApplicationContext, username: str):
await slash_parser(ctx, f"bind {username}")
@chu.command(name="unbind", description="Unbind user.")
async def unbind(ctx: discord.ApplicationContext):
await slash_parser(ctx, "unbind")