我使用repl.it来制作我的Discord机器人。我使用了Python,并遵循了本教程:
https://www.youtube.com/watch?v=SPTfmiYiuok
这是我的代码:
import discord
import os
client = discord.Client ()
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
my_secret = os.environ['token']
您似乎缺少client.run(my_secret)