T
T
typical_user102020-08-10 20:41:53
Python
typical_user10, 2020-08-10 20:41:53

How to display the name of the ds server?

I made it so that when the on_guild_join event happens, the bot unsubscribes to me that he has joined the server. I want it to display the name of the server as well, but I just can't do it. Tell me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Nevzorov, 2020-08-11
@fixator10

The on_guild_joinargument is passed to guild, which is the server that the bot has joined.
https://discordpy.readthedocs.io/en/v1.4.1/api.htm...

import logging

@listener  # client.event / commands.Cog.listener / etc...
async def on_guild_join(guild):
    logging.info(f"Joined guild {guild.name} ({guild.id})"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question