· 4 years ago · Aug 09, 2021, 06:34 PM
1class MyBot(commands.Bot):
2
3 def __init__(self, *args , **kwargs):
4 super().__init__(*args, **kwargs)
5
6 self.ipc = ipc.Server(self, host="0.0.0.0",port="9999", secret_key= "PASS", do_multicast=False) #52.3.231.173
7
8
9 async def on_ipc_ready(self):
10 """Called upon the IPC Server being ready"""
11 print("IPC SERVER IS READY!")
12
13 async def on_ready(self):
14 """ON BOT READY!"""
15 print("YO")
16
17client = MyBot(command_prefix = get_prefix, intents= discord.Intents.all())
18client.remove_command('help')
19
20
21
22
23
24@client.ipc.route()
25async def get_guild_count(data):
26 print(client.guilds)
27 return len(client.guilds)
28
29
30@client.ipc.route()
31async def get_guild_ids(data):
32 print("guilds_here")
33 final = []
34 for guild in client.guilds:
35 final.append(guild.id)
36 return final
37
38
39client.ipc.start()
40client.run(TOKEN)
41
42