Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

Commit

Permalink
fix bug where >> as a prefix would not work
Browse files Browse the repository at this point in the history
  • Loading branch information
appu1232 committed Dec 9, 2017
1 parent d51321d commit 8c607f2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions appuselfbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,12 @@ async def on_message(message):
# If the message was sent by me
if message.author.id == bot.user.id:
if ">>" in message.content:
message.content, new_channel = message.content.rsplit(">>", 1)
if new_channel.strip().isdigit():
message.channel = bot.get_channel(int(new_channel.strip()))
elif new_channel.strip() == "" and bot.channel_last[0] != None:
message.channel = bot.get_channel(bot.channel_last[0])
if message.content.rsplit(">>", 1)[0] != "":
message.content, new_channel = message.content.rsplit(">>", 1)
if new_channel.strip().isdigit():
message.channel = bot.get_channel(int(new_channel.strip()))
elif new_channel.strip() == "" and bot.channel_last[0] != None:
message.channel = bot.get_channel(bot.channel_last[0])

if hasattr(bot, 'channel_last'):
if message.channel.id not in bot.channel_last:
Expand Down

0 comments on commit 8c607f2

Please sign in to comment.