mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
- Fixed counting parameters which have formats in response strings
- Almost finished porting localized string keys as methods - Compiles
This commit is contained in:
@@ -25,7 +25,7 @@ namespace NadekoBot.Generators
|
||||
public readonly struct LocStr
|
||||
{
|
||||
public readonly string Key;
|
||||
public readonly object[] Parms;
|
||||
public readonly object[] Params;
|
||||
|
||||
public LocStr(string key, params object[] data)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace NadekoBot.Generators
|
||||
|
||||
foreach (var field in fields)
|
||||
{
|
||||
var matches = Regex.Matches(field.Value, @"{(?<num>\d)}");
|
||||
var matches = Regex.Matches(field.Value, @"{(?<num>\d)[}:]");
|
||||
var max = 0;
|
||||
foreach (Match match in matches)
|
||||
{
|
||||
|
@@ -266,10 +266,10 @@ namespace NadekoBot.Modules.Administration
|
||||
add = $" ({TimeSpan.FromMinutes(settings.MuteTime):hh\\hmm\\m})";
|
||||
}
|
||||
|
||||
return GetText(strs.spam_stats,
|
||||
return GetText(strs.spam_stats(
|
||||
Format.Bold(settings.MessageThreshold.ToString()),
|
||||
Format.Bold(settings.Action.ToString() + add),
|
||||
ignoredString);
|
||||
Format.Bold(settings.Action + add),
|
||||
ignoredString));
|
||||
}
|
||||
|
||||
private string GetAntiRaidString(AntiRaidStats stats)
|
||||
@@ -280,11 +280,11 @@ namespace NadekoBot.Modules.Administration
|
||||
{
|
||||
actionString += $" **({TimeSpan.FromMinutes(stats.AntiRaidSettings.PunishDuration):hh\\hmm\\m})**";
|
||||
}
|
||||
|
||||
return GetText(strs.raid_stats,
|
||||
|
||||
return GetText(strs.raid_stats(
|
||||
Format.Bold(stats.AntiRaidSettings.UserThreshold.ToString()),
|
||||
Format.Bold(stats.AntiRaidSettings.Seconds.ToString()),
|
||||
actionString);
|
||||
actionString));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -96,13 +96,12 @@ namespace NadekoBot.Modules.Administration
|
||||
.WithOkColor();
|
||||
if (punishment is null)
|
||||
{
|
||||
embed.WithDescription(GetText(strs.user_warned,
|
||||
Format.Bold(user.ToString())));
|
||||
embed.WithDescription(GetText(strs.user_warned(Format.Bold(user.ToString()))));
|
||||
}
|
||||
else
|
||||
{
|
||||
embed.WithDescription(GetText(strs.user_warned_and_punished(Format.Bold(user.ToString())),
|
||||
Format.Bold(punishment.Punishment.ToString())));
|
||||
embed.WithDescription(GetText(strs.user_warned_and_punished(Format.Bold(user.ToString()),
|
||||
Format.Bold(punishment.Punishment.ToString()))));
|
||||
}
|
||||
|
||||
if (dmFailed)
|
||||
@@ -233,10 +232,10 @@ namespace NadekoBot.Modules.Administration
|
||||
foreach (var w in warnings)
|
||||
{
|
||||
i++;
|
||||
var name = GetText(strs.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);
|
||||
w.Moderator));
|
||||
|
||||
if (w.Forgiven)
|
||||
name = $"{Format.Strikethrough(name)} {GetText(strs.warn_cleared_by(w.ForgivenBy))}";
|
||||
@@ -685,7 +684,7 @@ namespace NadekoBot.Modules.Administration
|
||||
|
||||
try
|
||||
{
|
||||
await user.SendErrorAsync(_eb, GetText(strs.sbdm(Format.Bold(ctx.Guild.Name), msg)).ConfigureAwait(false));
|
||||
await user.SendErrorAsync(_eb, GetText(strs.sbdm(Format.Bold(ctx.Guild.Name), msg)));
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -784,7 +783,7 @@ namespace NadekoBot.Modules.Administration
|
||||
//send a message but don't wait for it
|
||||
var banningMessageTask = ctx.Channel.EmbedAsync(_eb.Create()
|
||||
.WithDescription(GetText(strs.mass_kill_in_progress(bans.Count())))
|
||||
.AddField(GetText(strs.invalid(missing), missStr))
|
||||
.AddField(GetText(strs.invalid(missing)), missStr)
|
||||
.WithOkColor());
|
||||
|
||||
//do the banning
|
||||
@@ -801,7 +800,7 @@ namespace NadekoBot.Modules.Administration
|
||||
|
||||
await banningMessage.ModifyAsync(x => x.Embed = _eb.Create()
|
||||
.WithDescription(GetText(strs.mass_kill_completed(bans.Count())))
|
||||
.AddField(GetText(strs.invalid(missing), missStr))
|
||||
.AddField(GetText(strs.invalid(missing)), missStr)
|
||||
.WithOkColor()
|
||||
.Build()).ConfigureAwait(false);
|
||||
}
|
||||
|
@@ -411,9 +411,10 @@ namespace NadekoBot.Modules.CustomReactions.Services
|
||||
{
|
||||
if (pc.Verbose)
|
||||
{
|
||||
var returnMsg = _strings.GetText(strs.perm_prevent, sg.Id,
|
||||
index + 1,
|
||||
Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), sg)));
|
||||
var returnMsg = _strings.GetText(
|
||||
strs.perm_prevent(index + 1,
|
||||
Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), sg))),
|
||||
sg.Id);
|
||||
|
||||
try
|
||||
{
|
||||
|
@@ -77,8 +77,10 @@ namespace NadekoBot.Modules.Gambling
|
||||
if (race.FinishedUsers[0].Bet > 0)
|
||||
{
|
||||
return SendConfirmAsync(GetText(strs.animal_race),
|
||||
GetText(strs.animal_race_won_money(Format.Bold(winner.Username)),
|
||||
winner.Animal.Icon, (race.FinishedUsers[0].Bet * (race.Users.Count - 1)) + CurrencySign));
|
||||
GetText(strs.animal_race_won_money(
|
||||
Format.Bold(winner.Username),
|
||||
winner.Animal.Icon,
|
||||
(race.FinishedUsers[0].Bet * (race.Users.Count - 1)) + CurrencySign)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -153,9 +155,9 @@ namespace NadekoBot.Modules.Gambling
|
||||
var user = await ar.JoinRace(ctx.User.Id, ctx.User.ToString(), amount)
|
||||
.ConfigureAwait(false);
|
||||
if (amount > 0)
|
||||
await SendConfirmAsync(GetText(strs.animal_race_join_bet(ctx.User.Mention, user.Animal.Icon, amount + CurrencySign)).ConfigureAwait(false));
|
||||
await SendConfirmAsync(GetText(strs.animal_race_join_bet(ctx.User.Mention, user.Animal.Icon, amount + CurrencySign)));
|
||||
else
|
||||
await SendConfirmAsync(GetText(strs.animal_race_join(ctx.User.Mention, user.Animal.Icon)).ConfigureAwait(false));
|
||||
await SendConfirmAsync(GetText(strs.animal_race_join(ctx.User.Mention, user.Animal.Icon)));
|
||||
}
|
||||
catch (ArgumentOutOfRangeException)
|
||||
{
|
||||
@@ -176,7 +178,7 @@ namespace NadekoBot.Modules.Gambling
|
||||
}
|
||||
catch (NotEnoughFundsException)
|
||||
{
|
||||
await SendErrorAsync(GetText(strs.not_enough(CurrencySign)).ConfigureAwait(false));
|
||||
await SendErrorAsync(GetText(strs.not_enough(CurrencySign)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -72,10 +72,10 @@ namespace NadekoBot.Modules.Gambling
|
||||
string potSizeStr = Format.Bold(potSize == 0
|
||||
? "∞" + CurrencySign
|
||||
: potSize.ToString() + CurrencySign);
|
||||
return GetText(strs.new_reaction_event,
|
||||
CurrencySign,
|
||||
Format.Bold(amount + CurrencySign),
|
||||
potSizeStr);
|
||||
return GetText(strs.new_reaction_event(
|
||||
CurrencySign,
|
||||
Format.Bold(amount + CurrencySign),
|
||||
potSizeStr));
|
||||
}
|
||||
|
||||
private string GetGameStatusDescription(long amount, long potSize)
|
||||
@@ -83,10 +83,10 @@ namespace NadekoBot.Modules.Gambling
|
||||
string potSizeStr = Format.Bold(potSize == 0
|
||||
? "∞" + CurrencySign
|
||||
: potSize.ToString() + CurrencySign);
|
||||
return GetText(strs.new_gamestatus_event,
|
||||
CurrencySign,
|
||||
Format.Bold(amount + CurrencySign),
|
||||
potSizeStr);
|
||||
return GetText(strs.new_gamestatus_event(
|
||||
CurrencySign,
|
||||
Format.Bold(amount + CurrencySign),
|
||||
potSizeStr));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ namespace NadekoBot.Modules.Gambling
|
||||
return;
|
||||
async Task OnEnded(IUser arg, long won)
|
||||
{
|
||||
await SendConfirmAsync(GetText(strs.rafflecur_ended(CurrencyName, Format.Bold(arg.ToString()), won + CurrencySign)).ConfigureAwait(false));
|
||||
await SendConfirmAsync(GetText(strs.rafflecur_ended(CurrencyName, Format.Bold(arg.ToString()), won + CurrencySign)));
|
||||
}
|
||||
var res = await _service.JoinOrCreateGame(ctx.Channel.Id,
|
||||
ctx.User, amount, mixed, OnEnded)
|
||||
@@ -45,7 +45,7 @@ namespace NadekoBot.Modules.Gambling
|
||||
{
|
||||
await SendConfirmAsync(GetText(strs.rafflecur(res.Item1.GameType.ToString())),
|
||||
string.Join("\n", res.Item1.Users.Select(x => $"{x.DiscordUser} ({x.Amount})")),
|
||||
footer: GetText(strs.rafflecur_joined(ctx.User.ToString())).ConfigureAwait(false));
|
||||
footer: GetText(strs.rafflecur_joined(ctx.User.ToString())));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -47,7 +47,7 @@ namespace NadekoBot.Modules.Gambling
|
||||
{
|
||||
await ctx.Channel.SendFileAsync(ms,
|
||||
$"dice.{format.FileExtensions.First()}",
|
||||
Format.Bold(ctx.User.ToString()) + " " + GetText(strs.dice_rolled(Format.Code(gen.ToString()))).ConfigureAwait(false));
|
||||
Format.Bold(ctx.User.ToString()) + " " + GetText(strs.dice_rolled(Format.Code(gen.ToString()))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,9 +129,9 @@ namespace NadekoBot.Modules.Gambling
|
||||
await ctx.Channel.SendFileAsync(ms, $"dice.{format.FileExtensions.First()}",
|
||||
Format.Bold(ctx.User.ToString()) + " " +
|
||||
GetText(strs.dice_rolled_num(Format.Bold(values.Count.ToString()))) +
|
||||
" " + GetText(strs.total_average,
|
||||
" " + GetText(strs.total_average(
|
||||
Format.Bold(values.Sum().ToString()),
|
||||
Format.Bold((values.Sum() / (1.0f * values.Count)).ToString("N2")))).ConfigureAwait(false);
|
||||
Format.Bold((values.Sum() / (1.0f * values.Count)).ToString("N2")))));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -68,9 +68,9 @@ namespace NadekoBot.Modules.Gambling
|
||||
}
|
||||
var msg = count != 1
|
||||
? Format.Bold(ctx.User.ToString()) + " " + GetText(strs.flip_results(count, headCount, tailCount))
|
||||
: Format.Bold(ctx.User.ToString()) + " " + GetText(strs.flipped, headCount > 0
|
||||
: Format.Bold(ctx.User.ToString()) + " " + GetText(strs.flipped(headCount > 0
|
||||
? Format.Bold(GetText(strs.heads))
|
||||
: Format.Bold(GetText(strs.tails)));
|
||||
: Format.Bold(GetText(strs.tails))));
|
||||
await ctx.Channel.SendFileAsync(stream, $"{count} coins.{format.FileExtensions.First()}", msg).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
@@ -196,8 +196,8 @@ namespace NadekoBot.Modules.Gambling
|
||||
}
|
||||
|
||||
var embed = _eb.Create()
|
||||
.WithTitle(GetText(strs.transactions,
|
||||
((SocketGuild)ctx.Guild)?.GetUser(userId)?.ToString() ?? $"{userId}"))
|
||||
.WithTitle(GetText(strs.transactions(
|
||||
((SocketGuild)ctx.Guild)?.GetUser(userId)?.ToString() ?? $"{userId}")))
|
||||
.WithOkColor();
|
||||
|
||||
var desc = "";
|
||||
@@ -480,9 +480,9 @@ namespace NadekoBot.Modules.Gambling
|
||||
if (result.Multiplier > 0)
|
||||
{
|
||||
var win = (long)(amount * result.Multiplier);
|
||||
str += GetText(strs.br_win,
|
||||
str += GetText(strs.br_win(
|
||||
n(win) + CurrencySign,
|
||||
result.Threshold + (result.Roll == 100 ? " 👑" : ""));
|
||||
result.Threshold + (result.Roll == 100 ? " 👑" : "")));
|
||||
await _cs.AddAsync(ctx.User, "Betroll Gamble",
|
||||
win, false, gamble: true).ConfigureAwait(false);
|
||||
}
|
||||
@@ -652,15 +652,13 @@ namespace NadekoBot.Modules.Gambling
|
||||
"Rps-win", amount, gamble: true).ConfigureAwait(false);
|
||||
embed.WithOkColor();
|
||||
embed.AddField(GetText(strs.won), n(amount));
|
||||
msg = GetText(strs.rps_win, ctx.User.Mention,
|
||||
getRpsPick(pick), getRpsPick(nadekoPick));
|
||||
msg = GetText(strs.rps_win(ctx.User.Mention, getRpsPick(pick), getRpsPick(nadekoPick)));
|
||||
}
|
||||
else
|
||||
{
|
||||
embed.WithErrorColor();
|
||||
amount = 0;
|
||||
msg = GetText(strs.rps_win(ctx.Client.CurrentUser.Mention, getRpsPick(nadekoPick)),
|
||||
getRpsPick(pick));
|
||||
msg = GetText(strs.rps_win(ctx.Client.CurrentUser.Mention, getRpsPick(nadekoPick), getRpsPick(pick)));
|
||||
}
|
||||
|
||||
embed
|
||||
|
@@ -433,7 +433,7 @@ namespace NadekoBot.Modules.Gambling
|
||||
var embed = _eb.Create().WithOkColor();
|
||||
|
||||
if (entry.Type == ShopEntryType.Role)
|
||||
return embed.AddField(GetText(strs.name), GetText(strs.shop_role(Format.Bold(ctx.Guild.GetRole(entry.RoleId)?.Name ?? "MISSING_ROLE")), true))
|
||||
return embed.AddField(GetText(strs.name), GetText(strs.shop_role(Format.Bold(ctx.Guild.GetRole(entry.RoleId)?.Name ?? "MISSING_ROLE"))), true)
|
||||
.AddField(GetText(strs.price), entry.Price.ToString(), true)
|
||||
.AddField(GetText(strs.type), entry.Type.ToString(), true);
|
||||
else if (entry.Type == ShopEntryType.List)
|
||||
|
@@ -68,9 +68,9 @@ namespace NadekoBot.Modules.Gambling
|
||||
await ReplyErrorLocalizedAsync("not_enough", CurrencySign);
|
||||
return;
|
||||
}
|
||||
var msg = GetText(strs.waifu_claimed,
|
||||
var msg = GetText(strs.waifu_claimed(
|
||||
Format.Bold(target.ToString()),
|
||||
amount + CurrencySign);
|
||||
amount + CurrencySign));
|
||||
if (w.Affinity?.UserId == ctx.User.Id)
|
||||
msg += "\n" + GetText(strs.waifu_fulfilled(target, w.Price + CurrencySign));
|
||||
else
|
||||
@@ -292,7 +292,7 @@ namespace NadekoBot.Modules.Gambling
|
||||
.AddField(GetText(strs.changes_of_heart), $"{wi.AffinityCount} - \"the {affInfo}\"", true)
|
||||
.AddField(GetText(strs.divorces), wi.DivorceCount.ToString(), true)
|
||||
.AddField("\u200B", "\u200B", true)
|
||||
.AddField(GetText(strs.fans(wi.Fans.Count), fansStr, true))
|
||||
.AddField(GetText(strs.fans(wi.Fans.Count)), fansStr, true)
|
||||
.AddField($"Waifus ({wi.ClaimCount})", wi.ClaimCount == 0
|
||||
? nobody
|
||||
: string.Join("\n", wi.Claims.Shuffle().Take(30)), true)
|
||||
|
@@ -105,9 +105,7 @@ namespace NadekoBot.Modules.Games
|
||||
if (submissions.Length == 1)
|
||||
{
|
||||
await ctx.Channel.EmbedAsync(_eb.Create().WithOkColor()
|
||||
.WithDescription(
|
||||
GetText(strs.acro_winner_only,
|
||||
Format.Bold(submissions.First().Key.UserName)))
|
||||
.WithDescription(GetText(strs.acro_winner_only(Format.Bold(submissions.First().Key.UserName))))
|
||||
.WithFooter(submissions.First().Key.Input))
|
||||
.ConfigureAwait(false);
|
||||
return;
|
||||
@@ -138,8 +136,8 @@ $@"--
|
||||
var winner = table.First();
|
||||
var embed = _eb.Create().WithOkColor()
|
||||
.WithTitle(GetText(strs.acrophobia))
|
||||
.WithDescription(GetText(strs.acro_winner(Format.Bold(winner.Key.UserName)),
|
||||
Format.Bold(winner.Value.ToString())))
|
||||
.WithDescription(GetText(strs.acro_winner(Format.Bold(winner.Key.UserName),
|
||||
Format.Bold(winner.Value.ToString()))))
|
||||
.WithFooter(winner.Key.Input);
|
||||
|
||||
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||
|
@@ -277,7 +277,7 @@ namespace NadekoBot.Modules.Games.Common.Trivia
|
||||
|
||||
foreach (var kvp in Users.OrderByDescending(kvp => kvp.Value))
|
||||
{
|
||||
sb.AppendLine(GetText(strs.trivia_points(Format.Bold(kvp.Key.ToString()), kvp.Value).SnPl(kvp.Value)));
|
||||
sb.AppendLine(GetText(strs.trivia_points(Format.Bold(kvp.Key.ToString()), kvp.Value)).SnPl(kvp.Value));
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
|
@@ -27,7 +27,7 @@ namespace NadekoBot.Modules.Games
|
||||
[RequireContext(ContextType.Guild)]
|
||||
public async Task Hangmanlist()
|
||||
{
|
||||
await SendConfirmAsync(Format.Code(GetText(strs.hangman_types(Prefix)) + "\n" + string.Join("\n", _service.TermPool.Data.Keys)).ConfigureAwait(false));
|
||||
await SendConfirmAsync(Format.Code(GetText(strs.hangman_types(Prefix)) + "\n" + string.Join("\n", _service.TermPool.Data.Keys)));
|
||||
}
|
||||
|
||||
[NadekoCommand, Aliases]
|
||||
|
@@ -109,10 +109,10 @@ namespace NadekoBot.Modules.Games
|
||||
for (int i = 0; i < stats.Length; i++)
|
||||
{
|
||||
var (Index, votes, Text) = stats[i];
|
||||
sb.AppendLine(GetText(strs.poll_result,
|
||||
sb.AppendLine(GetText(strs.poll_result(
|
||||
Index + 1,
|
||||
Format.Bold(Text),
|
||||
Format.Bold(votes.ToString())));
|
||||
Format.Bold(votes.ToString()))));
|
||||
}
|
||||
|
||||
return eb.WithDescription(sb.ToString())
|
||||
|
@@ -122,12 +122,8 @@ namespace NadekoBot.Modules.Games.Services
|
||||
{
|
||||
if (pc.Verbose)
|
||||
{
|
||||
var returnMsg = _strings.GetText(
|
||||
strs.perm_prevent(
|
||||
guild.Id,
|
||||
index + 1,
|
||||
Format.Bold(pc.Permissions[index]
|
||||
.GetCommand(_cmd.GetPrefix(guild), (SocketGuild)guild))));
|
||||
var returnMsg = _strings.GetText(strs.perm_prevent(index + 1,
|
||||
Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), (SocketGuild)guild))));
|
||||
|
||||
try { await usrMsg.Channel.SendErrorAsync(_eb, returnMsg).ConfigureAwait(false); } catch { }
|
||||
Log.Information(returnMsg);
|
||||
|
@@ -99,8 +99,8 @@ namespace NadekoBot.Modules.Games.Services
|
||||
|
||||
private async Task Pr_OnVoted(IUserMessage msg, IGuildUser usr)
|
||||
{
|
||||
var toDelete = await msg.Channel.SendConfirmAsync(_eb, _strs.GetText(strs.poll_voted,
|
||||
usr.Guild.Id, Format.Bold(usr.ToString())))
|
||||
var toDelete = await msg.Channel.SendConfirmAsync(_eb,
|
||||
_strs.GetText(strs.poll_voted(Format.Bold(usr.ToString())), usr.GuildId))
|
||||
.ConfigureAwait(false);
|
||||
toDelete.DeleteAfter(5);
|
||||
try { await msg.DeleteAsync().ConfigureAwait(false); } catch { }
|
||||
|
@@ -63,7 +63,7 @@ namespace NadekoBot.Modules.Music
|
||||
|
||||
var embed = _eb
|
||||
.Create(ctx)
|
||||
.WithAuthor(GetText(strs.playlists_page(num), MusicIconUrl))
|
||||
.WithAuthor(GetText(strs.playlists_page(num)), MusicIconUrl)
|
||||
.WithDescription(string.Join("\n", playlists.Select(r =>
|
||||
GetText(strs.playlists(r.Id, r.Name, r.Author, r.Songs.Count)))))
|
||||
.WithOkColor();
|
||||
|
@@ -128,10 +128,10 @@ namespace NadekoBot.Modules.Permissions.Services
|
||||
{
|
||||
try
|
||||
{
|
||||
await channel.SendErrorAsync(_eb,
|
||||
_strings.GetText(strs.perm_prevent, guild.Id, index + 1,
|
||||
Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), (SocketGuild) guild))))
|
||||
.ConfigureAwait(false);
|
||||
await channel.SendErrorAsync(_eb,
|
||||
_strings.GetText(strs.perm_prevent(index + 1,
|
||||
Format.Bold(pc.Permissions[index]
|
||||
.GetCommand(_cmd.GetPrefix(guild), (SocketGuild)guild))), guild.Id));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@@ -44,7 +44,7 @@ namespace NadekoBot.Modules.Searches
|
||||
.WithDescription(p.BaseStats.ToString())
|
||||
.WithThumbnailUrl($"https://assets.pokemon.com/assets/cms2/img/pokedex/detail/{p.Id.ToString("000")}.png")
|
||||
.AddField(GetText(strs.types), string.Join("\n", p.Types), true)
|
||||
.AddField(GetText(strs.height_weight), GetText(strs.height_weight_val(p.HeightM, p.WeightKg), true))
|
||||
.AddField(GetText(strs.height_weight), GetText(strs.height_weight_val(p.HeightM, p.WeightKg)), true)
|
||||
.AddField(GetText(strs.abilities), string.Join("\n", p.Abilities.Select(a => a.Value)), true)).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ namespace NadekoBot.Modules.Utility
|
||||
"GetHashCode",
|
||||
"GetType"
|
||||
});
|
||||
await SendConfirmAsync(GetText(strs.calcops(Prefix), string.Join(", ", selection)).ConfigureAwait(false));
|
||||
await SendConfirmAsync(GetText(strs.calcops(Prefix)), string.Join(", ", selection));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -135,10 +135,10 @@ namespace NadekoBot.Modules.Utility
|
||||
StringBuilder str = new StringBuilder();
|
||||
foreach (var kvp in CmdHandler.UserMessagesSent.OrderByDescending(kvp => kvp.Value).Skip(page * activityPerPage).Take(activityPerPage))
|
||||
{
|
||||
str.AppendLine(GetText(strs.activity_line,
|
||||
str.AppendLine(GetText(strs.activity_line(
|
||||
++startCount,
|
||||
Format.Bold(kvp.Key.ToString()),
|
||||
kvp.Value / _stats.GetUptime().TotalSeconds, kvp.Value));
|
||||
kvp.Value / _stats.GetUptime().TotalSeconds, kvp.Value)));
|
||||
}
|
||||
|
||||
await ctx.Channel.EmbedAsync(_eb.Create()
|
||||
|
@@ -99,7 +99,7 @@ namespace NadekoBot.Modules.Utility
|
||||
var inv = invites.ElementAt(index);
|
||||
await inv.DeleteAsync().ConfigureAwait(false);
|
||||
|
||||
await ReplyAsync(GetText(strs.invite_deleted(Format.Bold(inv.Code.ToString()))).ConfigureAwait(false));
|
||||
await ReplyAsync(GetText(strs.invite_deleted(Format.Bold(inv.Code))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -190,11 +190,11 @@ namespace NadekoBot.Modules.Utility
|
||||
try
|
||||
{
|
||||
await SendConfirmAsync(
|
||||
"⏰ " + GetText(strs.remind,
|
||||
"⏰ " + GetText(strs.remind(
|
||||
Format.Bold(!isPrivate ? $"<#{targetId}>" : ctx.User.Username),
|
||||
Format.Bold(message),
|
||||
$"{ts.Days}d {ts.Hours}h {ts.Minutes}min",
|
||||
gTime, gTime)).ConfigureAwait(false);
|
||||
gTime, gTime))).ConfigureAwait(false);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@@ -89,7 +89,7 @@ namespace NadekoBot.Modules.Utility
|
||||
}
|
||||
res = Math.Round(res, 4);
|
||||
|
||||
await SendConfirmAsync(GetText(strs.convert(value, originUnit.Triggers.Last(), res, targetUnit.Triggers.Last())).ConfigureAwait(false));
|
||||
await SendConfirmAsync(GetText(strs.convert(value, originUnit.Triggers.Last(), res, targetUnit.Triggers.Last())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -259,8 +259,8 @@ namespace NadekoBot.Modules.Utility
|
||||
.AddField(GetText(strs.owner_ids), ownerIds, true)
|
||||
.AddField(GetText(strs.uptime), _stats.GetUptimeString("\n"), true)
|
||||
.AddField(GetText(strs.presence),
|
||||
GetText(strs.presence_txt,
|
||||
_coord.GetGuildCount(), _stats.TextChannels, _stats.VoiceChannels), true))
|
||||
GetText(strs.presence_txt(
|
||||
_coord.GetGuildCount(), _stats.TextChannels, _stats.VoiceChannels)), true))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
@@ -264,16 +264,19 @@ namespace NadekoBot.Modules.Xp.Services
|
||||
{
|
||||
var chan = await x.User.GetOrCreateDMChannelAsync();
|
||||
if (chan != null)
|
||||
await chan.SendConfirmAsync(_eb, _strings.GetText(strs.level_up_dm,
|
||||
x.Guild.Id,
|
||||
x.User.Mention, Format.Bold(x.Level.ToString()),
|
||||
Format.Bold(x.Guild.ToString() ?? "-")));
|
||||
await chan.SendConfirmAsync(_eb,
|
||||
_strings.GetText(strs.level_up_dm(
|
||||
x.User.Mention, Format.Bold(x.Level.ToString()),
|
||||
Format.Bold(x.Guild.ToString() ?? "-")),
|
||||
x.Guild.Id));
|
||||
}
|
||||
else if (x.MessageChannel != null) // channel
|
||||
{
|
||||
await x.MessageChannel.SendConfirmAsync(_eb, _strings.GetText(strs.level_up_channel,
|
||||
x.Guild.Id,
|
||||
x.User.Mention, Format.Bold(x.Level.ToString())));
|
||||
await x.MessageChannel.SendConfirmAsync(_eb,
|
||||
_strings.GetText(strs.level_up_channel(
|
||||
x.User.Mention,
|
||||
Format.Bold(x.Level.ToString())),
|
||||
x.Guild.Id));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -288,9 +291,11 @@ namespace NadekoBot.Modules.Xp.Services
|
||||
chan = x.MessageChannel;
|
||||
}
|
||||
|
||||
await chan.SendConfirmAsync(_eb, _strings.GetText(strs.level_up_global,
|
||||
x.Guild.Id,
|
||||
x.User.Mention, Format.Bold(x.Level.ToString())));
|
||||
await chan.SendConfirmAsync(_eb,
|
||||
_strings.GetText(strs.level_up_global(
|
||||
x.User.Mention,
|
||||
Format.Bold(x.Level.ToString())),
|
||||
x.Guild.Id));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@@ -380,6 +380,6 @@ namespace NadekoBot.Extensions
|
||||
public static string GetText(this IBotStrings strings, in LocStr str, ulong? guildId = null)
|
||||
=> strings.GetText(str.Key, guildId);
|
||||
public static string GetText(this IBotStrings strings, in LocStr str, CultureInfo culture)
|
||||
=> strings.GetText(str.Key, culture, str.Parms);
|
||||
=> strings.GetText(str.Key, culture, str.Params);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user