Skip to content

Commit

Permalink
Make sure tier is lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaserlang committed Feb 27, 2024
1 parent d91c5d2 commit ea63e26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tbot/twitch_bot/modlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async def log_sub(self, data):
user_id,
user,
data['sub_message'].get('message'),
data['sub_plan'],
data['sub_plan'].lower(),
gifter_id,
gifter_user,
data['is_gift'],
Expand All @@ -146,15 +146,15 @@ async def log_sub(self, data):
'1000': 'Tier 1 Sub',
'2000': 'Tier 2 Sub',
'3000': 'Tier 3 Sub',
'Prime': 'Prime Sub',
'prime': 'Prime Sub',
}

if not data['is_gift']:
if message:
message = f': {message}'
message = f'{user} subscribed with a {tiers.get(data["sub_plan"], "unknown")} ({data["cumulative_months"]}){message}'
message = f'{user} subscribed with a {tiers.get(data["sub_plan"].lower(), "unknown")} ({data["cumulative_months"]}){message}'
else:
message = f'{gifter_user} gifted a {tiers.get(data["sub_plan"], "unknown")} to {user}'
message = f'{gifter_user} gifted a {tiers.get(data["sub_plan"].lower(), "unknown")} to {user}'

await self.db.execute('''
INSERT INTO twitch_chatlog (type, created_at, channel_id, user, user_id, message) VALUES
Expand Down

0 comments on commit ea63e26

Please sign in to comment.