Missing keys, .tesar should now swap roles
This commit is contained in:
parent
e4a62c4d5e
commit
1814936125
@ -170,11 +170,14 @@ namespace NadekoBot.Modules.Administration
|
|||||||
if (conf.ExclusiveSelfAssignedRoles)
|
if (conf.ExclusiveSelfAssignedRoles)
|
||||||
{
|
{
|
||||||
var sameRoleId = guildUser.RoleIds.FirstOrDefault(r => roles.Select(sar => sar.RoleId).Contains(r));
|
var sameRoleId = guildUser.RoleIds.FirstOrDefault(r => roles.Select(sar => sar.RoleId).Contains(r));
|
||||||
var sameRole = Context.Guild.GetRole(sameRoleId);
|
|
||||||
if (sameRoleId != default(ulong))
|
if (sameRoleId != default(ulong))
|
||||||
{
|
{
|
||||||
await ReplyErrorLocalized("self_assign_already_excl", Format.Bold(sameRole?.Name)).ConfigureAwait(false);
|
var sameRole = Context.Guild.GetRole(sameRoleId);
|
||||||
return;
|
if (sameRole != null)
|
||||||
|
await guildUser.RemoveRolesAsync(sameRole).ConfigureAwait(false);
|
||||||
|
//await ReplyErrorLocalized("self_assign_already_excl", Format.Bold(sameRole?.Name)).ConfigureAwait(false);
|
||||||
|
//return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
|
@ -6,7 +6,6 @@ using NadekoBot.Extensions;
|
|||||||
using NadekoBot.Modules.Searches.Models;
|
using NadekoBot.Modules.Searches.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace NadekoBot.Modules.Searches
|
namespace NadekoBot.Modules.Searches
|
||||||
@ -56,7 +55,7 @@ namespace NadekoBot.Modules.Searches
|
|||||||
.AddField(fb => fb.WithName(GetText("level")).WithValue($"{model.level}").WithIsInline(true))
|
.AddField(fb => fb.WithName(GetText("level")).WithValue($"{model.level}").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName(GetText("quick_wins")).WithValue($"{model.Games.Quick.wins}").WithIsInline(true))
|
.AddField(fb => fb.WithName(GetText("quick_wins")).WithValue($"{model.Games.Quick.wins}").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName(GetText("compet_wins")).WithValue($"{model.Games.Competitive.wins}").WithIsInline(true))
|
.AddField(fb => fb.WithName(GetText("compet_wins")).WithValue($"{model.Games.Competitive.wins}").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName(GetText("compet_losses")).WithValue($"{model.Games.Competitive.lost}").WithIsInline(true))
|
.AddField(fb => fb.WithName(GetText("compet_loses")).WithValue($"{model.Games.Competitive.lost}").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName(GetText("compet_played")).WithValue($"{model.Games.Competitive.played}").WithIsInline(true))
|
.AddField(fb => fb.WithName(GetText("compet_played")).WithValue($"{model.Games.Competitive.played}").WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName(GetText("compet_rank")).WithValue(rank).WithIsInline(true))
|
.AddField(fb => fb.WithName(GetText("compet_rank")).WithValue(rank).WithIsInline(true))
|
||||||
.AddField(fb => fb.WithName(GetText("compet_played")).WithValue($"{model.Playtime.competitive}").WithIsInline(true))
|
.AddField(fb => fb.WithName(GetText("compet_played")).WithValue($"{model.Playtime.competitive}").WithIsInline(true))
|
||||||
|
@ -2405,7 +2405,7 @@ namespace NadekoBot.Resources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to No users found..
|
/// Looks up a localized string similar to No user found..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string gambling_no_users_found {
|
public static string gambling_no_users_found {
|
||||||
get {
|
get {
|
||||||
|
@ -2225,7 +2225,7 @@ Owner ID: {2}</value>
|
|||||||
<value>Pick it up by typing `{0}pick`</value>
|
<value>Pick it up by typing `{0}pick`</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="gambling_no_users_found" xml:space="preserve">
|
<data name="gambling_no_users_found" xml:space="preserve">
|
||||||
<value>No users found.</value>
|
<value>No user found.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="gambling_page" xml:space="preserve">
|
<data name="gambling_page" xml:space="preserve">
|
||||||
<value>page {0}</value>
|
<value>page {0}</value>
|
||||||
|
Loading…
Reference in New Issue
Block a user