-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiscordOwnerNotifier.cs
More file actions
28 lines (25 loc) · 1.11 KB
/
Copy pathDiscordOwnerNotifier.cs
File metadata and controls
28 lines (25 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using RustPlusBot.Discord.Notifications;
namespace RustPlusBot.Features.Pairing.Notifications;
/// <summary>DMs the owner when their FCM credentials expire, via the shared <see cref="IUserDmSender"/>.</summary>
/// <param name="dmSender">Sends the DM (swallows a closed DM).</param>
internal sealed class DiscordOwnerNotifier(IUserDmSender dmSender) : IOwnerNotifier
{
/// <inheritdoc />
public Task NotifyCredentialsExpiredAsync(
ulong guildId,
ulong ownerUserId,
CancellationToken cancellationToken = default) =>
dmSender.SendAsync(
ownerUserId,
"Your Rust+ credentials were rejected. Reconnect your account in #setup to keep receiving pairings.",
cancellationToken);
/// <inheritdoc />
public Task NotifySetupChannelMissingAsync(
ulong guildId,
ulong ownerUserId,
CancellationToken cancellationToken = default) =>
dmSender.SendAsync(
ownerUserId,
"A server pairing arrived but this guild has no #setup channel. Run /setup, then press \"Pair\" in-game again.",
cancellationToken);
}