1
0
mirror of https://gitlab.com/ddorn/tfjm-discord-bot.git synced 2024-12-26 05:02:22 +00:00

case case_insensitive bot

This commit is contained in:
ddorn 2020-05-18 16:51:23 +02:00
parent 7db0664252
commit b3eaacdd0b
5 changed files with 14 additions and 28 deletions

View File

@ -125,7 +125,7 @@ class DevCog(Cog, name="Dev tools"):
await ctx.send(f":tada: L'extension **{name}** a bien été ajoutée !")
# noinspection PyUnreachableCode
@command(name="setup", hidden=True)
@command(name="setup")
@has_role(Role.DEV)
async def setup_roles(self, ctx):
"""
@ -187,7 +187,7 @@ class DevCog(Cog, name="Dev tools"):
@command(name="send")
@has_role(Role.DEV)
async def send_cmd(self, ctx, *msg):
"""Envoie un message."""
"""(dev) Envoie un message."""
await ctx.message.delete()
await ctx.send(" ".join(msg))

View File

@ -398,7 +398,7 @@ class MiscCog(Cog, name="Divers"):
with open(File.JOKES_V2, "w") as f:
yaml.safe_dump_all(jokes, f)
@group(name="joke", invoke_without_command=True)
@group(name="joke", invoke_without_command=True, case_insensitive=True)
async def joke(self, ctx: Context):
m: discord.Message = ctx.message

View File

@ -115,7 +115,7 @@ class TeamsCog(Cog, name="Teams"):
return f"{ctx.author.mention} à été ajouté comme spectateur dans à {tournoi}."
@group(name="team", invoke_without_command=True)
@group(name="team", invoke_without_command=True, case_insensitive=True, hidden=True)
async def team(self, ctx):
"""Groupe de commandes pour la gestion des équipes."""

View File

@ -510,7 +510,7 @@ class TirageCog(Cog, name="Tirages"):
@commands.command(name="dice-all", aliases=["da"])
@commands.has_role(Role.DEV)
async def dice_all_cmd(self, ctx, *teams):
"""Lance un dé pour chaque equipe afin de tester les tirages."""
"""(dev) Lance un dé pour chaque equipe afin de tester les tirages."""
channel = ctx.channel.id
if channel in self.tirages:
for t in teams:
@ -565,7 +565,13 @@ class TirageCog(Cog, name="Tirages"):
# ---------- Commandes du groupe draw ----------- #
@group(name="draw", aliases=["d", "tirage"], invoke_without_command=True)
@group(
name="draw",
aliases=["d", "tirage"],
invoke_without_command=True,
case_insensitive=True,
hidden=True,
)
async def draw_group(self, ctx: Context) -> None:
"""Groupe de commandes pour les tirages."""
@ -633,26 +639,6 @@ class TirageCog(Cog, name="Tirages"):
else:
await ctx.send("Il n'y a pas de tirage en cours.")
#
# @draw_group.command(name="skip", aliases=["s"])
# @commands.has_role(Role.DEV)
# async def draw_skip(self, ctx, *teams: discord.Role):
# """(dev) Passe certaines phases du tirage."""
# channel = ctx.channel.id
# self.tirages[channel] = tirage = Tirage(ctx, channel, teams)
#
# tirage.phase = TiragePhase(tirage, round=1)
# for i, team in enumerate(tirage.teams):
# team.tirage_order = [i + 1, i + 1]
# team.passage_order = [i + 1, i + 1]
# team.accepted_problems = [PROBLEMS[i], PROBLEMS[-i - 1]]
# tirage.teams[0].rejected = [{PROBLEMS[3]}, set(PROBLEMS[4:8])]
# tirage.teams[1].rejected = [{PROBLEMS[7]}, set()]
#
# await ctx.send(f"Skipping to {tirage.phase.__class__.__name__}.")
# await tirage.phase.start(ctx)
# await tirage.update_phase(ctx)
def get_tirages(self) -> Dict[int, BaseTirage]:
return DiscordTirage.load_all()
@ -706,7 +692,7 @@ class TirageCog(Cog, name="Tirages"):
@commands.has_role(Role.DEV)
async def send_cmd(self, ctx, tirage_id: int, poule="A", round: int = 1):
"""
Envoie les poules sur tfjm.org
(dev) Envoie les poules sur tfjm.org
Exemple:
`!draw send 42 B 1` - Envoie la poule B1 du tirage n°42.

View File

@ -15,7 +15,7 @@ tirages = {}
def start():
bot = CustomBot(("! ", "!"))
bot = CustomBot(("! ", "!"), case_insensitive=True)
@bot.event
async def on_ready():