From adb31a48e5c002cc7446a2e83dde4df1139469b5 Mon Sep 17 00:00:00 2001 From: raatty Date: Fri, 26 Jul 2019 22:43:54 +1200 Subject: [PATCH] droped travel as DiscordRPG now has its own notification --- bot.py | 4 +--- drpg.py | 21 +-------------------- utils.py | 13 ------------- 3 files changed, 2 insertions(+), 36 deletions(-) diff --git a/bot.py b/bot.py index d2875ad..1f9ae0e 100644 --- a/bot.py +++ b/bot.py @@ -58,9 +58,7 @@ async def help(ctx): " __14 seconds:__ {0}adv\n" " __300 seconds:__ {0}mine, {0}chop, {0}fish, {0}forage\n" " __600 seconds:__ {0}search\n" - " __various:__ {0}travel (you must of done {0}location " - "in the same channel within the last 30s, you will get " - "pinged when you arive)\n\n" + "\n" "My commands:\n" " **{0}help** shows this message\n" " **{0}links** shows a message with links to add me to " diff --git a/drpg.py b/drpg.py index a682b81..85a5026 100644 --- a/drpg.py +++ b/drpg.py @@ -1,7 +1,7 @@ import discord from discord.ext import commands import asyncio -from utils import read_adv, read_stats, read_travel, DEST_RE +from utils import read_adv, read_stats class drpg: @@ -69,25 +69,6 @@ class drpg: await self.bot.send_message(message.channel, out) except Exception: pass - elif message.embeds != []: - try: - user, destinations = read_travel(**message.embeds[0]) - print(user) - def travel_check(message): - return message.author.id == '170915625722576896' and \ - message.content.startswith(user) - travel = await self.bot.wait_for_message(timeout=30, - check=travel_check, - channel=message.channel) - user = message.server.get_member_named(user) - if travel is not None: - destination = DEST_RE.search(travel.content) \ - .groups(0)[0] - await asyncio.sleep(destinations[destination]) - m = f'{user.mention} you have arived at {destination}' - await self.bot.send_message(message.channel, m) - except Exception: - raise elif message.server.me in message.mentions and \ 'prefix' in message.content.lower(): m1 = '**The prefix for this server is currently set to:** {}' diff --git a/utils.py b/utils.py index eea7d9e..dc9232e 100644 --- a/utils.py +++ b/utils.py @@ -59,16 +59,3 @@ def read_stats(content): except Exception: pass -LOC_USR_RE = re.compile(r'(.+)\'s location') -CLEAN_DEST_RE = re.compile(r'([A-Za-z \']+) - (\d+)s') - -def read_travel(title, fields, **kwargs): - if title.endswith('location') and fields[0]["name"] == "Kingdom": - rawdestinations = fields[1]["value"].split('\n') - desetinations = {i[0]: int(i[1]) - for i in [CLEAN_DEST_RE.search(i).groups() - for i in rawdestinations]} - user = LOC_USR_RE.search(title).groups(0)[0] - return user, desetinations - -DEST_RE = re.compile(r'started their journey to ([A-Za-z \']+)!')