I am looking for a way to remove my Discord bot from a Discord server that I don't have access to. Is it possible for the bot to leave a certain server by itself? Additionally, can you provide documentation or advice on how to get the server name and ID upon joining the server only with the bot?
Thanks.
Try guild.leave
:
server = client.get_guild(server_id)
await server.leave()
Docs: https://discordpy.readthedocs.io/en/stable/api.html#discord.Guild.leave
To get the guild id, just use discord.on_guild_join(guild)
:
async def on_guild_join(self, guild):
print(guild.id)
Docs: https://discordpy.readthedocs.io/en/stable/api.html#discord.on_guild_join