L
L
lecent172022-02-18 23:02:43
Python
lecent17, 2022-02-18 23:02:43

How to do something to the console displayed messages about the launch of the bot?

Hello, I need something when I run a bot in Python, messages are displayed in the console. I can't think of a way to do all this.

Thus everything works without errors

import discord

client = discord.Client()

async def on_ready():
    print('Бот успешно запущен!')
    
client.run('')


And here is the code written now:
from discord.ext import commands

bot = commands.Bot(command_prefix='!')

@bot.command()
async def test(ctx):
    print('Бот успешно запущен!')
    
bot.run('')


But when I run the code, nothing is displayed in the console, but the bot works. I also tried to call the function as in the first example, but to no avail

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lecent17, 2022-02-18
@lecent17

#bot ready to work
@bot.listen('on_ready')
async def on_ready():
    print('The bot has successfully started working on all servers')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question