Check if actor is empty before cleaning nicks
This commit is contained in:
parent
70a489ad71
commit
8f4a11e835
1
bot.py
1
bot.py
@ -123,6 +123,7 @@ def parse_messages(ircmsg):
|
|||||||
|
|
||||||
# Cleans a nickname of decorators/identifiers
|
# Cleans a nickname of decorators/identifiers
|
||||||
def clean_nick(actor):
|
def clean_nick(actor):
|
||||||
|
if actor: # In case an empty string gets passed
|
||||||
actor = actor.replace("_", "") # Strip out trailing _ characters
|
actor = actor.replace("_", "") # Strip out trailing _ characters
|
||||||
while(actor[-1]) in "1234567890": # Remove trailing numbers
|
while(actor[-1]) in "1234567890": # Remove trailing numbers
|
||||||
actor = actor[:-1]
|
actor = actor[:-1]
|
||||||
|
Loading…
Reference in New Issue
Block a user