I want to send a message when my Discord Bot goes online

I want to send a message when my Discord Bot goes online, could someone help me figure out how I can do that without asking for any input. It just sends this message when it is deployed/becomes online.

import discord

client = discord.Client()



@client.event
async def on_ready():
    print("We have logged in as {0.user}".format(client))



async def send(message):
    await client.send_message("Hello")

client.run("TOKEN")

Have you tried with the on_ready function? Otherwise I suggest looking at documentation for discord.py

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.