【发布时间】:2021-12-01 14:33:12
【问题描述】:
我正在制作一个不和谐的机器人,但遇到了机器人无法启动的问题,如果你能帮助我,我将不胜感激)。该机器人是在 python 中创建的
# -*- coding: utf-8 -*-
import discord
from discord.ext import commands
from config import token
import youtube_dl
import os
bot = commands.Bot(command_prefix='!')
@bot.event
async def on_ready():
print('bot online!')
@bot.event()
async def on_message():
print('New Message!')
bot.run(token)
【问题讨论】:
-
您将
@bot.event()用于一个装饰器,将@bot.event用于另一个。这是故意的吗?
标签: python python-3.x discord.py