Add timer notif role.
This commit is contained in:
@@ -191,6 +191,8 @@ class TimerCog(LionCog):
|
||||
return
|
||||
if member.bot:
|
||||
return
|
||||
if 1148167212901859328 not in [role.id for role in member.roles]:
|
||||
return
|
||||
|
||||
# If a member is leaving or joining a running timer, trigger a status update
|
||||
if before.channel != after.channel:
|
||||
|
||||
@@ -186,7 +186,9 @@ class Timer:
|
||||
Uses voice channel member cache as source-of-truth.
|
||||
"""
|
||||
if (chan := self.channel):
|
||||
members = [member for member in chan.members if not member.bot]
|
||||
members = [
|
||||
member for member in chan.members if not member.bot and 1148167212901859328 in [role.id for role in member.roles]
|
||||
]
|
||||
else:
|
||||
members = []
|
||||
return members
|
||||
|
||||
@@ -64,8 +64,15 @@ class MsgEditor(MessageUI):
|
||||
|
||||
async def push_change(self, new_data):
|
||||
# Cleanup the data
|
||||
if (embed_data := new_data.get('embed', None)) is not None and not embed_data:
|
||||
new_data.pop('embed')
|
||||
if 'embed' in new_data:
|
||||
pop_embed = True
|
||||
embed_data = new_data['embed']
|
||||
for key, value in embed_data.items():
|
||||
if value:
|
||||
pop_embed = False
|
||||
break
|
||||
if pop_embed:
|
||||
new_data.pop('embed')
|
||||
|
||||
t = self.bot.translator.t
|
||||
if 'embed' not in new_data and not new_data.get('content', None):
|
||||
@@ -229,7 +236,7 @@ class MsgEditor(MessageUI):
|
||||
default=str(discord.Colour(value=embed_data['color'])) if 'color' in embed_data else '',
|
||||
placeholder=str(discord.Colour.orange()),
|
||||
max_length=7,
|
||||
min_length=7
|
||||
min_length=0
|
||||
)
|
||||
|
||||
modal = MsgEditorInput(
|
||||
|
||||
Reference in New Issue
Block a user