2021-06-14 23:33:53 +02:00
|
|
|
from discord.ext import commands, ipc
|
|
|
|
|
|
|
|
|
|
|
|
class IPC(commands.Cog):
|
|
|
|
def __init__(self, client):
|
|
|
|
self.client = client
|
|
|
|
|
|
|
|
@ipc.server.route()
|
|
|
|
async def send_dm(self, data):
|
|
|
|
print("got here")
|
|
|
|
user = self.client.get_user(data.user)
|
|
|
|
await user.send(data.message)
|
|
|
|
print("sent")
|
|
|
|
return True
|
|
|
|
|
|
|
|
@ipc.server.route()
|
2021-06-15 01:19:36 +02:00
|
|
|
async def get_bot_latency(self, data):
|
2021-06-14 23:33:53 +02:00
|
|
|
"""
|
|
|
|
Get Didier's latency
|
|
|
|
"""
|
2021-06-15 01:19:36 +02:00
|
|
|
|
|
|
|
return self.client.latency * 1000
|
2021-06-14 23:33:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
def setup(client):
|
|
|
|
client.add_cog(IPC(client))
|