Je suis en train de coder un robot simple à l'aide discord.py alors j'ai commencé avec le plaisir des commandes comme juste pour obtenir le blocage de l'apicomment puis-je mentionner un utilisateur en utilisant l'identifiant de l'utilisateur dans discord.py
import discord
import asyncio
client = discord.Client()
@client.event
async def on_message(message):
# we do not want the bot to reply to itself
if message.author == client.user:
return
if message.content.startswith('!hug'):
await client.send_message(message.channel, "hugs {0.author.mention}".format(message))
# Greetings
if message.content.startswith('hello'):
msg = 'Hello {0.author.mention}'.format(message)
await client.send_message(message.channel, msg)
# say (id) is the best
# This is where I am lost. how to mention someone's name or id ?
if message.content.startswith('!best'):
mid = User.id('ZERO#6885').format(message)
await client.send_message(message.channel, '{mid} mentioned')
D'où provient 'discord.py'? – boardrider