Add timer notif role.

This commit is contained in:
2023-09-04 11:29:53 +03:00
parent 44e52053de
commit 2c7aaee8d4
3 changed files with 15 additions and 4 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -64,7 +64,14 @@ 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:
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
@@ -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(