Forums

Discord Bot Leave Server

I installed my bot in my friend's discord server. Now he kicked me from server so i need to block my bot to his server or i need to make my bot to leave his server.

I got a python scrpt in google search do i need to change this so it suits for me.

import discord

client = discord.Client()

my_server = client.get_server('server id')

@client.event

async def on_ready():

    for server in client.servers:
        if server != my_server:
            await client.leave_server(server)

@client.event

async def on_server_join(server):

    if server != my_server:
        await client.leave_server(server)

Is it possible like example bot should leave server if I'm not in that server. If my bot is in 20 server and I'm member of only 10 server so it should leave other 10 server.

[edit by admin: formatting]

I don't know enough about Discord bots to really help here, but perhaps this is a better question for Stack Overflow?