diff --git a/bot.py b/bot.py index 2337d0e..2745afb 100755 --- a/bot.py +++ b/bot.py @@ -114,7 +114,7 @@ class DiscordBot(discord.Client): { 'function': 'handle_team_code', 'pattern': re.compile( - r'.*?(?Pen|fr|de|ru|it|es|cn)?(?P-)?\[(?P(\d+,?){1,13})\].*', + r'.*?(?Pen|fr|de|ru|it|es|cn)?(?P-)?\[(?P(\d+,?){1,12})\].*', re.IGNORECASE) }, { diff --git a/team_expando.py b/team_expando.py index e7151b2..657fb28 100644 --- a/team_expando.py +++ b/team_expando.py @@ -201,6 +201,7 @@ def get_team_from_code(self, code, lang): 'troops_title': _('[TROOPS]', lang), } has_weapon = False + has_class = False for element in code: troop = self.troops.get(element) @@ -221,6 +222,7 @@ def get_team_from_code(self, code, lang): if _class: result['class'] = _(_class['name'], lang) result['class_talents'] = _class['talents'] + has_class = True continue banner = self.banners.get(element) @@ -233,7 +235,7 @@ def get_team_from_code(self, code, lang): result['talents'].append(element) continue - if has_weapon: + if has_weapon and has_class: new_talents = [] for talent_no, talent_code in enumerate(result['talents']): talent = '-'