mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
wip strings rework, experimenting, nothing works
This commit is contained in:
@@ -22,69 +22,82 @@ namespace NadekoBot.Generators
|
|||||||
{
|
{
|
||||||
private const string LocStrSource = @"namespace NadekoBot
|
private const string LocStrSource = @"namespace NadekoBot
|
||||||
{
|
{
|
||||||
public readonly ref struct LocStr
|
public readonly ref struct LocStr0
|
||||||
{
|
{
|
||||||
public readonly string Key;
|
public readonly string Key;
|
||||||
|
|
||||||
public LocStr(string key)
|
public LocStr0(string key)
|
||||||
{
|
{
|
||||||
Key = key;
|
Key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator LocStr(string data)
|
public static implicit operator LocStr0(string data)
|
||||||
=> new LocStr(data);
|
=> new LocStr0(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly ref struct LocStr<T1>
|
public readonly ref struct LocStr1
|
||||||
{
|
{
|
||||||
public readonly string Key;
|
public readonly string Key;
|
||||||
|
|
||||||
public LocStr(string key)
|
public LocStr1(string key)
|
||||||
{
|
{
|
||||||
Key = key;
|
Key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator LocStr<T1>(string data)
|
public static implicit operator LocStr1(string data)
|
||||||
=> new LocStr<T1>(data);
|
=> new LocStr1(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly ref struct LocStr<T1, T2>
|
public readonly ref struct LocStr2
|
||||||
|
{
|
||||||
|
public readonly string Key;
|
||||||
|
|
||||||
|
public LocStr2(string key)
|
||||||
|
{
|
||||||
|
Key = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator LocStr2(string data)
|
||||||
|
=> new LocStr2(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public readonly ref struct LocStr3
|
||||||
{
|
{
|
||||||
public readonly string Key;
|
public readonly string Key;
|
||||||
|
|
||||||
public LocStr(string key)
|
public LocStr3(string key)
|
||||||
{
|
{
|
||||||
Key = key;
|
Key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator LocStr<T1, T2>(string data)
|
public static implicit operator LocStr3(string data)
|
||||||
=> new LocStr<T1, T2>(data);
|
=> new LocStr3(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly ref struct LocStr<T1, T2, T3>
|
public readonly ref struct LocStr4
|
||||||
{
|
{
|
||||||
public readonly string Key;
|
public readonly string Key;
|
||||||
|
|
||||||
public LocStr(string key)
|
public LocStr4(string key)
|
||||||
{
|
{
|
||||||
Key = key;
|
Key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator LocStr<T1, T2, T3>(string data)
|
public static implicit operator LocStr4(string data)
|
||||||
=> new LocStr<T1, T2, T3>(data);
|
=> new LocStr4(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly ref struct LocStr<T1, T2, T3, T4>
|
public readonly ref struct LocStr5
|
||||||
{
|
{
|
||||||
public readonly string Key;
|
public readonly string Key;
|
||||||
|
|
||||||
public LocStr(string key)
|
public LocStr5(string key)
|
||||||
{
|
{
|
||||||
Key = key;
|
Key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator LocStr<T1, T2, T3, T4>(string data)
|
public static implicit operator LocStr5(string data)
|
||||||
=> new LocStr<T1, T2, T3, T4>(data);
|
=> new LocStr5(data);
|
||||||
}
|
}
|
||||||
}";
|
}";
|
||||||
|
|
||||||
@@ -159,15 +172,17 @@ namespace NadekoBot.Generators
|
|||||||
|
|
||||||
max += 1;
|
max += 1;
|
||||||
if (max == 0)
|
if (max == 0)
|
||||||
return "LocStr";
|
return "LocStr0";
|
||||||
if (max == 1)
|
if (max == 1)
|
||||||
return "LocStr<object>";
|
return "LocStr1";
|
||||||
if (max == 2)
|
if (max == 2)
|
||||||
return "LocStr<object, object>";
|
return "LocStr2";
|
||||||
if (max == 3)
|
if (max == 3)
|
||||||
return "LocStr<object, object, object>";
|
return "LocStr3";
|
||||||
if (max == 4)
|
if (max == 4)
|
||||||
return "LocStr<object, object, object, object>";
|
return "LocStr4";
|
||||||
|
if (max == 5)
|
||||||
|
return "LocStr5";
|
||||||
|
|
||||||
return "!Error";
|
return "!Error";
|
||||||
}
|
}
|
||||||
|
@@ -33,8 +33,23 @@ namespace NadekoBot.Modules
|
|||||||
protected string GetText(string key) =>
|
protected string GetText(string key) =>
|
||||||
Strings.GetText(key, _cultureInfo);
|
Strings.GetText(key, _cultureInfo);
|
||||||
|
|
||||||
protected string GetText(in LocStr key) =>
|
protected string GetText(in LocStr0 key) =>
|
||||||
Strings.GetText(key, _cultureInfo);
|
Strings.GetText(key, _cultureInfo);
|
||||||
|
|
||||||
|
protected string GetText(in LocStr1 key, object obj1) =>
|
||||||
|
Strings.GetText(key, _cultureInfo, obj1);
|
||||||
|
|
||||||
|
protected string GetText(in LocStr2 key, object obj1, object obj2) =>
|
||||||
|
Strings.GetText(key, _cultureInfo, obj1, obj2);
|
||||||
|
|
||||||
|
protected string GetText(in LocStr3 key, object obj1, object obj2, object obj3) =>
|
||||||
|
Strings.GetText(key, _cultureInfo, obj1, obj2, obj3);
|
||||||
|
|
||||||
|
protected string GetText(in LocStr4 key, object obj1, object obj2, object obj3, object obj4) =>
|
||||||
|
Strings.GetText(key, _cultureInfo, obj1, obj2, obj3, obj4);
|
||||||
|
|
||||||
|
protected string GetText(in LocStr5 key, object obj1, object obj2, object obj3, object obj4, object obj5) =>
|
||||||
|
Strings.GetText(key, _cultureInfo, obj1, obj2, obj3, obj4, obj5);
|
||||||
|
|
||||||
protected string GetText(string key, params object[] args) =>
|
protected string GetText(string key, params object[] args) =>
|
||||||
Strings.GetText(key, _cultureInfo, args);
|
Strings.GetText(key, _cultureInfo, args);
|
||||||
|
@@ -107,7 +107,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
public async Task PurgeUser(ulong userId)
|
public async Task PurgeUser(ulong userId)
|
||||||
{
|
{
|
||||||
var embed = _eb.Create()
|
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))
|
if (!await PromptUserConfirmAsync(embed).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
|
@@ -133,7 +133,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await SendConfirmAsync(GetText("prot_enable", "Anti-Raid"),
|
await SendConfirmAsync(GetText(strs.prot_enable, "Anti-Raid"),
|
||||||
$"{ctx.User.Mention} {GetAntiRaidString(stats)}")
|
$"{ctx.User.Mention} {GetAntiRaidString(stats)}")
|
||||||
.ConfigureAwait(false);
|
.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);
|
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);
|
$"{ctx.User.Mention} {GetAntiSpamString(stats)}").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
}
|
}
|
||||||
|
|
||||||
private string GetAntiAltString(AntiAltStats alt)
|
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.MinAge.ToString(@"dd\d\ hh\h\ mm\m\ ")),
|
||||||
Format.Bold(alt.Action.ToString()),
|
Format.Bold(alt.Action.ToString()),
|
||||||
Format.Bold(alt.Counter.ToString()));
|
Format.Bold(alt.Counter.ToString()));
|
||||||
@@ -266,7 +266,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
add = $" ({TimeSpan.FromMinutes(settings.MuteTime):hh\\hmm\\m})";
|
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.MessageThreshold.ToString()),
|
||||||
Format.Bold(settings.Action.ToString() + add),
|
Format.Bold(settings.Action.ToString() + add),
|
||||||
ignoredString);
|
ignoredString);
|
||||||
@@ -281,7 +281,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
actionString += $" **({TimeSpan.FromMinutes(stats.AntiRaidSettings.PunishDuration):hh\\hmm\\m})**";
|
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.UserThreshold.ToString()),
|
||||||
Format.Bold(stats.AntiRaidSettings.Seconds.ToString()),
|
Format.Bold(stats.AntiRaidSettings.Seconds.ToString()),
|
||||||
actionString);
|
actionString);
|
||||||
|
@@ -150,7 +150,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
}
|
}
|
||||||
var content = msg?.Content.TrimTo(30) ?? "DELETED!";
|
var content = msg?.Content.TrimTo(30) ?? "DELETED!";
|
||||||
embed.AddField($"**{rr.Index + 1}.** {(ch?.Name ?? "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);
|
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||||
|
@@ -128,7 +128,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
var groupNameText = "";
|
var groupNameText = "";
|
||||||
if (!groups.TryGetValue(kvp.Key, out var name))
|
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
|
else
|
||||||
{
|
{
|
||||||
@@ -155,7 +155,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
}
|
}
|
||||||
|
|
||||||
return _eb.Create().WithOkColor()
|
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())
|
.WithDescription(rolesStr.ToString())
|
||||||
.WithFooter(exclusive
|
.WithFooter(exclusive
|
||||||
? GetText(strs.self_assign_are_exclusive)
|
? GetText(strs.self_assign_are_exclusive)
|
||||||
|
@@ -119,7 +119,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
[{GetText(strs.channel)}]: {x.ChannelName} #{x.ChannelId}
|
[{GetText(strs.channel)}]: {x.ChannelName} #{x.ChannelId}
|
||||||
[{GetText(strs.command_text)}]: {x.CommandText}```")),
|
[{GetText(strs.command_text)}]: {x.CommandText}```")),
|
||||||
title: string.Empty,
|
title: string.Empty,
|
||||||
footer: GetText("page", page + 1))
|
footer: GetText(strs.page, page + 1))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
{GetIntervalText(x.Interval)}
|
{GetIntervalText(x.Interval)}
|
||||||
[{GetText(strs.command_text)}]: {x.CommandText}```")),
|
[{GetText(strs.command_text)}]: {x.CommandText}```")),
|
||||||
title: string.Empty,
|
title: string.Empty,
|
||||||
footer: GetText("page", page + 1))
|
footer: GetText(strs.page, page + 1))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -61,7 +61,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
await (await user.GetOrCreateDMChannelAsync().ConfigureAwait(false)).EmbedAsync(_eb.Create().WithErrorColor()
|
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.moderator), ctx.User.ToString())
|
||||||
.AddField(GetText(strs.reason), reason ?? "-"))
|
.AddField(GetText(strs.reason), reason ?? "-"))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
@@ -96,12 +96,12 @@ namespace NadekoBot.Modules.Administration
|
|||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
if (punishment is null)
|
if (punishment is null)
|
||||||
{
|
{
|
||||||
embed.WithDescription(GetText("user_warned",
|
embed.WithDescription(GetText(strs.user_warned,
|
||||||
Format.Bold(user.ToString())));
|
Format.Bold(user.ToString())));
|
||||||
}
|
}
|
||||||
else
|
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())));
|
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 user = (ctx.Guild as SocketGuild)?.GetUser(userId)?.ToString() ?? userId.ToString();
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle(GetText("warnlog_for", user));
|
.WithTitle(GetText(strs.warnlog_for, user));
|
||||||
|
|
||||||
if (!warnings.Any())
|
if (!warnings.Any())
|
||||||
{
|
{
|
||||||
@@ -233,13 +233,13 @@ namespace NadekoBot.Modules.Administration
|
|||||||
foreach (var w in warnings)
|
foreach (var w in warnings)
|
||||||
{
|
{
|
||||||
i++;
|
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("dd.MM.yyy"),
|
||||||
w.DateAdded.Value.ToString("HH:mm"),
|
w.DateAdded.Value.ToString("HH:mm"),
|
||||||
w.Moderator);
|
w.Moderator);
|
||||||
|
|
||||||
if (w.Forgiven)
|
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));
|
embed.AddField($"#`{i}` " + name, w.Reason.TrimTo(1020));
|
||||||
}
|
}
|
||||||
@@ -436,7 +436,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
{
|
{
|
||||||
try
|
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);
|
var embed = _service.GetBanUserDmEmbed(Context, guildUser, defaultMessage, msg, time.Time);
|
||||||
if (embed is not null)
|
if (embed is not null)
|
||||||
{
|
{
|
||||||
@@ -503,7 +503,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
|
|
||||||
try
|
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);
|
var embed = _service.GetBanUserDmEmbed(Context, user, defaultMessage, msg, null);
|
||||||
if (embed is not null)
|
if (embed is not null)
|
||||||
{
|
{
|
||||||
@@ -584,7 +584,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
private async Task InternalBanMessageTest(string reason, TimeSpan? duration)
|
private async Task InternalBanMessageTest(string reason, TimeSpan? duration)
|
||||||
{
|
{
|
||||||
var dmChannel = await ctx.User.GetOrCreateDMChannelAsync();
|
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,
|
var embed = _service.GetBanUserDmEmbed(Context,
|
||||||
(IGuildUser)ctx.User,
|
(IGuildUser)ctx.User,
|
||||||
defaultMessage,
|
defaultMessage,
|
||||||
@@ -685,7 +685,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
|
|
||||||
try
|
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
|
catch
|
||||||
{
|
{
|
||||||
@@ -741,7 +741,7 @@ namespace NadekoBot.Modules.Administration
|
|||||||
|
|
||||||
try
|
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);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@@ -783,8 +783,8 @@ namespace NadekoBot.Modules.Administration
|
|||||||
|
|
||||||
//send a message but don't wait for it
|
//send a message but don't wait for it
|
||||||
var banningMessageTask = ctx.Channel.EmbedAsync(_eb.Create()
|
var banningMessageTask = ctx.Channel.EmbedAsync(_eb.Create()
|
||||||
.WithDescription(GetText("mass_kill_in_progress", bans.Count()))
|
.WithDescription(GetText(strs.mass_kill_in_progress, bans.Count()))
|
||||||
.AddField(GetText("invalid", missing), missStr)
|
.AddField(GetText(strs.invalid, missing), missStr)
|
||||||
.WithOkColor());
|
.WithOkColor());
|
||||||
|
|
||||||
//do the banning
|
//do the banning
|
||||||
@@ -800,8 +800,8 @@ namespace NadekoBot.Modules.Administration
|
|||||||
var banningMessage = await banningMessageTask.ConfigureAwait(false);
|
var banningMessage = await banningMessageTask.ConfigureAwait(false);
|
||||||
|
|
||||||
await banningMessage.ModifyAsync(x => x.Embed = _eb.Create()
|
await banningMessage.ModifyAsync(x => x.Embed = _eb.Create()
|
||||||
.WithDescription(GetText("mass_kill_completed", bans.Count()))
|
.WithDescription(GetText(strs.mass_kill_completed, bans.Count()))
|
||||||
.AddField(GetText("invalid", missing), missStr)
|
.AddField(GetText(strs.invalid, missing), missStr)
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.Build()).ConfigureAwait(false);
|
.Build()).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
@@ -411,7 +411,7 @@ namespace NadekoBot.Modules.CustomReactions.Services
|
|||||||
{
|
{
|
||||||
if (pc.Verbose)
|
if (pc.Verbose)
|
||||||
{
|
{
|
||||||
var returnMsg = _strings.GetText("perm_prevent", sg.Id,
|
var returnMsg = _strings.GetText(strs.perm_prevent, sg.Id,
|
||||||
index + 1,
|
index + 1,
|
||||||
Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), sg)));
|
Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), sg)));
|
||||||
|
|
||||||
|
@@ -77,13 +77,13 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
if (race.FinishedUsers[0].Bet > 0)
|
if (race.FinishedUsers[0].Bet > 0)
|
||||||
{
|
{
|
||||||
return SendConfirmAsync(GetText(strs.animal_race),
|
return SendConfirmAsync(GetText(strs.animal_race),
|
||||||
GetText("animal_race_won_money", Format.Bold(winner.Username),
|
GetText(strs.animal_race_won_money, Format.Bold(winner.Username),
|
||||||
winner.Animal.Icon, (race.FinishedUsers[0].Bet * (race.Users.Count - 1)) + CurrencySign));
|
winner.Animal.Icon, (race.FinishedUsers[0].Bet * (race.Users.Count - 1)) + CurrencySign));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return SendConfirmAsync(GetText(strs.animal_race),
|
return SendConfirmAsync(GetText(strs.animal_race),
|
||||||
GetText("animal_race_won", Format.Bold(winner.Username), winner.Animal.Icon));
|
GetText(strs.animal_race_won, Format.Bold(winner.Username), winner.Animal.Icon));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,8 +93,8 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
ar.OnStarted += Ar_OnStarted;
|
ar.OnStarted += Ar_OnStarted;
|
||||||
_client.MessageReceived += _client_MessageReceived;
|
_client.MessageReceived += _client_MessageReceived;
|
||||||
|
|
||||||
return SendConfirmAsync(GetText(strs.animal_race), GetText("animal_race_starting", options.StartTime),
|
return SendConfirmAsync(GetText(strs.animal_race), GetText(strs.animal_race_starting, options.StartTime),
|
||||||
footer: GetText("animal_race_join_instr", Prefix));
|
footer: GetText(strs.animal_race_join_instr, Prefix));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task Ar_OnStarted(AnimalRace race)
|
private Task Ar_OnStarted(AnimalRace race)
|
||||||
@@ -102,7 +102,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
if (race.Users.Count == race.MaxUsers)
|
if (race.Users.Count == race.MaxUsers)
|
||||||
return SendConfirmAsync(GetText(strs.animal_race), GetText(strs.animal_race_full));
|
return SendConfirmAsync(GetText(strs.animal_race), GetText(strs.animal_race_full));
|
||||||
else
|
else
|
||||||
return SendConfirmAsync(GetText(strs.animal_race), GetText("animal_race_starting_with_x", race.Users.Count));
|
return SendConfirmAsync(GetText(strs.animal_race), GetText(strs.animal_race_starting_with_x, race.Users.Count));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Ar_OnStateUpdate(AnimalRace race)
|
private async Task Ar_OnStateUpdate(AnimalRace race)
|
||||||
@@ -153,9 +153,9 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
var user = await ar.JoinRace(ctx.User.Id, ctx.User.ToString(), amount)
|
var user = await ar.JoinRace(ctx.User.Id, ctx.User.ToString(), amount)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
if (amount > 0)
|
if (amount > 0)
|
||||||
await SendConfirmAsync(GetText("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)).ConfigureAwait(false);
|
||||||
else
|
else
|
||||||
await SendConfirmAsync(GetText("animal_race_join", ctx.User.Mention, user.Animal.Icon)).ConfigureAwait(false);
|
await SendConfirmAsync(GetText(strs.animal_race_join, ctx.User.Mention, user.Animal.Icon)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (ArgumentOutOfRangeException)
|
catch (ArgumentOutOfRangeException)
|
||||||
{
|
{
|
||||||
@@ -176,7 +176,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
}
|
}
|
||||||
catch (NotEnoughFundsException)
|
catch (NotEnoughFundsException)
|
||||||
{
|
{
|
||||||
await SendErrorAsync(GetText("not_enough", CurrencySign)).ConfigureAwait(false);
|
await SendErrorAsync(GetText(strs.not_enough, CurrencySign)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -129,11 +129,11 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
string title;
|
string title;
|
||||||
if (result == Connect4Game.Result.CurrentPlayerWon)
|
if (result == Connect4Game.Result.CurrentPlayerWon)
|
||||||
{
|
{
|
||||||
title = GetText("connect4_won", Format.Bold(arg.CurrentPlayer.Username), Format.Bold(arg.OtherPlayer.Username));
|
title = GetText(strs.connect4_won, Format.Bold(arg.CurrentPlayer.Username), Format.Bold(arg.OtherPlayer.Username));
|
||||||
}
|
}
|
||||||
else if (result == Connect4Game.Result.OtherPlayerWon)
|
else if (result == Connect4Game.Result.OtherPlayerWon)
|
||||||
{
|
{
|
||||||
title = GetText("connect4_won", Format.Bold(arg.OtherPlayer.Username), Format.Bold(arg.CurrentPlayer.Username));
|
title = GetText(strs.connect4_won, Format.Bold(arg.OtherPlayer.Username), Format.Bold(arg.CurrentPlayer.Username));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
title = GetText(strs.connect4_draw);
|
title = GetText(strs.connect4_draw);
|
||||||
@@ -180,7 +180,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
|
|
||||||
if (game.CurrentPhase == Connect4Game.Phase.P1Move ||
|
if (game.CurrentPhase == Connect4Game.Phase.P1Move ||
|
||||||
game.CurrentPhase == Connect4Game.Phase.P2Move)
|
game.CurrentPhase == Connect4Game.Phase.P2Move)
|
||||||
sb.AppendLine(GetText("connect4_player_to_move", Format.Bold(game.CurrentPlayer.Username)));
|
sb.AppendLine(GetText(strs.connect4_player_to_move, Format.Bold(game.CurrentPlayer.Username)));
|
||||||
|
|
||||||
for (int i = Connect4Game.NumberOfRows; i > 0; i--)
|
for (int i = Connect4Game.NumberOfRows; i > 0; i--)
|
||||||
{
|
{
|
||||||
|
@@ -52,15 +52,15 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
case CurrencyEvent.Type.Reaction:
|
case CurrencyEvent.Type.Reaction:
|
||||||
return _eb.Create()
|
return _eb.Create()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle(GetText("event_title", type.ToString()))
|
.WithTitle(GetText(strs.event_title, type.ToString()))
|
||||||
.WithDescription(GetReactionDescription(opts.Amount, currentPot))
|
.WithDescription(GetReactionDescription(opts.Amount, currentPot))
|
||||||
.WithFooter(GetText("event_duration_footer", opts.Hours));
|
.WithFooter(GetText(strs.event_duration_footer, opts.Hours));
|
||||||
case CurrencyEvent.Type.GameStatus:
|
case CurrencyEvent.Type.GameStatus:
|
||||||
return _eb.Create()
|
return _eb.Create()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle(GetText("event_title", type.ToString()))
|
.WithTitle(GetText(strs.event_title, type.ToString()))
|
||||||
.WithDescription(GetGameStatusDescription(opts.Amount, currentPot))
|
.WithDescription(GetGameStatusDescription(opts.Amount, currentPot))
|
||||||
.WithFooter(GetText("event_duration_footer", opts.Hours));
|
.WithFooter(GetText(strs.event_duration_footer, opts.Hours));
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
string potSizeStr = Format.Bold(potSize == 0
|
string potSizeStr = Format.Bold(potSize == 0
|
||||||
? "∞" + CurrencySign
|
? "∞" + CurrencySign
|
||||||
: potSize.ToString() + CurrencySign);
|
: potSize.ToString() + CurrencySign);
|
||||||
return GetText("new_reaction_event",
|
return GetText(strs.new_reaction_event,
|
||||||
CurrencySign,
|
CurrencySign,
|
||||||
Format.Bold(amount + CurrencySign),
|
Format.Bold(amount + CurrencySign),
|
||||||
potSizeStr);
|
potSizeStr);
|
||||||
@@ -83,7 +83,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
string potSizeStr = Format.Bold(potSize == 0
|
string potSizeStr = Format.Bold(potSize == 0
|
||||||
? "∞" + CurrencySign
|
? "∞" + CurrencySign
|
||||||
: potSize.ToString() + CurrencySign);
|
: potSize.ToString() + CurrencySign);
|
||||||
return GetText("new_gamestatus_event",
|
return GetText(strs.new_gamestatus_event,
|
||||||
CurrencySign,
|
CurrencySign,
|
||||||
Format.Bold(amount + CurrencySign),
|
Format.Bold(amount + CurrencySign),
|
||||||
potSizeStr);
|
potSizeStr);
|
||||||
|
@@ -35,7 +35,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
return;
|
return;
|
||||||
async Task OnEnded(IUser arg, long won)
|
async Task OnEnded(IUser arg, long won)
|
||||||
{
|
{
|
||||||
await SendConfirmAsync(GetText("rafflecur_ended", CurrencyName, Format.Bold(arg.ToString()), won + CurrencySign)).ConfigureAwait(false);
|
await SendConfirmAsync(GetText(strs.rafflecur_ended, CurrencyName, Format.Bold(arg.ToString()), won + CurrencySign)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
var res = await _service.JoinOrCreateGame(ctx.Channel.Id,
|
var res = await _service.JoinOrCreateGame(ctx.Channel.Id,
|
||||||
ctx.User, amount, mixed, OnEnded)
|
ctx.User, amount, mixed, OnEnded)
|
||||||
@@ -43,9 +43,9 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
|
|
||||||
if (res.Item1 != null)
|
if (res.Item1 != null)
|
||||||
{
|
{
|
||||||
await SendConfirmAsync(GetText("rafflecur", res.Item1.GameType.ToString()),
|
await SendConfirmAsync(GetText(strs.rafflecur, res.Item1.GameType.ToString()),
|
||||||
string.Join("\n", res.Item1.Users.Select(x => $"{x.DiscordUser} ({x.Amount})")),
|
string.Join("\n", res.Item1.Users.Select(x => $"{x.DiscordUser} ({x.Amount})")),
|
||||||
footer: GetText("rafflecur_joined", ctx.User.ToString())).ConfigureAwait(false);
|
footer: GetText(strs.rafflecur_joined, ctx.User.ToString())).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -47,7 +47,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
{
|
{
|
||||||
await ctx.Channel.SendFileAsync(ms,
|
await ctx.Channel.SendFileAsync(ms,
|
||||||
$"dice.{format.FileExtensions.First()}",
|
$"dice.{format.FileExtensions.First()}",
|
||||||
Format.Bold(ctx.User.ToString()) + " " + GetText("dice_rolled", Format.Code(gen.ToString()))).ConfigureAwait(false);
|
Format.Bold(ctx.User.ToString()) + " " + GetText(strs.dice_rolled, Format.Code(gen.ToString()))).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,8 +128,8 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
|
|
||||||
await ctx.Channel.SendFileAsync(ms, $"dice.{format.FileExtensions.First()}",
|
await ctx.Channel.SendFileAsync(ms, $"dice.{format.FileExtensions.First()}",
|
||||||
Format.Bold(ctx.User.ToString()) + " " +
|
Format.Bold(ctx.User.ToString()) + " " +
|
||||||
GetText("dice_rolled_num", Format.Bold(values.Count.ToString())) +
|
GetText(strs.dice_rolled_num, Format.Bold(values.Count.ToString())) +
|
||||||
" " + GetText("total_average",
|
" " + GetText(strs.total_average,
|
||||||
Format.Bold(values.Sum().ToString()),
|
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")))).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
}
|
}
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithDescription(ctx.User.Mention + " " + GetText("dice_rolled_num", Format.Bold(n1.ToString())))
|
.WithDescription(ctx.User.Mention + " " + GetText(strs.dice_rolled_num, Format.Bold(n1.ToString())))
|
||||||
.AddField(Format.Bold("Result"), string.Join(" ", rolls.Select(c => Format.Code($"[{c}]"))));
|
.AddField(Format.Bold("Result"), string.Join(" ", rolls.Select(c => Format.Code($"[{c}]"))));
|
||||||
|
|
||||||
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||||
@@ -177,7 +177,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
|
|
||||||
var sum = arr.Sum();
|
var sum = arr.Sum();
|
||||||
var embed = _eb.Create().WithOkColor()
|
var embed = _eb.Create().WithOkColor()
|
||||||
.WithDescription(ctx.User.Mention + " " + GetText("dice_rolled_num", n1) + $"`1 - {n2}`")
|
.WithDescription(ctx.User.Mention + " " + GetText(strs.dice_rolled_num, n1) + $"`1 - {n2}`")
|
||||||
.AddField(Format.Bold("Rolls"), string.Join(" ",
|
.AddField(Format.Bold("Rolls"), string.Join(" ",
|
||||||
(ordered ? arr.OrderBy(x => x).AsEnumerable() : arr).Select(x =>
|
(ordered ? arr.OrderBy(x => x).AsEnumerable() : arr).Select(x =>
|
||||||
Format.Code(x.ToString()))))
|
Format.Code(x.ToString()))))
|
||||||
|
@@ -66,7 +66,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
toSend += $" drew `{Deck.GetHandValue(cardObjects)}`";
|
toSend += $" drew `{Deck.GetHandValue(cardObjects)}`";
|
||||||
|
|
||||||
if (guildId != null)
|
if (guildId != null)
|
||||||
toSend += "\n" + GetText("cards_left", Format.Bold(cards.CardPool.Count.ToString()));
|
toSend += "\n" + GetText(strs.cards_left, Format.Bold(cards.CardPool.Count.ToString()));
|
||||||
|
|
||||||
return (img.ToStream(), toSend);
|
return (img.ToStream(), toSend);
|
||||||
}
|
}
|
||||||
|
@@ -67,8 +67,8 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
i.Dispose();
|
i.Dispose();
|
||||||
}
|
}
|
||||||
var msg = count != 1
|
var msg = count != 1
|
||||||
? Format.Bold(ctx.User.ToString()) + " " + GetText("flip_results", count, headCount, tailCount)
|
? Format.Bold(ctx.User.ToString()) + " " + GetText(strs.flip_results, count, headCount, tailCount)
|
||||||
: Format.Bold(ctx.User.ToString()) + " " + GetText("flipped", headCount > 0
|
: Format.Bold(ctx.User.ToString()) + " " + GetText(strs.flipped, headCount > 0
|
||||||
? Format.Bold(GetText(strs.heads))
|
? 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);
|
await ctx.Channel.SendFileAsync(stream, $"{count} coins.{format.FileExtensions.First()}", msg).ConfigureAwait(false);
|
||||||
@@ -115,7 +115,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
if (guess == result)
|
if (guess == result)
|
||||||
{
|
{
|
||||||
var toWin = (long)(amount * _config.BetFlip.Multiplier);
|
var toWin = (long)(amount * _config.BetFlip.Multiplier);
|
||||||
str = Format.Bold(ctx.User.ToString()) + " " + GetText("flip_guess", toWin + CurrencySign);
|
str = Format.Bold(ctx.User.ToString()) + " " + GetText(strs.flip_guess, toWin + CurrencySign);
|
||||||
await _cs.AddAsync(ctx.User, "Betflip Gamble", toWin, false, gamble: true).ConfigureAwait(false);
|
await _cs.AddAsync(ctx.User, "Betflip Gamble", toWin, false, gamble: true).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -196,7 +196,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
}
|
}
|
||||||
|
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithTitle(GetText("transactions",
|
.WithTitle(GetText(strs.transactions,
|
||||||
((SocketGuild)ctx.Guild)?.GetUser(userId)?.ToString() ?? $"{userId}"))
|
((SocketGuild)ctx.Guild)?.GetUser(userId)?.ToString() ?? $"{userId}"))
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
}
|
}
|
||||||
|
|
||||||
embed.WithDescription(desc);
|
embed.WithDescription(desc);
|
||||||
embed.WithFooter(GetText("page", page + 1));
|
embed.WithFooter(GetText(strs.page, page + 1));
|
||||||
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,11 +476,11 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
var result = br.Roll();
|
var result = br.Roll();
|
||||||
|
|
||||||
|
|
||||||
var str = Format.Bold(ctx.User.ToString()) + Format.Code(GetText("roll", result.Roll));
|
var str = Format.Bold(ctx.User.ToString()) + Format.Code(GetText(strs.roll, result.Roll));
|
||||||
if (result.Multiplier > 0)
|
if (result.Multiplier > 0)
|
||||||
{
|
{
|
||||||
var win = (long)(amount * result.Multiplier);
|
var win = (long)(amount * result.Multiplier);
|
||||||
str += GetText("br_win",
|
str += GetText(strs.br_win,
|
||||||
n(win) + CurrencySign,
|
n(win) + CurrencySign,
|
||||||
result.Threshold + (result.Roll == 100 ? " 👑" : ""));
|
result.Threshold + (result.Roll == 100 ? " 👑" : ""));
|
||||||
await _cs.AddAsync(ctx.User, "Betroll Gamble",
|
await _cs.AddAsync(ctx.User, "Betroll Gamble",
|
||||||
@@ -641,7 +641,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
await _cs.AddAsync(ctx.User.Id,
|
await _cs.AddAsync(ctx.User.Id,
|
||||||
"Rps-draw", amount, gamble: true).ConfigureAwait(false);
|
"Rps-draw", amount, gamble: true).ConfigureAwait(false);
|
||||||
embed.WithOkColor();
|
embed.WithOkColor();
|
||||||
msg = GetText("rps_draw", getRpsPick(pick));
|
msg = GetText(strs.rps_draw, getRpsPick(pick));
|
||||||
}
|
}
|
||||||
else if ((pick == RpsPick.Paper && nadekoPick == RpsPick.Rock) ||
|
else if ((pick == RpsPick.Paper && nadekoPick == RpsPick.Rock) ||
|
||||||
(pick == RpsPick.Rock && nadekoPick == RpsPick.Scissors) ||
|
(pick == RpsPick.Rock && nadekoPick == RpsPick.Scissors) ||
|
||||||
@@ -652,14 +652,14 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
"Rps-win", amount, gamble: true).ConfigureAwait(false);
|
"Rps-win", amount, gamble: true).ConfigureAwait(false);
|
||||||
embed.WithOkColor();
|
embed.WithOkColor();
|
||||||
embed.AddField(GetText(strs.won), n(amount));
|
embed.AddField(GetText(strs.won), n(amount));
|
||||||
msg = GetText("rps_win", ctx.User.Mention,
|
msg = GetText(strs.rps_win, ctx.User.Mention,
|
||||||
getRpsPick(pick), getRpsPick(nadekoPick));
|
getRpsPick(pick), getRpsPick(nadekoPick));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
embed.WithErrorColor();
|
embed.WithErrorColor();
|
||||||
amount = 0;
|
amount = 0;
|
||||||
msg = GetText("rps_win", ctx.Client.CurrentUser.Mention, getRpsPick(nadekoPick),
|
msg = GetText(strs.rps_win, ctx.Client.CurrentUser.Mention, getRpsPick(nadekoPick),
|
||||||
getRpsPick(pick));
|
getRpsPick(pick));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
return _eb.Create().WithErrorColor()
|
return _eb.Create().WithErrorColor()
|
||||||
.WithDescription(GetText(strs.shop_none));
|
.WithDescription(GetText(strs.shop_none));
|
||||||
var embed = _eb.Create().WithOkColor()
|
var embed = _eb.Create().WithOkColor()
|
||||||
.WithTitle(GetText("shop", CurrencySign));
|
.WithTitle(GetText(strs.shop));
|
||||||
|
|
||||||
for (int i = 0; i < theseEntries.Length; i++)
|
for (int i = 0; i < theseEntries.Length; i++)
|
||||||
{
|
{
|
||||||
@@ -173,7 +173,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
{
|
{
|
||||||
await (await ctx.User.GetOrCreateDMChannelAsync().ConfigureAwait(false))
|
await (await ctx.User.GetOrCreateDMChannelAsync().ConfigureAwait(false))
|
||||||
.EmbedAsync(_eb.Create().WithOkColor()
|
.EmbedAsync(_eb.Create().WithOkColor()
|
||||||
.WithTitle(GetText("shop_purchase", ctx.Guild.Name))
|
.WithTitle(GetText(strs.shop_purchase, ctx.Guild.Name))
|
||||||
.AddField(GetText(strs.item), item.Text, false)
|
.AddField(GetText(strs.item), item.Text, false)
|
||||||
.AddField(GetText(strs.price), entry.Price.ToString(), true)
|
.AddField(GetText(strs.price), entry.Price.ToString(), true)
|
||||||
.AddField(GetText(strs.name), entry.Name, true))
|
.AddField(GetText(strs.name), entry.Name, true))
|
||||||
@@ -433,7 +433,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
var embed = _eb.Create().WithOkColor();
|
var embed = _eb.Create().WithOkColor();
|
||||||
|
|
||||||
if (entry.Type == ShopEntryType.Role)
|
if (entry.Type == ShopEntryType.Role)
|
||||||
return embed.AddField(GetText(strs.name), GetText("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.price), entry.Price.ToString(), true)
|
||||||
.AddField(GetText(strs.type), entry.Type.ToString(), true);
|
.AddField(GetText(strs.type), entry.Type.ToString(), true);
|
||||||
else if (entry.Type == ShopEntryType.List)
|
else if (entry.Type == ShopEntryType.List)
|
||||||
@@ -441,7 +441,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
.AddField(GetText(strs.price), entry.Price.ToString(), true)
|
.AddField(GetText(strs.price), entry.Price.ToString(), true)
|
||||||
.AddField(GetText(strs.type), GetText(strs.random_unique_item), true);
|
.AddField(GetText(strs.type), GetText(strs.random_unique_item), true);
|
||||||
//else if (entry.Type == ShopEntryType.Infinite_List)
|
//else if (entry.Type == ShopEntryType.Infinite_List)
|
||||||
// return embed.AddField(GetText(strs.name), GetText("shop_role", Format.Bold(entry.RoleName)), true)
|
// return embed.AddField(GetText(strs.name), GetText(strs.shop_role, Format.Bold(entry.RoleName)), true)
|
||||||
// .AddField(GetText(strs.price), entry.Price.ToString(), true)
|
// .AddField(GetText(strs.price), entry.Price.ToString(), true)
|
||||||
// .AddField(GetText(strs.type), entry.Type.ToString(), true);
|
// .AddField(GetText(strs.type), entry.Type.ToString(), true);
|
||||||
else return null;
|
else return null;
|
||||||
@@ -451,11 +451,11 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
{
|
{
|
||||||
if (entry.Type == ShopEntryType.Role)
|
if (entry.Type == ShopEntryType.Role)
|
||||||
{
|
{
|
||||||
return GetText("shop_role", Format.Bold(ctx.Guild.GetRole(entry.RoleId)?.Name ?? "MISSING_ROLE"));
|
return GetText(strs.shop_role, Format.Bold(ctx.Guild.GetRole(entry.RoleId)?.Name ?? "MISSING_ROLE"));
|
||||||
}
|
}
|
||||||
else if (entry.Type == ShopEntryType.List)
|
else if (entry.Type == ShopEntryType.List)
|
||||||
{
|
{
|
||||||
return GetText("unique_items_left", entry.Items.Count) + "\n" + entry.Name;
|
return GetText(strs.unique_items_left, entry.Items.Count) + "\n" + entry.Name;
|
||||||
}
|
}
|
||||||
//else if (entry.Type == ShopEntryType.Infinite_List)
|
//else if (entry.Type == ShopEntryType.Infinite_List)
|
||||||
//{
|
//{
|
||||||
|
@@ -203,13 +203,13 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
await _cs.AddAsync(ctx.User, $"Slot Machine x{result.Multiplier}", amount * result.Multiplier, false, gamble: true).ConfigureAwait(false);
|
await _cs.AddAsync(ctx.User, $"Slot Machine x{result.Multiplier}", amount * result.Multiplier, false, gamble: true).ConfigureAwait(false);
|
||||||
Interlocked.Add(ref _totalPaidOut, amount * result.Multiplier);
|
Interlocked.Add(ref _totalPaidOut, amount * result.Multiplier);
|
||||||
if (result.Multiplier == 1)
|
if (result.Multiplier == 1)
|
||||||
msg = GetText("slot_single", CurrencySign, 1);
|
msg = GetText(strs.slot_single, CurrencySign, 1);
|
||||||
else if (result.Multiplier == 4)
|
else if (result.Multiplier == 4)
|
||||||
msg = GetText("slot_two", CurrencySign, 4);
|
msg = GetText(strs.slot_two, CurrencySign, 4);
|
||||||
else if (result.Multiplier == 10)
|
else if (result.Multiplier == 10)
|
||||||
msg = GetText("slot_three", 10);
|
msg = GetText(strs.slot_three, 10);
|
||||||
else if (result.Multiplier == 30)
|
else if (result.Multiplier == 30)
|
||||||
msg = GetText("slot_jackpot", 30);
|
msg = GetText(strs.slot_jackpot, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var imgStream = bgImage.ToStream())
|
using (var imgStream = bgImage.ToStream())
|
||||||
|
@@ -27,7 +27,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
var price = _service.GetResetPrice(ctx.User);
|
var price = _service.GetResetPrice(ctx.User);
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithTitle(GetText(strs.waifu_reset_confirm))
|
.WithTitle(GetText(strs.waifu_reset_confirm))
|
||||||
.WithDescription(GetText("waifu_reset_price", Format.Bold(price + CurrencySign)));
|
.WithDescription(GetText(strs.waifu_reset_price, Format.Bold(price + CurrencySign)));
|
||||||
|
|
||||||
if (!await PromptUserConfirmAsync(embed))
|
if (!await PromptUserConfirmAsync(embed))
|
||||||
return;
|
return;
|
||||||
@@ -68,11 +68,11 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
await ReplyErrorLocalizedAsync("not_enough", CurrencySign);
|
await ReplyErrorLocalizedAsync("not_enough", CurrencySign);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var msg = GetText("waifu_claimed",
|
var msg = GetText(strs.waifu_claimed,
|
||||||
Format.Bold(target.ToString()),
|
Format.Bold(target.ToString()),
|
||||||
amount + CurrencySign);
|
amount + CurrencySign);
|
||||||
if (w.Affinity?.UserId == ctx.User.Id)
|
if (w.Affinity?.UserId == ctx.User.Id)
|
||||||
msg += "\n" + GetText("waifu_fulfilled", target, w.Price + CurrencySign);
|
msg += "\n" + GetText(strs.waifu_fulfilled, target, w.Price + CurrencySign);
|
||||||
else
|
else
|
||||||
msg = " " + msg;
|
msg = " " + msg;
|
||||||
await SendConfirmAsync(ctx.User.Mention + msg);
|
await SendConfirmAsync(ctx.User.Mention + msg);
|
||||||
@@ -292,7 +292,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
.AddField(GetText(strs.changes_of_heart), $"{wi.AffinityCount} - \"the {affInfo}\"", true)
|
.AddField(GetText(strs.changes_of_heart), $"{wi.AffinityCount} - \"the {affInfo}\"", true)
|
||||||
.AddField(GetText(strs.divorces), wi.DivorceCount.ToString(), true)
|
.AddField(GetText(strs.divorces), wi.DivorceCount.ToString(), true)
|
||||||
.AddField("\u200B", "\u200B", true)
|
.AddField("\u200B", "\u200B", true)
|
||||||
.AddField(GetText("fans", wi.Fans.Count), fansStr, true)
|
.AddField(GetText(strs.fans, wi.Fans.Count), fansStr, true)
|
||||||
.AddField($"Waifus ({wi.ClaimCount})", wi.ClaimCount == 0
|
.AddField($"Waifus ({wi.ClaimCount})", wi.ClaimCount == 0
|
||||||
? nobody
|
? nobody
|
||||||
: string.Join("\n", wi.Claims.Shuffle().Take(30)), true)
|
: string.Join("\n", wi.Claims.Shuffle().Take(30)), true)
|
||||||
|
@@ -82,8 +82,8 @@ namespace NadekoBot.Modules.Games
|
|||||||
{
|
{
|
||||||
var embed = _eb.Create().WithOkColor()
|
var embed = _eb.Create().WithOkColor()
|
||||||
.WithTitle(GetText(strs.acrophobia))
|
.WithTitle(GetText(strs.acrophobia))
|
||||||
.WithDescription(GetText("acro_started", Format.Bold(string.Join(".", game.StartingLetters))))
|
.WithDescription(GetText(strs.acro_started, Format.Bold(string.Join(".", game.StartingLetters))))
|
||||||
.WithFooter(GetText("acro_started_footer", game.Opts.SubmissionTime));
|
.WithFooter(GetText(strs.acro_started_footer, game.Opts.SubmissionTime));
|
||||||
|
|
||||||
return ctx.Channel.EmbedAsync(embed);
|
return ctx.Channel.EmbedAsync(embed);
|
||||||
}
|
}
|
||||||
@@ -92,7 +92,7 @@ namespace NadekoBot.Modules.Games
|
|||||||
{
|
{
|
||||||
return SendConfirmAsync(
|
return SendConfirmAsync(
|
||||||
GetText(strs.acrophobia),
|
GetText(strs.acrophobia),
|
||||||
GetText("acro_vote_cast", Format.Bold(user)));
|
GetText(strs.acro_vote_cast, Format.Bold(user)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task Game_OnVotingStarted(AcrophobiaGame game, ImmutableArray<KeyValuePair<AcrophobiaUser, int>> submissions)
|
private async Task Game_OnVotingStarted(AcrophobiaGame game, ImmutableArray<KeyValuePair<AcrophobiaUser, int>> submissions)
|
||||||
@@ -106,7 +106,7 @@ namespace NadekoBot.Modules.Games
|
|||||||
{
|
{
|
||||||
await ctx.Channel.EmbedAsync(_eb.Create().WithOkColor()
|
await ctx.Channel.EmbedAsync(_eb.Create().WithOkColor()
|
||||||
.WithDescription(
|
.WithDescription(
|
||||||
GetText("acro_winner_only",
|
GetText(strs.acro_winner_only,
|
||||||
Format.Bold(submissions.First().Key.UserName)))
|
Format.Bold(submissions.First().Key.UserName)))
|
||||||
.WithFooter(submissions.First().Key.Input))
|
.WithFooter(submissions.First().Key.Input))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
@@ -118,7 +118,7 @@ namespace NadekoBot.Modules.Games
|
|||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle(GetText(strs.acrophobia) + " - " + GetText(strs.submissions_closed))
|
.WithTitle(GetText(strs.acrophobia) + " - " + GetText(strs.submissions_closed))
|
||||||
.WithDescription(GetText("acro_nym_was", Format.Bold(string.Join(".", game.StartingLetters)) + "\n" +
|
.WithDescription(GetText(strs.acro_nym_was, Format.Bold(string.Join(".", game.StartingLetters)) + "\n" +
|
||||||
$@"--
|
$@"--
|
||||||
{submissions.Aggregate("", (agg, cur) => agg + $"`{++i}.` **{cur.Key.Input}**\n")}
|
{submissions.Aggregate("", (agg, cur) => agg + $"`{++i}.` **{cur.Key.Input}**\n")}
|
||||||
--"))
|
--"))
|
||||||
@@ -138,7 +138,7 @@ $@"--
|
|||||||
var winner = table.First();
|
var winner = table.First();
|
||||||
var embed = _eb.Create().WithOkColor()
|
var embed = _eb.Create().WithOkColor()
|
||||||
.WithTitle(GetText(strs.acrophobia))
|
.WithTitle(GetText(strs.acrophobia))
|
||||||
.WithDescription(GetText("acro_winner", Format.Bold(winner.Key.UserName),
|
.WithDescription(GetText(strs.acro_winner, Format.Bold(winner.Key.UserName),
|
||||||
Format.Bold(winner.Value.ToString())))
|
Format.Bold(winner.Value.ToString())))
|
||||||
.WithFooter(winner.Key.Input);
|
.WithFooter(winner.Key.Input);
|
||||||
|
|
||||||
|
@@ -114,10 +114,10 @@ namespace NadekoBot.Modules.Games.Common
|
|||||||
if (_phase == Phase.Ended)
|
if (_phase == Phase.Ended)
|
||||||
embed.WithFooter(GetText(strs.ttt_no_moves));
|
embed.WithFooter(GetText(strs.ttt_no_moves));
|
||||||
else
|
else
|
||||||
embed.WithFooter(GetText("ttt_users_move", _users[_curUserIndex]));
|
embed.WithFooter(GetText(strs.ttt_users_move, _users[_curUserIndex]));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
embed.WithFooter(GetText("ttt_has_won", _winner));
|
embed.WithFooter(GetText(strs.ttt_has_won, _winner));
|
||||||
|
|
||||||
return embed;
|
return embed;
|
||||||
}
|
}
|
||||||
|
@@ -246,7 +246,7 @@ namespace NadekoBot.Modules.Games.Common.Trivia
|
|||||||
{
|
{
|
||||||
var embedS = _eb.Create().WithOkColor()
|
var embedS = _eb.Create().WithOkColor()
|
||||||
.WithTitle(GetText(strs.trivia_game))
|
.WithTitle(GetText(strs.trivia_game))
|
||||||
.WithDescription(GetText("trivia_win",
|
.WithDescription(GetText(strs.trivia_win,
|
||||||
guildUser.Mention,
|
guildUser.Mention,
|
||||||
Format.Bold(CurrentQuestion.Answer)));
|
Format.Bold(CurrentQuestion.Answer)));
|
||||||
if (Uri.IsWellFormedUriString(CurrentQuestion.AnswerImageUrl, UriKind.Absolute))
|
if (Uri.IsWellFormedUriString(CurrentQuestion.AnswerImageUrl, UriKind.Absolute))
|
||||||
@@ -264,7 +264,7 @@ namespace NadekoBot.Modules.Games.Common.Trivia
|
|||||||
}
|
}
|
||||||
var embed = _eb.Create().WithOkColor()
|
var embed = _eb.Create().WithOkColor()
|
||||||
.WithTitle(GetText(strs.trivia_game))
|
.WithTitle(GetText(strs.trivia_game))
|
||||||
.WithDescription(GetText("trivia_guess", guildUser.Mention, Format.Bold(CurrentQuestion.Answer)));
|
.WithDescription(GetText(strs.trivia_guess, guildUser.Mention, Format.Bold(CurrentQuestion.Answer)));
|
||||||
if (Uri.IsWellFormedUriString(CurrentQuestion.AnswerImageUrl, UriKind.Absolute))
|
if (Uri.IsWellFormedUriString(CurrentQuestion.AnswerImageUrl, UriKind.Absolute))
|
||||||
embed.WithImageUrl(CurrentQuestion.AnswerImageUrl);
|
embed.WithImageUrl(CurrentQuestion.AnswerImageUrl);
|
||||||
await Channel.EmbedAsync(embed).ConfigureAwait(false);
|
await Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||||
@@ -283,7 +283,7 @@ namespace NadekoBot.Modules.Games.Common.Trivia
|
|||||||
|
|
||||||
foreach (var kvp in Users.OrderByDescending(kvp => kvp.Value))
|
foreach (var kvp in Users.OrderByDescending(kvp => kvp.Value))
|
||||||
{
|
{
|
||||||
sb.AppendLine(GetText("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();
|
return sb.ToString();
|
||||||
|
@@ -27,7 +27,7 @@ namespace NadekoBot.Modules.Games
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
public async Task Hangmanlist()
|
public async Task Hangmanlist()
|
||||||
{
|
{
|
||||||
await SendConfirmAsync(Format.Code(GetText("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)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
|
@@ -43,7 +43,7 @@ namespace NadekoBot.Modules.Games
|
|||||||
await ctx.Channel
|
await ctx.Channel
|
||||||
.EmbedAsync(_eb.Create()
|
.EmbedAsync(_eb.Create()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle(GetText("poll_created", ctx.User.ToString()))
|
.WithTitle(GetText(strs.poll_created, ctx.User.ToString()))
|
||||||
.WithDescription(
|
.WithDescription(
|
||||||
Format.Bold(poll.Question) + "\n\n" +
|
Format.Bold(poll.Question) + "\n\n" +
|
||||||
string.Join("\n", poll.Answers
|
string.Join("\n", poll.Answers
|
||||||
@@ -109,14 +109,14 @@ namespace NadekoBot.Modules.Games
|
|||||||
for (int i = 0; i < stats.Length; i++)
|
for (int i = 0; i < stats.Length; i++)
|
||||||
{
|
{
|
||||||
var (Index, votes, Text) = stats[i];
|
var (Index, votes, Text) = stats[i];
|
||||||
sb.AppendLine(GetText("poll_result",
|
sb.AppendLine(GetText(strs.poll_result,
|
||||||
Index + 1,
|
Index + 1,
|
||||||
Format.Bold(Text),
|
Format.Bold(Text),
|
||||||
Format.Bold(votes.ToString())));
|
Format.Bold(votes.ToString())));
|
||||||
}
|
}
|
||||||
|
|
||||||
return eb.WithDescription(sb.ToString())
|
return eb.WithDescription(sb.ToString())
|
||||||
.WithFooter(GetText("x_votes_cast", totalVotesCast))
|
.WithFooter(GetText(strs.x_votes_cast, totalVotesCast))
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -122,7 +122,7 @@ namespace NadekoBot.Modules.Games.Services
|
|||||||
{
|
{
|
||||||
if (pc.Verbose)
|
if (pc.Verbose)
|
||||||
{
|
{
|
||||||
var returnMsg = _strings.GetText("perm_prevent", guild.Id, index + 1, Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), (SocketGuild)guild))); try { await usrMsg.Channel.SendErrorAsync(_eb, returnMsg).ConfigureAwait(false); } catch { }
|
var returnMsg = _strings.GetText(strs.perm_prevent, guild.Id, 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);
|
Log.Information(returnMsg);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@@ -99,7 +99,7 @@ namespace NadekoBot.Modules.Games.Services
|
|||||||
|
|
||||||
private async Task Pr_OnVoted(IUserMessage msg, IGuildUser usr)
|
private async Task Pr_OnVoted(IUserMessage msg, IGuildUser usr)
|
||||||
{
|
{
|
||||||
var toDelete = await msg.Channel.SendConfirmAsync(_eb, _strs.GetText("poll_voted",
|
var toDelete = await msg.Channel.SendConfirmAsync(_eb, _strs.GetText(strs.poll_voted,
|
||||||
usr.Guild.Id, Format.Bold(usr.ToString())))
|
usr.Guild.Id, Format.Bold(usr.ToString())))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
toDelete.DeleteAfter(5);
|
toDelete.DeleteAfter(5);
|
||||||
|
@@ -99,7 +99,7 @@ namespace NadekoBot.Modules.Help
|
|||||||
.OrderBy(module => module.Name)
|
.OrderBy(module => module.Name)
|
||||||
.ForEach(module => embed.AddField($"{GetModuleEmoji(module.Name)} {module.Name}",
|
.ForEach(module => embed.AddField($"{GetModuleEmoji(module.Name)} {module.Name}",
|
||||||
GetText($"module_description_{module.Name.ToLowerInvariant()}") + "\n" +
|
GetText($"module_description_{module.Name.ToLowerInvariant()}") + "\n" +
|
||||||
Format.Code(GetText("module_footer", Prefix, module.Name.ToLowerInvariant())),
|
Format.Code(GetText(strs.module_footer, Prefix, module.Name.ToLowerInvariant())),
|
||||||
true));
|
true));
|
||||||
|
|
||||||
return embed;
|
return embed;
|
||||||
@@ -230,7 +230,7 @@ namespace NadekoBot.Modules.Help
|
|||||||
embed.AddField(g.ElementAt(i).Key, "```css\n" + string.Join("\n", transformed) + "\n```", true);
|
embed.AddField(g.ElementAt(i).Key, "```css\n" + string.Join("\n", transformed) + "\n```", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
embed.WithFooter(GetText("commands_instr", Prefix));
|
embed.WithFooter(GetText(strs.commands_instr, Prefix));
|
||||||
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -78,7 +78,7 @@ namespace NadekoBot.Modules.Help.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
em
|
em
|
||||||
.AddField(GetText("usage", guild),
|
.AddField(_strings.GetText(strs.usage),
|
||||||
string.Join("\n", Array.ConvertAll(com.RealRemarksArr(_strings, guild?.Id, prefix),
|
string.Join("\n", Array.ConvertAll(com.RealRemarksArr(_strings, guild?.Id, prefix),
|
||||||
arg => Format.Code(arg))),
|
arg => Format.Code(arg))),
|
||||||
false)
|
false)
|
||||||
|
@@ -293,10 +293,10 @@ namespace NadekoBot.Modules.Music
|
|||||||
var repeatType = mp.Repeat;
|
var repeatType = mp.Repeat;
|
||||||
var add = "";
|
var add = "";
|
||||||
if (mp.IsStopped)
|
if (mp.IsStopped)
|
||||||
add += Format.Bold(GetText("queue_stopped", Format.Code(Prefix + "play"))) + "\n";
|
add += Format.Bold(GetText(strs.queue_stopped, Format.Code(Prefix + "play"))) + "\n";
|
||||||
// var mps = mp.MaxPlaytimeSeconds;
|
// var mps = mp.MaxPlaytimeSeconds;
|
||||||
// if (mps > 0)
|
// if (mps > 0)
|
||||||
// add += Format.Bold(GetText("song_skips_after", TimeSpan.FromSeconds(mps).ToString("HH\\:mm\\:ss"))) + "\n";
|
// add += Format.Bold(GetText(strs.song_skips_after, TimeSpan.FromSeconds(mps).ToString("HH\\:mm\\:ss"))) + "\n";
|
||||||
if (repeatType == PlayerRepeatType.Track)
|
if (repeatType == PlayerRepeatType.Track)
|
||||||
{
|
{
|
||||||
add += "🔂 " + GetText(strs.repeating_track) + "\n";
|
add += "🔂 " + GetText(strs.repeating_track) + "\n";
|
||||||
@@ -329,7 +329,7 @@ namespace NadekoBot.Modules.Music
|
|||||||
desc = add + "\n" + desc;
|
desc = add + "\n" + desc;
|
||||||
|
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithAuthor(GetText("player_queue", curPage + 1, (tracks.Count / LQ_ITEMS_PER_PAGE) + 1),
|
.WithAuthor(GetText(strs.player_queue, curPage + 1, (tracks.Count / LQ_ITEMS_PER_PAGE) + 1),
|
||||||
MusicIconUrl)
|
MusicIconUrl)
|
||||||
.WithDescription(desc)
|
.WithDescription(desc)
|
||||||
.WithFooter($" {mp.PrettyVolume()} | 🎶 {tracks.Count} | ⌛ {mp.PrettyTotalTime()} ")
|
.WithFooter($" {mp.PrettyVolume()} | 🎶 {tracks.Count} | ⌛ {mp.PrettyTotalTime()} ")
|
||||||
|
@@ -63,9 +63,9 @@ namespace NadekoBot.Modules.Music
|
|||||||
|
|
||||||
var embed = _eb
|
var embed = _eb
|
||||||
.Create(ctx)
|
.Create(ctx)
|
||||||
.WithAuthor(GetText("playlists_page", num), MusicIconUrl)
|
.WithAuthor(GetText(strs.playlists_page, num), MusicIconUrl)
|
||||||
.WithDescription(string.Join("\n", playlists.Select(r =>
|
.WithDescription(string.Join("\n", playlists.Select(r =>
|
||||||
GetText("playlists", r.Id, r.Name, r.Author, r.Songs.Count))))
|
GetText(strs.playlists, r.Id, r.Name, r.Author, r.Songs.Count))))
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
|
|
||||||
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||||
@@ -225,7 +225,7 @@ namespace NadekoBot.Modules.Music
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
msg = await ctx.Channel
|
msg = await ctx.Channel
|
||||||
.SendMessageAsync(GetText("attempting_to_queue", Format.Bold(mpl.Songs.Count.ToString())))
|
.SendMessageAsync(GetText(strs.attempting_to_queue, Format.Bold(mpl.Songs.Count.ToString())))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
@@ -121,7 +121,7 @@ namespace NadekoBot.Modules.Permissions
|
|||||||
}
|
}
|
||||||
|
|
||||||
var startPos = 20 * (page - 1);
|
var startPos = 20 * (page - 1);
|
||||||
var toSend = Format.Bold(GetText("page", page)) + "\n\n" + string.Join("\n",
|
var toSend = Format.Bold(GetText(strs.page, page)) + "\n\n" + string.Join("\n",
|
||||||
perms.Reverse()
|
perms.Reverse()
|
||||||
.Skip(startPos)
|
.Skip(startPos)
|
||||||
.Take(20)
|
.Take(20)
|
||||||
|
@@ -129,7 +129,7 @@ namespace NadekoBot.Modules.Permissions.Services
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
await channel.SendErrorAsync(_eb,
|
await channel.SendErrorAsync(_eb,
|
||||||
_strings.GetText("perm_prevent", guild.Id, index + 1,
|
_strings.GetText(strs.perm_prevent, guild.Id, index + 1,
|
||||||
Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), (SocketGuild) guild))))
|
Format.Bold(pc.Permissions[index].GetCommand(_cmd.GetPrefix(guild), (SocketGuild) guild))))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
@@ -83,7 +83,7 @@ namespace NadekoBot.Modules.Searches
|
|||||||
|
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle(GetText("mal_profile", name))
|
.WithTitle(GetText(strs.mal_profile, name))
|
||||||
.AddField("💚 " + GetText(strs.watching), stats[0], true)
|
.AddField("💚 " + GetText(strs.watching), stats[0], true)
|
||||||
.AddField("💙 " + GetText(strs.completed), stats[1], true);
|
.AddField("💙 " + GetText(strs.completed), stats[1], true);
|
||||||
if (info.Count < 3)
|
if (info.Count < 3)
|
||||||
|
@@ -24,7 +24,7 @@ namespace NadekoBot.Modules.Searches
|
|||||||
{
|
{
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithTitle(GetText(strs.crypto_not_found))
|
.WithTitle(GetText(strs.crypto_not_found))
|
||||||
.WithDescription(GetText("did_you_mean", Format.Bold($"{nearest.Name} ({nearest.Symbol})")));
|
.WithDescription(GetText(strs.did_you_mean, Format.Bold($"{nearest.Name} ({nearest.Symbol})")));
|
||||||
|
|
||||||
if (await PromptUserConfirmAsync(embed).ConfigureAwait(false))
|
if (await PromptUserConfirmAsync(embed).ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
|
@@ -30,7 +30,7 @@ namespace NadekoBot.Modules.Searches
|
|||||||
[NadekoCommand, Aliases]
|
[NadekoCommand, Aliases]
|
||||||
public async Task Placelist()
|
public async Task Placelist()
|
||||||
{
|
{
|
||||||
await SendConfirmAsync(GetText("list_of_place_tags", Prefix),
|
await SendConfirmAsync(GetText(strs.list_of_place_tags, Prefix),
|
||||||
_typesStr)
|
_typesStr)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
@@ -44,7 +44,7 @@ namespace NadekoBot.Modules.Searches
|
|||||||
.WithDescription(p.BaseStats.ToString())
|
.WithDescription(p.BaseStats.ToString())
|
||||||
.WithThumbnailUrl($"https://assets.pokemon.com/assets/cms2/img/pokedex/detail/{p.Id.ToString("000")}.png")
|
.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.types), string.Join("\n", p.Types), true)
|
||||||
.AddField(GetText(strs.height_weight), GetText("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);
|
.AddField(GetText(strs.abilities), string.Join("\n", p.Abilities.Select(a => a.Value)), true)).ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -756,7 +756,7 @@ namespace NadekoBot.Modules.Searches
|
|||||||
// .AddField(GetText(strs.genres), gameData.TotalEpisodes.ToString(), true)
|
// .AddField(GetText(strs.genres), gameData.TotalEpisodes.ToString(), true)
|
||||||
// .AddField(GetText(strs.price), gameData.IsFree ? GetText(strs.FREE) : game, true)
|
// .AddField(GetText(strs.price), gameData.IsFree ? GetText(strs.FREE) : game, true)
|
||||||
// .AddField(GetText(strs.links), gameData.GetGenresString(), true)
|
// .AddField(GetText(strs.links), gameData.GetGenresString(), true)
|
||||||
// .WithFooter(GetText("recommendations", gameData.TotalRecommendations));
|
// .WithFooter(GetText(strs.recommendations, gameData.TotalRecommendations));
|
||||||
await ctx.Channel.SendMessageAsync($"https://store.steampowered.com/app/{appId}").ConfigureAwait(false);
|
await ctx.Channel.SendMessageAsync($"https://store.steampowered.com/app/{appId}").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -50,6 +50,7 @@ namespace NadekoBot.Modules.Searches.Services
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo fix novel
|
||||||
public async Task<NovelResult> GetNovelData(string query)
|
public async Task<NovelResult> GetNovelData(string query)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(query))
|
if (string.IsNullOrWhiteSpace(query))
|
||||||
|
@@ -55,7 +55,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
"GetHashCode",
|
"GetHashCode",
|
||||||
"GetType"
|
"GetType"
|
||||||
});
|
});
|
||||||
await SendConfirmAsync(GetText("calcops", Prefix), string.Join(", ", selection)).ConfigureAwait(false);
|
await SendConfirmAsync(GetText(strs.calcops, Prefix), string.Join(", ", selection)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
var configNames = _settingServices.Select(x => x.Name);
|
var configNames = _settingServices.Select(x => x.Name);
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithErrorColor()
|
.WithErrorColor()
|
||||||
.WithDescription(GetText("config_not_found", Format.Code(name)))
|
.WithDescription(GetText(strs.config_not_found, Format.Code(name)))
|
||||||
.AddField(GetText(strs.config_list), string.Join("\n", configNames));
|
.AddField(GetText(strs.config_list), string.Join("\n", configNames));
|
||||||
|
|
||||||
await ctx.Channel.EmbedAsync(embed);
|
await ctx.Channel.EmbedAsync(embed);
|
||||||
@@ -90,7 +90,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
{
|
{
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithErrorColor()
|
.WithErrorColor()
|
||||||
.WithDescription(GetText("config_not_found", Format.Code(name)))
|
.WithDescription(GetText(strs.config_not_found, Format.Code(name)))
|
||||||
.AddField(GetText(strs.config_list), string.Join("\n", configNames));
|
.AddField(GetText(strs.config_list), string.Join("\n", configNames));
|
||||||
|
|
||||||
await ctx.Channel.EmbedAsync(embed);
|
await ctx.Channel.EmbedAsync(embed);
|
||||||
@@ -123,7 +123,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
var propStrings = GetPropsAndValuesString(setting, propNames);
|
var propStrings = GetPropsAndValuesString(setting, propNames);
|
||||||
var propErrorEmbed = _eb.Create()
|
var propErrorEmbed = _eb.Create()
|
||||||
.WithErrorColor()
|
.WithErrorColor()
|
||||||
.WithDescription(GetText("config_prop_not_found", Format.Code(prop), Format.Code(name)))
|
.WithDescription(GetText(strs.config_prop_not_found, Format.Code(prop), Format.Code(name)))
|
||||||
.AddField($"⚙️ {setting.Name}", propStrings);
|
.AddField($"⚙️ {setting.Name}", propStrings);
|
||||||
|
|
||||||
await ctx.Channel.EmbedAsync(propErrorEmbed);
|
await ctx.Channel.EmbedAsync(propErrorEmbed);
|
||||||
|
@@ -135,16 +135,16 @@ namespace NadekoBot.Modules.Utility
|
|||||||
StringBuilder str = new StringBuilder();
|
StringBuilder str = new StringBuilder();
|
||||||
foreach (var kvp in CmdHandler.UserMessagesSent.OrderByDescending(kvp => kvp.Value).Skip(page * activityPerPage).Take(activityPerPage))
|
foreach (var kvp in CmdHandler.UserMessagesSent.OrderByDescending(kvp => kvp.Value).Skip(page * activityPerPage).Take(activityPerPage))
|
||||||
{
|
{
|
||||||
str.AppendLine(GetText("activity_line",
|
str.AppendLine(GetText(strs.activity_line,
|
||||||
++startCount,
|
++startCount,
|
||||||
Format.Bold(kvp.Key.ToString()),
|
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()
|
await ctx.Channel.EmbedAsync(_eb.Create()
|
||||||
.WithTitle(GetText("activity_page", page + 1))
|
.WithTitle(GetText(strs.activity_page, page + 1))
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithFooter(GetText("activity_users_total", CmdHandler.UserMessagesSent.Count))
|
.WithFooter(GetText(strs.activity_users_total, CmdHandler.UserMessagesSent.Count))
|
||||||
.WithDescription(str.ToString())).ConfigureAwait(false);
|
.WithDescription(str.ToString())).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -99,7 +99,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
var inv = invites.ElementAt(index);
|
var inv = invites.ElementAt(index);
|
||||||
await inv.DeleteAsync().ConfigureAwait(false);
|
await inv.DeleteAsync().ConfigureAwait(false);
|
||||||
|
|
||||||
await ReplyAsync(GetText("invite_deleted", Format.Bold(inv.Code.ToString()))).ConfigureAwait(false);
|
await ReplyAsync(GetText(strs.invite_deleted, Format.Bold(inv.Code.ToString()))).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -41,8 +41,8 @@ namespace NadekoBot.Modules.Utility
|
|||||||
.AddField(GetText(strs.clpa_fail_already_title), GetText(strs.clpa_fail_already))
|
.AddField(GetText(strs.clpa_fail_already_title), GetText(strs.clpa_fail_already))
|
||||||
.AddField(GetText(strs.clpa_fail_wait_title), GetText(strs.clpa_fail_wait))
|
.AddField(GetText(strs.clpa_fail_wait_title), GetText(strs.clpa_fail_wait))
|
||||||
.AddField(GetText(strs.clpa_fail_conn_title), GetText(strs.clpa_fail_conn))
|
.AddField(GetText(strs.clpa_fail_conn_title), GetText(strs.clpa_fail_conn))
|
||||||
.AddField(GetText(strs.clpa_fail_sup_title), GetText("clpa_fail_sup", helpcmd))
|
.AddField(GetText(strs.clpa_fail_sup_title), GetText(strs.clpa_fail_sup, helpcmd))
|
||||||
.WithFooter(GetText("clpa_next_update", rem)));
|
.WithFooter(GetText(strs.clpa_next_update, rem)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -48,7 +48,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (quotes.Any())
|
if (quotes.Any())
|
||||||
await SendConfirmAsync(GetText("quotes_page", page + 1),
|
await SendConfirmAsync(GetText(strs.quotes_page, page + 1),
|
||||||
string.Join("\n", quotes.Select(q => $"`#{q.Id}` {Format.Bold(q.Keyword.SanitizeAllMentions()),-20} by {q.AuthorName.SanitizeAllMentions()}")))
|
string.Join("\n", quotes.Select(q => $"`#{q.Id}` {Format.Bold(q.Keyword.SanitizeAllMentions()),-20} by {q.AuthorName.SanitizeAllMentions()}")))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
else
|
else
|
||||||
@@ -113,12 +113,12 @@ namespace NadekoBot.Modules.Utility
|
|||||||
{
|
{
|
||||||
await ctx.Channel.EmbedAsync(_eb.Create(ctx)
|
await ctx.Channel.EmbedAsync(_eb.Create(ctx)
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle(GetText("quote_id", $"#{data.Id}"))
|
.WithTitle(GetText(strs.quote_id, $"#{data.Id}"))
|
||||||
.AddField(GetText(strs.trigger), data.Keyword)
|
.AddField(GetText(strs.trigger), data.Keyword)
|
||||||
.AddField(GetText(strs.response), data.Text.Length > 1000
|
.AddField(GetText(strs.response), data.Text.Length > 1000
|
||||||
? GetText(strs.redacted_too_long)
|
? GetText(strs.redacted_too_long)
|
||||||
: Format.Sanitize(data.Text))
|
: Format.Sanitize(data.Text))
|
||||||
.WithFooter(GetText("created_by", $"{data.AuthorName} ({data.AuthorId})"))
|
.WithFooter(GetText(strs.created_by, $"{data.AuthorName} ({data.AuthorId})"))
|
||||||
).ConfigureAwait(false);
|
).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
uow.Quotes.Remove(q);
|
uow.Quotes.Remove(q);
|
||||||
await uow.SaveChangesAsync();
|
await uow.SaveChangesAsync();
|
||||||
success = true;
|
success = true;
|
||||||
response = GetText("quote_deleted", id);
|
response = GetText(strs.quote_deleted, id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (success)
|
if (success)
|
||||||
|
@@ -190,7 +190,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
await SendConfirmAsync(
|
await SendConfirmAsync(
|
||||||
"⏰ " + GetText("remind",
|
"⏰ " + GetText(strs.remind,
|
||||||
Format.Bold(!isPrivate ? $"<#{targetId}>" : ctx.User.Username),
|
Format.Bold(!isPrivate ? $"<#{targetId}>" : ctx.User.Username),
|
||||||
Format.Bold(message),
|
Format.Bold(message),
|
||||||
$"{ts.Days}d {ts.Hours}h {ts.Minutes}min",
|
$"{ts.Days}d {ts.Hours}h {ts.Minutes}min",
|
||||||
|
@@ -50,7 +50,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
var description = GetRepeaterInfoString(removed);
|
var description = GetRepeaterInfoString(removed);
|
||||||
await ctx.Channel.EmbedAsync(_eb.Create()
|
await ctx.Channel.EmbedAsync(_eb.Create()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle(GetText("repeater_removed", index + 1))
|
.WithTitle(GetText(strs.repeater_removed, index + 1))
|
||||||
.WithDescription(description));
|
.WithDescription(description));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -89,7 +89,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
}
|
}
|
||||||
res = Math.Round(res, 4);
|
res = Math.Round(res, 4);
|
||||||
|
|
||||||
await SendConfirmAsync(GetText("convert", value, originUnit.Triggers.Last(), res, targetUnit.Triggers.Last())).ConfigureAwait(false);
|
await SendConfirmAsync(GetText(strs.convert, value, originUnit.Triggers.Last(), res, targetUnit.Triggers.Last())).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -117,7 +117,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
return _eb.Create().WithOkColor().WithDescription(GetText(strs.no_user_on_this_page));
|
return _eb.Create().WithOkColor().WithDescription(GetText(strs.no_user_on_this_page));
|
||||||
|
|
||||||
return _eb.Create().WithOkColor()
|
return _eb.Create().WithOkColor()
|
||||||
.WithTitle(GetText("inrole_list", Format.Bold(role?.Name ?? "No Role")) + $" - {roleUsers.Length}")
|
.WithTitle(GetText(strs.inrole_list, Format.Bold(role?.Name ?? "No Role")) + $" - {roleUsers.Length}")
|
||||||
.WithDescription(string.Join("\n", pageUsers));
|
.WithDescription(string.Join("\n", pageUsers));
|
||||||
}, roleUsers.Length, 20).ConfigureAwait(false);
|
}, roleUsers.Length, 20).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
await SendConfirmAsync(GetText("roles_page", page, Format.Bold(target.ToString())),
|
await SendConfirmAsync(GetText(strs.roles_page, page, Format.Bold(target.ToString())),
|
||||||
"\n• " + string.Join("\n• ", (IEnumerable<IRole>)roles).SanitizeMentions(true)).ConfigureAwait(false);
|
"\n• " + string.Join("\n• ", (IEnumerable<IRole>)roles).SanitizeMentions(true)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await SendConfirmAsync(GetText("roles_all_page", page),
|
await SendConfirmAsync(GetText(strs.roles_all_page, page),
|
||||||
"\n• " + string.Join("\n• ", (IEnumerable<IRole>)roles).SanitizeMentions(true)).ConfigureAwait(false);
|
"\n• " + string.Join("\n• ", (IEnumerable<IRole>)roles).SanitizeMentions(true)).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -259,7 +259,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
.AddField(GetText(strs.owner_ids), ownerIds, true)
|
.AddField(GetText(strs.owner_ids), ownerIds, true)
|
||||||
.AddField(GetText(strs.uptime), _stats.GetUptimeString("\n"), true)
|
.AddField(GetText(strs.uptime), _stats.GetUptimeString("\n"), true)
|
||||||
.AddField(GetText(strs.presence),
|
.AddField(GetText(strs.presence),
|
||||||
GetText("presence_txt",
|
GetText(strs.presence_txt,
|
||||||
_coord.GetGuildCount(), _stats.TextChannels, _stats.VoiceChannels), true))
|
_coord.GetGuildCount(), _stats.TextChannels, _stats.VoiceChannels), true))
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@@ -269,7 +269,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
{
|
{
|
||||||
var tags = ctx.Message.Tags.Where(t => t.Type == TagType.Emoji).Select(t => (Emote)t.Value);
|
var tags = ctx.Message.Tags.Where(t => t.Type == TagType.Emoji).Select(t => (Emote)t.Value);
|
||||||
|
|
||||||
var result = string.Join("\n", tags.Select(m => GetText("showemojis", m, m.Url)));
|
var result = string.Join("\n", tags.Select(m => GetText(strs.showemojis, m, m.Url)));
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(result))
|
if (string.IsNullOrWhiteSpace(result))
|
||||||
await ReplyErrorLocalizedAsync("showemojis_none").ConfigureAwait(false);
|
await ReplyErrorLocalizedAsync("showemojis_none").ConfigureAwait(false);
|
||||||
@@ -298,7 +298,7 @@ namespace NadekoBot.Modules.Utility
|
|||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
foreach (var guild in guilds)
|
foreach (var guild in guilds)
|
||||||
embed.AddField(guild.Name,
|
embed.AddField(guild.Name,
|
||||||
GetText("listservers", guild.Id, guild.MemberCount, guild.OwnerId),
|
GetText(strs.listservers, guild.Id, guild.MemberCount, guild.OwnerId),
|
||||||
false);
|
false);
|
||||||
|
|
||||||
await ctx.Channel.EmbedAsync(embed);
|
await ctx.Channel.EmbedAsync(embed);
|
||||||
|
@@ -138,7 +138,7 @@ namespace NadekoBot.Modules.Xp
|
|||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithOkColor()
|
.WithOkColor()
|
||||||
.WithTitle($"{club.ToString()}")
|
.WithTitle($"{club.ToString()}")
|
||||||
.WithDescription(GetText("level_x", lvl.Level) + $" ({club.Xp} xp)")
|
.WithDescription(GetText(strs.level_x, lvl.Level) + $" ({club.Xp} xp)")
|
||||||
.AddField(GetText(strs.desc), string.IsNullOrWhiteSpace(club.Description) ? "-" : club.Description,
|
.AddField(GetText(strs.desc), string.IsNullOrWhiteSpace(club.Description) ? "-" : club.Description,
|
||||||
false)
|
false)
|
||||||
.AddField(GetText(strs.owner), club.Owner.ToString(), true)
|
.AddField(GetText(strs.owner), club.Owner.ToString(), true)
|
||||||
@@ -188,7 +188,7 @@ namespace NadekoBot.Modules.Xp
|
|||||||
.Select(x => x.ToString()));
|
.Select(x => x.ToString()));
|
||||||
|
|
||||||
return _eb.Create()
|
return _eb.Create()
|
||||||
.WithTitle(GetText("club_bans_for", club.ToString()))
|
.WithTitle(GetText(strs.club_bans_for, club.ToString()))
|
||||||
.WithDescription(toShow)
|
.WithDescription(toShow)
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
}, bans.Length, 10);
|
}, bans.Length, 10);
|
||||||
@@ -219,7 +219,7 @@ namespace NadekoBot.Modules.Xp
|
|||||||
.Select(x => x.ToString()));
|
.Select(x => x.ToString()));
|
||||||
|
|
||||||
return _eb.Create()
|
return _eb.Create()
|
||||||
.WithTitle(GetText("club_apps_for", club.ToString()))
|
.WithTitle(GetText(strs.club_apps_for, club.ToString()))
|
||||||
.WithDescription(toShow)
|
.WithDescription(toShow)
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
}, apps.Length, 10);
|
}, apps.Length, 10);
|
||||||
@@ -374,7 +374,7 @@ namespace NadekoBot.Modules.Xp
|
|||||||
var clubs = _service.GetClubLeaderboardPage(page);
|
var clubs = _service.GetClubLeaderboardPage(page);
|
||||||
|
|
||||||
var embed = _eb.Create()
|
var embed = _eb.Create()
|
||||||
.WithTitle(GetText("club_leaderboard", page + 1))
|
.WithTitle(GetText(strs.club_leaderboard, page + 1))
|
||||||
.WithOkColor();
|
.WithOkColor();
|
||||||
|
|
||||||
var i = page * 9;
|
var i = page * 9;
|
||||||
|
@@ -264,14 +264,14 @@ namespace NadekoBot.Modules.Xp.Services
|
|||||||
{
|
{
|
||||||
var chan = await x.User.GetOrCreateDMChannelAsync();
|
var chan = await x.User.GetOrCreateDMChannelAsync();
|
||||||
if (chan != null)
|
if (chan != null)
|
||||||
await chan.SendConfirmAsync(_eb, _strings.GetText("level_up_dm",
|
await chan.SendConfirmAsync(_eb, _strings.GetText(strs.level_up_dm,
|
||||||
x.Guild.Id,
|
x.Guild.Id,
|
||||||
x.User.Mention, Format.Bold(x.Level.ToString()),
|
x.User.Mention, Format.Bold(x.Level.ToString()),
|
||||||
Format.Bold(x.Guild.ToString() ?? "-")));
|
Format.Bold(x.Guild.ToString() ?? "-")));
|
||||||
}
|
}
|
||||||
else if (x.MessageChannel != null) // channel
|
else if (x.MessageChannel != null) // channel
|
||||||
{
|
{
|
||||||
await x.MessageChannel.SendConfirmAsync(_eb, _strings.GetText("level_up_channel",
|
await x.MessageChannel.SendConfirmAsync(_eb, _strings.GetText(strs.level_up_channel,
|
||||||
x.Guild.Id,
|
x.Guild.Id,
|
||||||
x.User.Mention, Format.Bold(x.Level.ToString())));
|
x.User.Mention, Format.Bold(x.Level.ToString())));
|
||||||
}
|
}
|
||||||
@@ -288,7 +288,7 @@ namespace NadekoBot.Modules.Xp.Services
|
|||||||
chan = x.MessageChannel;
|
chan = x.MessageChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
await chan.SendConfirmAsync(_eb, _strings.GetText("level_up_global",
|
await chan.SendConfirmAsync(_eb, _strings.GetText(strs.level_up_global,
|
||||||
x.Guild.Id,
|
x.Guild.Id,
|
||||||
x.User.Mention, Format.Bold(x.Level.ToString())));
|
x.User.Mention, Format.Bold(x.Level.ToString())));
|
||||||
}
|
}
|
||||||
|
@@ -72,13 +72,13 @@ namespace NadekoBot.Modules.Xp
|
|||||||
var str = ctx.Guild.GetRole(x.RoleId)?.ToString();
|
var str = ctx.Guild.GetRole(x.RoleId)?.ToString();
|
||||||
|
|
||||||
if (str is null)
|
if (str is null)
|
||||||
str = GetText("role_not_found", Format.Code(x.RoleId.ToString()));
|
str = GetText(strs.role_not_found, Format.Code(x.RoleId.ToString()));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!x.Remove)
|
if (!x.Remove)
|
||||||
str = GetText("xp_receive_role", Format.Bold(str));
|
str = GetText(strs.xp_receive_role, Format.Bold(str));
|
||||||
else
|
else
|
||||||
str = GetText("xp_lose_role", Format.Bold(str));
|
str = GetText(strs.xp_lose_role, Format.Bold(str));
|
||||||
}
|
}
|
||||||
return (x.Level, Text: sign + str);
|
return (x.Level, Text: sign + str);
|
||||||
})
|
})
|
||||||
@@ -105,7 +105,7 @@ namespace NadekoBot.Modules.Xp
|
|||||||
|
|
||||||
foreach (var reward in localRewards)
|
foreach (var reward in localRewards)
|
||||||
{
|
{
|
||||||
embed.AddField(GetText("level_x", reward.Key),
|
embed.AddField(GetText(strs.level_x, reward.Key),
|
||||||
string.Join("\n", reward.Select(y => y.Item2)));
|
string.Join("\n", reward.Select(y => y.Item2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,7 +364,7 @@ namespace NadekoBot.Modules.Xp
|
|||||||
|
|
||||||
embed.AddField(
|
embed.AddField(
|
||||||
$"#{(i + 1 + curPage * 9)} {(user?.ToString() ?? users[i].UserId.ToString())}",
|
$"#{(i + 1 + curPage * 9)} {(user?.ToString() ?? users[i].UserId.ToString())}",
|
||||||
$"{GetText("level_x", levelStats.Level)} - {levelStats.TotalXp}xp {awardStr}");
|
$"{GetText(strs.level_x, levelStats.Level)} - {levelStats.TotalXp}xp {awardStr}");
|
||||||
}
|
}
|
||||||
return embed;
|
return embed;
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ namespace NadekoBot.Modules.Xp
|
|||||||
var user = users[i];
|
var user = users[i];
|
||||||
embed.AddField(
|
embed.AddField(
|
||||||
$"#{i + 1 + page * 9} {(user.ToString())}",
|
$"#{i + 1 + page * 9} {(user.ToString())}",
|
||||||
$"{GetText("level_x", new LevelStats(users[i].TotalXp).Level)} - {users[i].TotalXp}xp");
|
$"{GetText(strs.level_x, new LevelStats(users[i].TotalXp).Level)} - {users[i].TotalXp}xp");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -377,21 +377,14 @@ namespace NadekoBot.Extensions
|
|||||||
return msg.Content.Headers.ContentLength / 1.MB();
|
return msg.Content.Headers.ContentLength / 1.MB();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetText(this IBotStrings strings, LocStr str, ulong? guildId = null)
|
public static string GetText(this IBotStrings strings, LocStr0 str, ulong? guildId = null)
|
||||||
=> strings.GetText(str.Key, guildId);
|
=> strings.GetText(str.Key, guildId);
|
||||||
|
public static string GetText(this IBotStrings strings, LocStr0 str, CultureInfo culture)
|
||||||
public static string GetText(this IBotStrings strings, LocStr str, CultureInfo culture)
|
=> strings.GetText(str.Key, culture);
|
||||||
|
|
||||||
|
public static string GetText(this IBotStrings strings, LocStr0 str, ulong? guildId = null)
|
||||||
|
=> strings.GetText(str.Key, guildId);
|
||||||
|
public static string GetText(this IBotStrings strings, LocStr0 str, CultureInfo culture)
|
||||||
=> strings.GetText(str.Key, culture);
|
=> strings.GetText(str.Key, culture);
|
||||||
|
|
||||||
public static string GetText<T>(this IBotStrings strings, LocStr<T> str, ulong? guildId, T obj1)
|
|
||||||
=> strings.GetText(str.Key, guildId, obj1);
|
|
||||||
|
|
||||||
public static string GetText<T>(this IBotStrings strings, LocStr<T> str, CultureInfo culture, T obj1)
|
|
||||||
=> strings.GetText(str.Key, culture, obj1);
|
|
||||||
|
|
||||||
public static string GetText<T1, T2>(this IBotStrings strings, LocStr<T1, T2> str, ulong? guildId, T1 obj1, T2 obj2)
|
|
||||||
=> strings.GetText(str.Key, guildId, obj1, obj2);
|
|
||||||
public static string GetText<T1, T2>(this IBotStrings strings, LocStr<T1, T2> str, CultureInfo culture, T1 obj1, T2 obj2)
|
|
||||||
=> strings.GetText(str.Key, culture, obj1, obj2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user