summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/main.py b/main.py
index 5605106..22ddda1 100644
--- a/main.py
+++ b/main.py
@@ -12,6 +12,8 @@ import datetime
TOKEN = "MjM5NzI3NzQ2Nzk0NzgyNzIw.Cu5BbA.z7bkO3Ncd_L80htVzREHYDsEGNk"
VERSION = "v0.1.0"
+MODMIRROR = None
+
client = pymongo.MongoClient()
db = client.vainbot
@@ -38,7 +40,6 @@ async def get_user(id):
})
return await get_user(id)
-
async def search_teammates(server, channel, who, query, notify=True):
cal = parsedatetime.Calendar()
now = cal.parseDT("now")[0]
@@ -102,7 +103,23 @@ async def search_teammates(server, channel, who, query, notify=True):
await cli.send_message(channel, "%s You have been removed from the queue and were taken the play role." % (who.mention))
@cli.event
+async def on_message_delete(message):
+ mirror = cli.get_channel(MODMIRROR)
+ if message.author != cli.user and mirror:
+ await cli.send_message(mirror, message.author.mention + message.channel.mention + ": DELETE: " + message.content)
+
+@cli.event
+async def on_message_edit(before, message):
+ mirror = cli.get_channel(MODMIRROR)
+ if message.author != cli.user and mirror:
+ await cli.send_message(mirror, message.author.mention + message.channel.mention + ": EDIT: ~~" + before.content + "~~ -> " + message.content)
+
+@cli.event
async def on_message(message):
+ mirror = cli.get_channel(MODMIRROR)
+ if message.author != cli.user and mirror:
+ await cli.send_message(mirror, message.author.mention + message.channel.mention + ": " + message.content)
+
msg = message.content.lower()
if msg.startswith("?ping"):
await cli.send_message(message.channel, "Pong!")