Fixed .setgame on sharded bots

This commit is contained in:
Kwoth
2016-10-14 08:21:45 +02:00
parent ff663c4331
commit 889050b8ae
6 changed files with 15 additions and 13 deletions

View File

@@ -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);
}
}

View File

@@ -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)

View File

@@ -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(); } }