forked from sass/tipibot
Added Fienta integration
This commit is contained in:
28
commands/lan_fienta_commands.py
Normal file
28
commands/lan_fienta_commands.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
import discord
|
||||
from discord import app_commands
|
||||
|
||||
from core import lan_fienta
|
||||
import strings as S
|
||||
|
||||
|
||||
def register_lan_fienta_commands(
|
||||
tree: app_commands.CommandTree,
|
||||
bot: discord.Client,
|
||||
log: logging.Logger,
|
||||
) -> None:
|
||||
@tree.command(name="fientasync", description=S.CMD["fientasync"])
|
||||
@app_commands.guild_only()
|
||||
@app_commands.default_permissions(manage_guild=True)
|
||||
async def cmd_fientasync(interaction: discord.Interaction):
|
||||
await interaction.response.defer(ephemeral=True)
|
||||
try:
|
||||
summary = await lan_fienta.resync_all(bot)
|
||||
except Exception as exc:
|
||||
log.exception("/fientasync failed")
|
||||
await interaction.followup.send(f"❌ Fienta sync failed: `{exc}`", ephemeral=True)
|
||||
return
|
||||
await interaction.followup.send(f"✅ Fienta sync done: `{summary.short()}`", ephemeral=True)
|
||||
Reference in New Issue
Block a user