Migration de Kuby vers disnake
This commit is contained in:
parent
dc6e235f27
commit
c8c579eefe
36 changed files with 1205 additions and 1253 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
from discord import app_commands
|
||||
import disnake
|
||||
from disnake.ext import commands
|
||||
import matplotlib.pyplot as plt
|
||||
import plotly.graph_objects as go
|
||||
import plotly.express as px
|
||||
|
|
@ -19,9 +18,9 @@ class StaffRatings(commands.Cog):
|
|||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
@app_commands.command(name="staff-ratings", description="Affiche les évaluations du staff")
|
||||
@app_commands.describe(team="Filtrer par équipe (optionnel)")
|
||||
async def staff_ratings(self, interaction: discord.Interaction, team: str = None):
|
||||
@commands.slash_command(name="staff-ratings", description="Affiche les évaluations du staff")
|
||||
async def staff_ratings(self, interaction: disnake.ApplicationCommandInteraction,
|
||||
team: str = commands.Param(None, description="Filtrer par équipe (optionnel)")):
|
||||
"""Commande pour afficher les évaluations du staff"""
|
||||
await interaction.response.defer(ephemeral=False)
|
||||
|
||||
|
|
@ -46,10 +45,10 @@ class StaffRatings(commands.Cog):
|
|||
chart_buffer = self.create_staff_rating_chart_matplotlib(staff_list)
|
||||
|
||||
# Create embed
|
||||
embed = discord.Embed(
|
||||
embed = disnake.Embed(
|
||||
title="📊 Évaluations du Staff",
|
||||
description="Performance globale du staff",
|
||||
color=discord.Color.blue(),
|
||||
color=disnake.Color.blue(),
|
||||
timestamp=datetime.now()
|
||||
)
|
||||
|
||||
|
|
@ -66,7 +65,7 @@ class StaffRatings(commands.Cog):
|
|||
)
|
||||
|
||||
# Send chart
|
||||
file = discord.File(chart_buffer, filename="staff_ratings.png")
|
||||
file = disnake.File(chart_buffer, filename="staff_ratings.png")
|
||||
await interaction.followup.send(embed=embed, file=file)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue