K
K
kokapuk2021-08-20 20:32:32
Python
kokapuk, 2021-08-20 20:32:32

Why doesn't client.login work?

import discord, asyncio

from discord.flags import Intents


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.content.startswith('$hello'):
        await message.channel. send('Hello!')

async def loopstart():
    await client.login('токен бота', bot=True)
    await client.connect(reconnect=True)

asyncio.run(loopstart())

Nothing happens on startup, I have an on_ready event but it doesn't fire, the bot goes online but does absolutely nothing.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question