Home:ALL Converter>Is there a way to check if discord bot joins a server?

Is there a way to check if discord bot joins a server?

Ask Time:2019-02-06T23:58:15         Author:Ad2017

Json Formatter

I'm making a discord bot and I want to check if it joins a server so I can set prefixes, send messages etc.
I tried searching for this but I didn't find anything that could help.

I thought it could be an event so tried something like:

client.on('join_guild', (guild) => {
    prefix = "!"
});

But, of course, it didn't work.

Is there something like the code shown above?

Author:Ad2017,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54557691/is-there-a-way-to-check-if-discord-bot-joins-a-server
yy