Skip to content

Commit

Permalink
commands must now be at start of line.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ctri-The-Third committed Mar 15, 2021
1 parent c696bc7 commit 6c304af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@ async def on_message(self,message):
if message.author.id != selfID: #recursion check. do not react to your own messages


regexText = r'(!0071?8?2?7?4?6?0?2? |\/0071?8?2?7?4?6?0?2? ){1}([a-zA-Z0-9 ]*){1}(-[a-zA-z]*)?'
if re.search(r'[!?/](0071?8?2?7?4?6?0?2? )?valh[ei]{2}m', message.content):
regexText = r'^(!0071?8?2?7?4?6?0?2? |\/0071?8?2?7?4?6?0?2? ){1}([a-zA-Z0-9 ]*){1}(-[a-zA-z]*)?'
if re.search(r'^[!?\/](0071?8?2?7?4?6?0?2? )?valh[ei]{2}m', message.content):
await handlers.cmdValheim(message,self)
elif re.search(r'[!?/](0071?8?2?7?4?6?0?2? )?a?waken?', message.content):
elif re.search(r'^[!?\/](0071?8?2?7?4?6?0?2? )?a?waken?', message.content):
await handlers.cmdAwaken(message,self)
elif re.search(r'[!?/](0071?8?2?7?4?6?0?2? )?status', message.content):
elif re.search(r'^[!?\/](0071?8?2?7?4?6?0?2? )?status', message.content):
await handlers.cmdStatus(message,self)

elif re.search(regexText,message.content):
pieces = re.split(regexText,message.content)
await handlers.cmdGeneral(message,pieces,self)
elif message.guild is None:
regexText = r'([a-zA-Z0-9 ]*){1}(-[a-zA-z]*)?'
regexText = r'^([a-zA-Z0-9 ]*){1}(-[a-zA-z]*)?'
if re.search(regexText,message.content):
pieces = re.split(regexText,message.content)
pieces = ['','',pieces[1],pieces[2], '']
Expand Down

0 comments on commit 6c304af

Please sign in to comment.