【发布时间】:2017-10-13 08:14:41
【问题描述】:
我正在尝试使用 discord.py 编写一个简单的机器人,所以我从有趣的命令开始熟悉这个库。
import discord
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 message.channel.send(f"hugs {message.author.mention}")
if message.content.startswith('!best'):
user_id = "201909896357216256"
user_mention = ??? # How to convert user_id into a mention
await message.channel.send(f'{user_mention} is the best')
【问题讨论】:
标签: python discord.py