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

Discord Direct Message Failure Clarification #282

Open
fwosh opened this issue Nov 17, 2023 · 1 comment
Open

Discord Direct Message Failure Clarification #282

fwosh opened this issue Nov 17, 2023 · 1 comment

Comments

@fwosh
Copy link

fwosh commented Nov 17, 2023

The bot attempts to send dm's sequentially on the Secret Santa user list. As soon as it hits a failed dm, it will not attempt to send messages to the remaining users, regardless of whether the other users have the appropriate settings. This is misleading since the admin sees a full list of affected users (presumed to all have the wrong settings) and the FAQ is not clear that other message attempts have not been made.

Ideally, the FAQ can be clearer to communicate the above. That is, the user with the thrown error must be fixed in order for the bot to continue trying to send the messages to remaining users.

https://secret-santa.team/faq#discord-server-dm

(Or of course, attempt to send to other users and only throw errors for those affected.)

@damienalexandre
Copy link
Member

Hi! Thanks for the detailed report, we are aware of this situation - sadly we have no way to tell if a member disabled bot messages before actually sending a message to him (as far as we know).

Maybe we can improve this part:

public function dispatchRemainingMessages(SecretSanta $secretSanta, ApplicationInterface $application): void
{
$startTime = time();
$failedUsers = $secretSanta->getErrors();
foreach ($secretSanta->getRemainingAssociations() as $giver => $receiver) {
if ((time() - $startTime) > 5) {
throw new MessageDispatchTimeoutException($secretSanta);
}
if ($failedUsers[$giver] ?? false) {
continue;
}
$application->sendSecretMessage($secretSanta, $giver, $receiver);
$secretSanta->markAssociationAsProceeded($giver);
}
}

To try other members before sending the MessageSendFailedException.

Would you be interested in contributing a Pull Request for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants