Fixed .setgame on sharded bots
This commit is contained in:
@@ -531,7 +531,7 @@ namespace NadekoBot.Modules.Administration
|
||||
if (string.IsNullOrWhiteSpace(newName))
|
||||
return;
|
||||
|
||||
await NadekoBot.Client.GetCurrentUser().ModifyAsync(u => u.Username = newName).ConfigureAwait(false);
|
||||
await (await NadekoBot.Client.GetCurrentUserAsync()).ModifyAsync(u => u.Username = newName).ConfigureAwait(false);
|
||||
|
||||
await channel.SendMessageAsync($"Successfully changed name to {newName}").ConfigureAwait(false);
|
||||
}
|
||||
@@ -554,7 +554,7 @@ namespace NadekoBot.Modules.Administration
|
||||
await sr.CopyToAsync(imgStream);
|
||||
imgStream.Position = 0;
|
||||
|
||||
await NadekoBot.Client.GetCurrentUser().ModifyAsync(u => u.Avatar = imgStream).ConfigureAwait(false);
|
||||
await (await NadekoBot.Client.GetCurrentUserAsync().ConfigureAwait(false)).ModifyAsync(u => u.Avatar = imgStream).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -52,10 +52,9 @@ namespace NadekoBot.Modules.Administration
|
||||
if (string.IsNullOrWhiteSpace(status))
|
||||
continue;
|
||||
PlayingPlaceholders.ForEach(e => status = status.Replace(e.Key, e.Value()));
|
||||
await NadekoBot.Client
|
||||
.GetCurrentUser()
|
||||
.ModifyStatusAsync(mpp => mpp.Game = new Game(status))
|
||||
.ConfigureAwait(false);
|
||||
await (await NadekoBot.Client.GetCurrentUserAsync())
|
||||
.ModifyStatusAsync(mpp => mpp.Game = new Game(status))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@@ -14,7 +14,7 @@ namespace NadekoBot.Modules.CustomReactions
|
||||
{
|
||||
public static Dictionary<string, Func<IUserMessage, string>> placeholders = new Dictionary<string, Func<IUserMessage, string>>()
|
||||
{
|
||||
{"%mention%", (ctx) => { return $"<@{NadekoBot.Client.GetCurrentUser().Id}>"; } },
|
||||
{"%mention%", (ctx) => { return $"<@{NadekoBot.Client.GetCurrentUserAsync().Id}>"; } },
|
||||
{"%user%", (ctx) => { return ctx.Author.Mention; } },
|
||||
{"%target%", (ctx) => { return ctx.MentionedUsers.Shuffle().FirstOrDefault()?.Mention ?? "Nobody"; } },
|
||||
{"%rng%", (ctx) => { return new NadekoRandom().Next(0,10).ToString(); } }
|
||||
|
Reference in New Issue
Block a user