mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Start working on server backend, create main bot class
This commit is contained in:
parent
0439b634d9
commit
92a5e6454d
3 changed files with 117 additions and 21 deletions
25
cogs/ipc.py
Normal file
25
cogs/ipc.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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()
|
||||
async def get_bot_latency(self):
|
||||
"""
|
||||
Get Didier's latency
|
||||
"""
|
||||
return str(round(self.client.latency * 1000))
|
||||
|
||||
|
||||
def setup(client):
|
||||
client.add_cog(IPC(client))
|
||||
Loading…
Add table
Add a link
Reference in a new issue