Add DMs to /remind list
This commit is contained in:
@ -25,10 +25,12 @@ def create_pages(ctx: CommandContext) -> list[Page]:
|
||||
jobs: List[Job] = scheduler.get_jobs()
|
||||
for job in jobs:
|
||||
channel_id = job.kwargs.get("channel_id")
|
||||
guild_id = job.kwargs.get("guild_id")
|
||||
|
||||
# Only add reminders from channels in the server we run "/reminder list" in
|
||||
# Check if channel is in the Discord server, if not, skip it.
|
||||
for channel in ctx.guild.channels:
|
||||
if int(channel.id) == channel_id:
|
||||
if int(channel.id) == channel_id or ctx.guild_id == guild_id:
|
||||
if type(job.trigger) is DateTrigger:
|
||||
# Get trigger time for normal reminders
|
||||
trigger_time = job.trigger.run_date
|
||||
@ -107,11 +109,6 @@ def create_pages(ctx: CommandContext) -> list[Page]:
|
||||
pause_or_unpause_button = pause_button
|
||||
components.insert(1, pause_or_unpause_button)
|
||||
|
||||
# Only allow 25 pages
|
||||
if len(pages) == 25:
|
||||
ctx.channel.send("I haven't added support for more than 25 reminders. Pull requests welcome 🙃")
|
||||
return pages
|
||||
|
||||
# Add a page to pages list
|
||||
title = f"{message[:87]}..." if len(message) > 90 else message
|
||||
pages.append(
|
||||
|
@ -348,7 +348,7 @@ async def command_add(
|
||||
run_date=run_date,
|
||||
kwargs={
|
||||
"user_id": int(send_dm_to_user.id),
|
||||
"guild_id": int(ctx.guild_id),
|
||||
"guild_id": ctx.guild_id,
|
||||
"message": message_reason,
|
||||
},
|
||||
)
|
||||
@ -570,7 +570,7 @@ async def remind_cron(
|
||||
jitter=jitter,
|
||||
kwargs={
|
||||
"user_id": int(send_dm_to_user.id),
|
||||
"guild_id": int(ctx.guild_id),
|
||||
"guild_id": ctx.guild_id,
|
||||
"message": message_reason,
|
||||
},
|
||||
)
|
||||
@ -762,7 +762,7 @@ async def remind_interval(
|
||||
jitter=jitter,
|
||||
kwargs={
|
||||
"user_id": int(send_dm_to_user.id),
|
||||
"guild_id": int(ctx.guild_id),
|
||||
"guild_id": ctx.guild_id,
|
||||
"message": message_reason,
|
||||
},
|
||||
)
|
||||
|
Reference in New Issue
Block a user