wip strings rework, experimenting, nothing works

This commit is contained in:
Kwoth
2021-07-25 19:25:48 +02:00
parent 70288f7670
commit 9d375dccee
53 changed files with 211 additions and 187 deletions

View File

@@ -107,7 +107,7 @@ namespace NadekoBot.Modules.Administration
public async Task PurgeUser(ulong userId)
{
var embed = _eb.Create()
.WithDescription(GetText("purge_user_confirm", Format.Bold(userId.ToString())));
.WithDescription(GetText(strs.purge_user_confirm, Format.Bold(userId.ToString())));
if (!await PromptUserConfirmAsync(embed).ConfigureAwait(false))
{

View File

@@ -133,7 +133,7 @@ namespace NadekoBot.Modules.Administration
return;
}
await SendConfirmAsync(GetText("prot_enable", "Anti-Raid"),
await SendConfirmAsync(GetText(strs.prot_enable, "Anti-Raid"),
$"{ctx.User.Mention} {GetAntiRaidString(stats)}")
.ConfigureAwait(false);
}
@@ -199,7 +199,7 @@ namespace NadekoBot.Modules.Administration
var stats = await _service.StartAntiSpamAsync(ctx.Guild.Id, messageCount, action, time, role?.Id).ConfigureAwait(false);
await SendConfirmAsync(GetText("prot_enable", "Anti-Spam"),
await SendConfirmAsync(GetText(strs.prot_enable, "Anti-Spam"),
$"{ctx.User.Mention} {GetAntiSpamString(stats)}").ConfigureAwait(false);
}
@@ -247,7 +247,7 @@ namespace NadekoBot.Modules.Administration
}
private string GetAntiAltString(AntiAltStats alt)
=> GetText("anti_alt_status",
=> GetText(strs.anti_alt_status,
Format.Bold(alt.MinAge.ToString(@"dd\d\ hh\h\ mm\m\ ")),
Format.Bold(alt.Action.ToString()),
Format.Bold(alt.Counter.ToString()));
@@ -266,7 +266,7 @@ namespace NadekoBot.Modules.Administration
add = $" ({TimeSpan.FromMinutes(settings.MuteTime):hh\\hmm\\m})";
}
return GetText("spam_stats",
return GetText(strs.spam_stats,
Format.Bold(settings.MessageThreshold.ToString()),
Format.Bold(settings.Action.ToString() + add),
ignoredString);
@@ -281,7 +281,7 @@ namespace NadekoBot.Modules.Administration
actionString += $" **({TimeSpan.FromMinutes(stats.AntiRaidSettings.PunishDuration):hh\\hmm\\m})**";
}
return GetText("raid_stats",
return GetText(strs.raid_stats,
Format.Bold(stats.AntiRaidSettings.UserThreshold.ToString()),
Format.Bold(stats.AntiRaidSettings.Seconds.ToString()),
actionString);

View File

@@ -150,7 +150,7 @@ namespace NadekoBot.Modules.Administration
}
var content = msg?.Content.TrimTo(30) ?? "DELETED!";
embed.AddField($"**{rr.Index + 1}.** {(ch?.Name ?? "DELETED!")}",
GetText("reaction_roles_message", rr.ReactionRoles?.Count ?? 0, content));
GetText(strs.reaction_roles_message, rr.ReactionRoles?.Count ?? 0, content));
}
}
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);

View File

@@ -128,7 +128,7 @@ namespace NadekoBot.Modules.Administration
var groupNameText = "";
if (!groups.TryGetValue(kvp.Key, out var name))
{
groupNameText = Format.Bold(GetText("self_assign_group", kvp.Key));
groupNameText = Format.Bold(GetText(strs.self_assign_group, kvp.Key));
}
else
{
@@ -155,7 +155,7 @@ namespace NadekoBot.Modules.Administration
}
return _eb.Create().WithOkColor()
.WithTitle(Format.Bold(GetText("self_assign_list", roles.Count())))
.WithTitle(Format.Bold(GetText(strs.self_assign_list, roles.Count())))
.WithDescription(rolesStr.ToString())
.WithFooter(exclusive
? GetText(strs.self_assign_are_exclusive)

View File

@@ -119,7 +119,7 @@ namespace NadekoBot.Modules.Administration
[{GetText(strs.channel)}]: {x.ChannelName} #{x.ChannelId}
[{GetText(strs.command_text)}]: {x.CommandText}```")),
title: string.Empty,
footer: GetText("page", page + 1))
footer: GetText(strs.page, page + 1))
.ConfigureAwait(false);
}
}
@@ -152,7 +152,7 @@ namespace NadekoBot.Modules.Administration
{GetIntervalText(x.Interval)}
[{GetText(strs.command_text)}]: {x.CommandText}```")),
title: string.Empty,
footer: GetText("page", page + 1))
footer: GetText(strs.page, page + 1))
.ConfigureAwait(false);
}
}

View File

@@ -61,7 +61,7 @@ namespace NadekoBot.Modules.Administration
try
{
await (await user.GetOrCreateDMChannelAsync().ConfigureAwait(false)).EmbedAsync(_eb.Create().WithErrorColor()
.WithDescription(GetText("warned_on", ctx.Guild.ToString()))
.WithDescription(GetText(strs.warned_on, ctx.Guild.ToString()))
.AddField(GetText(strs.moderator), ctx.User.ToString())
.AddField(GetText(strs.reason), reason ?? "-"))
.ConfigureAwait(false);
@@ -96,12 +96,12 @@ namespace NadekoBot.Modules.Administration
.WithOkColor();
if (punishment is null)
{
embed.WithDescription(GetText("user_warned",
embed.WithDescription(GetText(strs.user_warned,
Format.Bold(user.ToString())));
}
else
{
embed.WithDescription(GetText("user_warned_and_punished", Format.Bold(user.ToString()),
embed.WithDescription(GetText(strs.user_warned_and_punished, Format.Bold(user.ToString()),
Format.Bold(punishment.Punishment.ToString())));
}
@@ -221,7 +221,7 @@ namespace NadekoBot.Modules.Administration
var user = (ctx.Guild as SocketGuild)?.GetUser(userId)?.ToString() ?? userId.ToString();
var embed = _eb.Create()
.WithOkColor()
.WithTitle(GetText("warnlog_for", user));
.WithTitle(GetText(strs.warnlog_for, user));
if (!warnings.Any())
{
@@ -233,13 +233,13 @@ namespace NadekoBot.Modules.Administration
foreach (var w in warnings)
{
i++;
var name = GetText("warned_on_by",
var name = GetText(strs.warned_on_by,
w.DateAdded.Value.ToString("dd.MM.yyy"),
w.DateAdded.Value.ToString("HH:mm"),
w.Moderator);
if (w.Forgiven)
name = $"{Format.Strikethrough(name)} {GetText("warn_cleared_by", w.ForgivenBy)}";
name = $"{Format.Strikethrough(name)} {GetText(strs.warn_cleared_by, w.ForgivenBy)}";
embed.AddField($"#`{i}` " + name, w.Reason.TrimTo(1020));
}
@@ -436,7 +436,7 @@ namespace NadekoBot.Modules.Administration
{
try
{
var defaultMessage = GetText("bandm", Format.Bold(ctx.Guild.Name), msg);
var defaultMessage = GetText(strs.bandm, Format.Bold(ctx.Guild.Name), msg);
var embed = _service.GetBanUserDmEmbed(Context, guildUser, defaultMessage, msg, time.Time);
if (embed is not null)
{
@@ -503,7 +503,7 @@ namespace NadekoBot.Modules.Administration
try
{
var defaultMessage = GetText("bandm", Format.Bold(ctx.Guild.Name), msg);
var defaultMessage = GetText(strs.bandm, Format.Bold(ctx.Guild.Name), msg);
var embed = _service.GetBanUserDmEmbed(Context, user, defaultMessage, msg, null);
if (embed is not null)
{
@@ -584,7 +584,7 @@ namespace NadekoBot.Modules.Administration
private async Task InternalBanMessageTest(string reason, TimeSpan? duration)
{
var dmChannel = await ctx.User.GetOrCreateDMChannelAsync();
var defaultMessage = GetText("bandm", Format.Bold(ctx.Guild.Name), reason);
var defaultMessage = GetText(strs.bandm, Format.Bold(ctx.Guild.Name), reason);
var embed = _service.GetBanUserDmEmbed(Context,
(IGuildUser)ctx.User,
defaultMessage,
@@ -685,7 +685,7 @@ namespace NadekoBot.Modules.Administration
try
{
await user.SendErrorAsync(_eb, GetText("sbdm", Format.Bold(ctx.Guild.Name), msg)).ConfigureAwait(false);
await user.SendErrorAsync(_eb, GetText(strs.sbdm, Format.Bold(ctx.Guild.Name), msg)).ConfigureAwait(false);
}
catch
{
@@ -741,7 +741,7 @@ namespace NadekoBot.Modules.Administration
try
{
await user.SendErrorAsync(_eb, GetText("kickdm", Format.Bold(ctx.Guild.Name), msg))
await user.SendErrorAsync(_eb, GetText(strs.kickdm, Format.Bold(ctx.Guild.Name), msg))
.ConfigureAwait(false);
}
catch
@@ -783,8 +783,8 @@ namespace NadekoBot.Modules.Administration
//send a message but don't wait for it
var banningMessageTask = ctx.Channel.EmbedAsync(_eb.Create()
.WithDescription(GetText("mass_kill_in_progress", bans.Count()))
.AddField(GetText("invalid", missing), missStr)
.WithDescription(GetText(strs.mass_kill_in_progress, bans.Count()))
.AddField(GetText(strs.invalid, missing), missStr)
.WithOkColor());
//do the banning
@@ -800,8 +800,8 @@ namespace NadekoBot.Modules.Administration
var banningMessage = await banningMessageTask.ConfigureAwait(false);
await banningMessage.ModifyAsync(x => x.Embed = _eb.Create()
.WithDescription(GetText("mass_kill_completed", bans.Count()))
.AddField(GetText("invalid", missing), missStr)
.WithDescription(GetText(strs.mass_kill_completed, bans.Count()))
.AddField(GetText(strs.invalid, missing), missStr)
.WithOkColor()
.Build()).ConfigureAwait(false);
}