Le channel par défaut est le channel de l'interaction
This commit is contained in:
parent
db0913f50b
commit
4abc4e20b5
|
@ -13,7 +13,7 @@ class Fun(MyCog):
|
||||||
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, message: str, channel: discord.TextChannel=None):
|
||||||
"""
|
"""
|
||||||
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
|
||||||
|
@ -21,6 +21,9 @@ class Fun(MyCog):
|
||||||
:param message: Message à partagerE
|
:param message: Message à partagerE
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
if channel is None:
|
||||||
|
channel = interaction.channel
|
||||||
|
|
||||||
to_send = f"**Quelqu'un m'a chuchoté :** \"{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} !"
|
||||||
|
|
Loading…
Reference in New Issue