1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-11 00:13:15 +03:00

Reply emojis are now taken from a single file

This commit is contained in:
mctaylors 2022-12-06 18:20:41 +03:00
parent cec041f096
commit 15c42a6ef5
9 changed files with 42 additions and 42 deletions

View file

@ -29,7 +29,7 @@ public sealed class BanCommand : ICommand {
var feedback = string.Format(Messages.FeedbackUserBanned, toBan.Mention,
Utils.GetHumanizedTimeOffset(duration), Utils.Wrap(reason));
cmd.Reply(feedback, Prefixes.Banned);
cmd.Reply(feedback, ReplyEmojis.Banned);
cmd.Audit(feedback);
if (duration.TotalSeconds > 0)

View file

@ -12,7 +12,7 @@ public sealed class HelpCommand : ICommand {
foreach (var command in CommandProcessor.Commands)
toSend.Append(
$"\n`{prefix}{command.Aliases[0]}`: {Utils.GetMessage($"CommandDescription{command.Aliases[0].Titleize()}")}");
cmd.Reply(toSend.ToString(), Prefixes.Help);
cmd.Reply(toSend.ToString(), ReplyEmojis.Help);
toSend.Clear();
return Task.CompletedTask;

View file

@ -24,7 +24,7 @@ public sealed class KickCommand : ICommand {
await toKick.KickAsync(guildKickMessage);
var format = string.Format(Messages.FeedbackMemberKicked, toKick.Mention, Utils.Wrap(reason));
cmd.Reply(format, Prefixes.Kicked);
cmd.Reply(format, ReplyEmojis.Kicked);
cmd.Audit(format);
}
}

View file

@ -20,7 +20,7 @@ public sealed class MuteCommand : ICommand {
|| (toMute.TimedOutUntil is not null
&& toMute.TimedOutUntil.Value.ToUnixTimeSeconds()
> DateTimeOffset.Now.ToUnixTimeSeconds())) {
cmd.Reply(Messages.MemberAlreadyMuted, Prefixes.Error);
cmd.Reply(Messages.MemberAlreadyMuted, ReplyEmojis.Error);
return;
}
@ -30,7 +30,7 @@ public sealed class MuteCommand : ICommand {
foreach (var roleId in mutedRemovedRoles) await toMute.AddRoleAsync(roleId);
rolesRemoved.Remove(toMute.Id);
cmd.ConfigWriteScheduled = true;
cmd.Reply(Messages.RolesReturned, Prefixes.Warning);
cmd.Reply(Messages.RolesReturned, ReplyEmojis.Warning);
}
if (cmd.HasPermission(GuildPermission.ModerateMembers) && cmd.CanInteractWith(toMute, "Mute"))
@ -55,7 +55,7 @@ public sealed class MuteCommand : ICommand {
rolesRemoved.Add(userRole.Id);
} catch (HttpException e) {
cmd.Reply(string.Format(Messages.RoleRemovalFailed, $"<@&{userRole}>", Utils.Wrap(e.Reason)),
Prefixes.Warning);
ReplyEmojis.Warning);
}
Boyfriend.GetRemovedRoles(guild.Id).Add(toMute.Id, rolesRemoved.AsReadOnly());
@ -68,12 +68,12 @@ public sealed class MuteCommand : ICommand {
await Task.FromResult(Utils.DelayedUnmuteAsync(cmd, toMute, Messages.PunishmentExpired, duration));
} else {
if (!hasDuration || duration.TotalDays > 28) {
cmd.Reply(Messages.DurationRequiredForTimeOuts, Prefixes.Error);
cmd.Reply(Messages.DurationRequiredForTimeOuts, ReplyEmojis.Error);
return;
}
if (toMute.IsBot) {
cmd.Reply(Messages.CannotTimeOutBot, Prefixes.Error);
cmd.Reply(Messages.CannotTimeOutBot, ReplyEmojis.Error);
return;
}
@ -83,7 +83,7 @@ public sealed class MuteCommand : ICommand {
var feedback = string.Format(Messages.FeedbackMemberMuted, toMute.Mention,
Utils.GetHumanizedTimeOffset(duration),
Utils.Wrap(reason));
cmd.Reply(feedback, Prefixes.Muted);
cmd.Reply(feedback, ReplyEmojis.Muted);
cmd.Audit(feedback);
}
}

View file

@ -10,7 +10,7 @@ public sealed class PingCommand : ICommand {
.Append(Math.Abs(DateTimeOffset.Now.Subtract(cmd.Context.Message.Timestamp).TotalMilliseconds))
.Append(Messages.Milliseconds);
cmd.Reply(builder.ToString(), Prefixes.Ping);
cmd.Reply(builder.ToString(), ReplyEmojis.Ping);
builder.Clear();
return Task.CompletedTask;

View file

@ -33,7 +33,7 @@ public sealed class SettingsCommand : ICommand {
.AppendFormat(format, currentValue).AppendLine();
}
cmd.Reply(currentSettings.ToString(), Prefixes.Settings);
cmd.Reply(currentSettings.ToString(), ReplyEmojis.Settings);
currentSettings.Clear();
return Task.CompletedTask;
}
@ -51,7 +51,7 @@ public sealed class SettingsCommand : ICommand {
}
if (!exists) {
cmd.Reply(Messages.SettingDoesntExist, Prefixes.Error);
cmd.Reply(Messages.SettingDoesntExist, ReplyEmojis.Error);
return Task.CompletedTask;
}
@ -64,7 +64,7 @@ public sealed class SettingsCommand : ICommand {
value = value.Replace(" ", "").ToLower();
if (value.StartsWith(",") || value.Count(x => x is ',') > 1 ||
(!value.Contains("interested") && !value.Contains("users") && !value.Contains("role"))) {
cmd.Reply(Messages.InvalidSettingValue, Prefixes.Error);
cmd.Reply(Messages.InvalidSettingValue, ReplyEmojis.Error);
return Task.CompletedTask;
}
}
@ -77,7 +77,7 @@ public sealed class SettingsCommand : ICommand {
_ => value
};
if (!IsBool(value)) {
cmd.Reply(Messages.InvalidSettingValue, Prefixes.Error);
cmd.Reply(Messages.InvalidSettingValue, ReplyEmojis.Error);
return Task.CompletedTask;
}
}
@ -106,22 +106,22 @@ public sealed class SettingsCommand : ICommand {
} else {
if (value == config[selectedSetting]) {
cmd.Reply(string.Format(Messages.SettingsNothingChanged, localizedSelectedSetting, formattedValue),
Prefixes.Error);
ReplyEmojis.Error);
return Task.CompletedTask;
}
if (selectedSetting is "Lang" && !Utils.CultureInfoCache.ContainsKey(value)) {
cmd.Reply(Messages.LanguageNotSupported, Prefixes.Error);
cmd.Reply(Messages.LanguageNotSupported, ReplyEmojis.Error);
return Task.CompletedTask;
}
if (selectedSetting.EndsWith("Channel") && guild.GetTextChannel(mention) is null) {
cmd.Reply(Messages.InvalidChannel, Prefixes.Error);
cmd.Reply(Messages.InvalidChannel, ReplyEmojis.Error);
return Task.CompletedTask;
}
if (selectedSetting.EndsWith("Role") && guild.GetRole(mention) is null) {
cmd.Reply(Messages.InvalidRole, Prefixes.Error);
cmd.Reply(Messages.InvalidRole, ReplyEmojis.Error);
return Task.CompletedTask;
}
@ -138,7 +138,7 @@ public sealed class SettingsCommand : ICommand {
cmd.ConfigWriteScheduled = true;
var replyFormat = string.Format(Messages.FeedbackSettingsUpdated, localizedSelectedSetting, formattedValue);
cmd.Reply(replyFormat, Prefixes.SettingsSet);
cmd.Reply(replyFormat, ReplyEmojis.SettingsSet);
cmd.Audit(replyFormat, false);
return Task.CompletedTask;
}

View file

@ -34,7 +34,7 @@ public sealed class UnmuteCommand : ICommand {
} else {
if (toUnmute.TimedOutUntil is null || toUnmute.TimedOutUntil.Value.ToUnixTimeSeconds() <
DateTimeOffset.Now.ToUnixTimeSeconds()) {
cmd.Reply(Messages.MemberNotMuted, Prefixes.Error);
cmd.Reply(Messages.MemberNotMuted, ReplyEmojis.Error);
return;
}
@ -42,7 +42,7 @@ public sealed class UnmuteCommand : ICommand {
}
var feedback = string.Format(Messages.FeedbackMemberUnmuted, toUnmute.Mention, Utils.Wrap(reason));
cmd.Reply(feedback, Prefixes.Unmuted);
cmd.Reply(feedback, ReplyEmojis.Unmuted);
cmd.Audit(feedback);
}
}