Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid deleting reminders silently #3015

Open
wookie184 opened this issue Apr 14, 2024 · 0 comments
Open

Avoid deleting reminders silently #3015

wookie184 opened this issue Apr 14, 2024 · 0 comments
Labels
a: utility Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils) p: 2 - normal Normal Priority s: planning Discussing details t: bug Something isn't working

Comments

@wookie184
Copy link
Contributor

Currently a reminder will be ignored+deleted if the bot cannot get the channel it was meant to reply in:

def ensure_valid_reminder(self, reminder: dict) -> tuple[bool, discord.TextChannel]:
"""Ensure reminder channel can be fetched otherwise delete the reminder."""
channel = self.bot.get_channel(reminder["channel_id"])
is_valid = True
if not channel:
is_valid = False
log.info(
f"Reminder {reminder['id']} invalid: "
f"Channel {reminder['channel_id']}={channel}."
)
scheduling.create_task(self.bot.api_client.delete(f"bot/reminders/{reminder['id']}"))
return is_valid, channel

This could happen if the remind command was run in a thread, or a channel that was deleted.

There are a couple of options here:

  • Don't allow the command in threads, or always send the reminder to e.g. #bot-commands
  • Send the reminder to e.g. #bot-commands if it failed to send. Is it ok to send reminders that may have been run in a private channel to a public channel though?
  • Try to DM the reminder to the user(s) - DMs may not always be open though
  • Just tell them the reminder failed to send in #bot-commands - avoids ever leaking anything and is simple, but they don't get the contents.

This is an edge case so I think whatever the solution it should be as simple as possible, just something better than not reminding the user(s) at all.

@wookie184 wookie184 added t: bug Something isn't working s: planning Discussing details p: 2 - normal Normal Priority a: utility Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils) labels Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: utility Related to utility commands: (bot, eval, extensions, jams, reminders, snekbox, utils) p: 2 - normal Normal Priority s: planning Discussing details t: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant