Skip to content Skip to sidebar Skip to footer

How To Send A Direct Message When Bot Is Ready

I'm trying to make a bot send me a dm when it's ready: @bot.event async def on_ready(): print('Ready when you are') print('I am running on: ' + bot.user.name) print('Wi

Solution 1:

You can just tell it to send a message to you, using your id (ids in discord.py 0.16 are strings by the way, not integers). If you have to reuse this code somewhere else, other bots won't necessarily be able to access the private channel between you and this bot. Something like:

@bot.event
async def on_ready():
    print("Ready when you are")
    print("I am running on: " + bot.user.name)
    print("With the ID: " + bot.user.id)
    owner = await bot.get_user_info("Your ID")
    await bot.send_message(owner, "Ready", tts=True)

Post a Comment for "How To Send A Direct Message When Bot Is Ready"