From: Georgios Atheridis Date: Fri, 6 May 2022 13:43:58 +0000 (+0000) Subject: fixed bug for opgg command X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=2f44936a25ec2b5d1d485ca64a7959e4ce080254;p=ihaspeks%2Faptbot-ihaspeks.git fixed bug for opgg command --- diff --git a/skgyorugo/commands/opgg.py b/skgyorugo/commands/opgg.py index 89b3130..1dd2cf1 100644 --- a/skgyorugo/commands/opgg.py +++ b/skgyorugo/commands/opgg.py @@ -29,15 +29,12 @@ GLOBAL_COOLDOWN = 15 PATH = os.path.dirname(os.path.realpath(__file__)) PATH = os.path.join(PATH, "..") -def get_streamer_data(): - raise NotImplementedError() - -def get_twitch_user_data(twitch_id: int): - raise NotImplementedError() - def main(bot: Bot, message: Message): + index_skip = 0 + if message.tags.get("reply-parent-user-id", None): + index_skip += 1 try: - twitch_user = message.value.split(' ')[1] + twitch_user = message.value.split(' ')[1 + index_skip] except IndexError: twitch_user = message.tags.get("reply-parent-display-name", message.channel) twitch_id = message.tags.get("reply-parent-user-id", ttv_api.users.get_users(user_logins=[message.channel])) diff --git a/skgyorugo/commands/t.py b/skgyorugo/commands/t.py index 30f2c59..337f1fa 100644 --- a/skgyorugo/commands/t.py +++ b/skgyorugo/commands/t.py @@ -10,10 +10,7 @@ GLOBAL_COOLDOWN = 5 def main(bot: Bot, message: Message): - try: - replied_message = message.tags["reply-parent-msg-body"] - except KeyError: - replied_message = None + replied_message = message.tags.get("reply-parent-msg-body", None) if replied_message: msg = replied_message replied_msg_id = message.tags["reply-parent-msg-id"]