Не работают любые команды discord.py
Пытаюсь отвечать на команды игрока через @bot.command, но абсолютно ничего не работает. Вроде все верно делаю по вики, но не выходит
(в functions находится только text_line())
import asyncio
import discord
from discord.ext import commands
from functions import *
# Vars
client = discord.Client()
bot = commands.Bot(command_prefix="!")
# Functions
@client.event
async def on_ready():
text_line("Discord bot")
print("[!] Auth as {0.user}".format(client))
print("[!] Latency: {0.latency}".format(client))
print("[!] Activity: {0.activity}".format(client))
print("[!] Nitro status: {0.user.premium_type}".format(client))
@bot.command(pass_context=True)
async def say(ctx):
await ctx.send("hello")
# All messages
@client.event
async def on_message(message):
if message.author == client.user:
# Log bot messages
print("[+] Bot send message in {0.channel}: {0.content}".format(message))
return
# Log player messages
print("[+] New message from {0.author} in {0.channel}: {0.content}".format(message))
# Run
client.run(ur_token)
Ответы (1 шт):
Автор решения: Slavatar
→ Ссылка
Проблема заключалась в том, что я забыл сменить client.run на bot.run