dev #1

Merged
Arthur merged 18 commits from dev into main 2023-12-22 22:50:23 +01:00
1 changed files with 36 additions and 36 deletions
Showing only changes of commit db0913f50b - Show all commits

View File

@ -1,36 +1,36 @@
import discord import discord
import random import random
from discord import app_commands from discord import app_commands
from discord.app_commands import Choice from discord.app_commands import Choice
from discord.ext import commands from discord.ext import commands
from classes.my_cog import MyCog from classes.my_cog import MyCog
class Fun(MyCog): class Fun(MyCog):
def __init__(self, bot): def __init__(self, bot):
super().__init__(bot) super().__init__(bot)
self.bot = bot self.bot = bot
@app_commands.command(name="chuchoter") @app_commands.command(name="chuchoter")
async def chuchoter(self, interaction: discord.Interaction, channel: discord.TextChannel, message: str): async def chuchoter(self, interaction: discord.Interaction, channel: discord.TextChannel, message: str):
""" """
Chuchote à Staticky un message qu'il partagera (attention ne lui faites pas aveuglément confiance) Chuchote à Staticky un message qu'il partagera (attention ne lui faites pas aveuglément confiance)
:param interaction: discord interaction :param interaction: discord interaction
:param channel: Salon dans lequel le message sera partagé :param channel: Salon dans lequel le message sera partagé
:param message: Message à partagerE :param message: Message à partagerE
""" """
try: try:
to_send = f"**Quelqu'un m'a chuchoter :** \"{message}\"" to_send = f"**Quelqu'un m'a chuchoté :** \"{message}\""
if random.randint(1, 6) == 1: if random.randint(1, 6) == 1:
to_send += f"\nJe balance, c'est {interaction.user.mention} !" to_send += f"\nJe balance, c'est {interaction.user.mention} !"
await channel.send(to_send) await channel.send(to_send)
await interaction.response.send_message(f"Message envoyé dans {channel.mention}\n>>> {message}", await interaction.response.send_message(f"Message envoyé dans {channel.mention}\n>>> {message}",
ephemeral=True) ephemeral=True)
except Exception as e: except Exception as e:
await interaction.response.send_message(f"Le message n'a pas pu être envoyé...\n`Erreur : {e}`", await interaction.response.send_message(f"Le message n'a pas pu être envoyé...\n`Erreur : {e}`",
ephemeral=True) ephemeral=True)
async def setup(bot): async def setup(bot):
await bot.add_cog(Fun(bot)) await bot.add_cog(Fun(bot))