mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
Edit reminder message & add "!pardon" alias for "!unban" (#25)
This commit is contained in:
parent
f2e337153f
commit
30a4a94f1b
2 changed files with 4 additions and 3 deletions
|
@ -170,10 +170,11 @@ public static class Boyfriend {
|
||||||
if (now < reminder.RemindAt) continue;
|
if (now < reminder.RemindAt) continue;
|
||||||
|
|
||||||
var channel = guild.GetTextChannel(reminder.ReminderChannel);
|
var channel = guild.GetTextChannel(reminder.ReminderChannel);
|
||||||
|
var toSend = $"{ReplyEmojis.Reminder} {user.Mention} {Utils.Wrap(reminder.ReminderText)}";
|
||||||
if (channel is not null)
|
if (channel is not null)
|
||||||
await channel.SendMessageAsync($"<@{mData.Id}> {Utils.Wrap(reminder.ReminderText)}");
|
await channel.SendMessageAsync(toSend);
|
||||||
else
|
else
|
||||||
await Utils.SendDirectMessage(user, reminder.ReminderText);
|
await Utils.SendDirectMessage(user, toSend);
|
||||||
|
|
||||||
mData.Reminders.RemoveAt(i);
|
mData.Reminders.RemoveAt(i);
|
||||||
saveData = true;
|
saveData = true;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
namespace Boyfriend.Commands;
|
namespace Boyfriend.Commands;
|
||||||
|
|
||||||
public sealed class UnbanCommand : ICommand {
|
public sealed class UnbanCommand : ICommand {
|
||||||
public string[] Aliases { get; } = { "unban", "разбан" };
|
public string[] Aliases { get; } = { "unban", "pardon", "разбан" };
|
||||||
|
|
||||||
public async Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) {
|
public async Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) {
|
||||||
if (!cmd.HasPermission(GuildPermission.BanMembers)) return;
|
if (!cmd.HasPermission(GuildPermission.BanMembers)) return;
|
||||||
|
|
Loading…
Reference in a new issue