Skip to content

Commit

Permalink
fix: rfr doesn't assign roles
Browse files Browse the repository at this point in the history
  • Loading branch information
JayDwee committed Nov 11, 2023
1 parent 5964da0 commit 95e3240
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions alembic/versions/dd3c60f39768_mysql_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def unsafe_upgrade():
Column('default_message', VARCHAR(1000, collation="utf8mb4_unicode_520_ci")))
user_in_twitch_alert = op.create_table('UserInTwitchAlert',
Column('channel_id', DiscordSnowflake,
# ForeignKey("TwitchAlerts.channel_id", ondelete='CASCADE'),
ForeignKey("TwitchAlerts.channel_id", ondelete='CASCADE'),
primary_key=True),
Column('twitch_username', VARCHAR(25), primary_key=True),
Column('custom_message', VARCHAR(1000, collation="utf8mb4_unicode_520_ci"), nullable=True),
Expand All @@ -229,13 +229,13 @@ def unsafe_upgrade():
Column('team_twitch_alert_id', INT,
autoincrement=True, primary_key=True),
Column('channel_id', DiscordSnowflake,
# ForeignKey("TwitchAlerts.channel_id", ondelete='CASCADE')
ForeignKey("TwitchAlerts.channel_id", ondelete='CASCADE')
),
Column('twitch_team_name', VARCHAR(25)),
Column('custom_message', VARCHAR(1000, collation="utf8mb4_unicode_520_ci"), nullable=True))
user_in_twitch_team = op.create_table('UserInTwitchTeam',
Column('team_twitch_alert_id', INT,
# ForeignKey("TeamInTwitchAlert.team_twitch_alert_id", ondelete='CASCADE'),
ForeignKey("TeamInTwitchAlert.team_twitch_alert_id", ondelete='CASCADE'),
primary_key=True),
Column('twitch_username', VARCHAR(25), primary_key=True),
Column('message_id', DiscordSnowflake, nullable=True))
Expand Down
3 changes: 2 additions & 1 deletion koala/cogs/react_for_role/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from koala.utils import wait_for_message
# Own modules
from . import core
from .core import get_embed_from_message
from .db import get_rfr_message, get_rfr_message_emoji_roles, get_guild_rfr_required_roles, get_guild_rfr_roles, \
get_guild_rfr_messages
from .exception import ReactionException, ReactionErrorCode
Expand Down Expand Up @@ -730,7 +731,7 @@ async def get_role_member_info(self, emoji_reacted: discord.PartialEmoji, guild_
message: discord.Message = await channel.fetch_message(message_id)
if not message:
raise ReactionException(ReactionErrorCode.UNKNOWN_MESSAGE_REACTION, message_id, guild_id)
embed: discord.Embed = self.get_embed_from_message(message)
embed: discord.Embed = get_embed_from_message(message)

if emoji_reacted.is_unicode_emoji(): # Unicode Emoji
rep = emoji.emojize(emoji_reacted.name)
Expand Down

0 comments on commit 95e3240

Please sign in to comment.