Upgraded dicord.net

This commit is contained in:
Master Kwoth
2017-07-05 17:38:38 +02:00
parent 8f844d38d3
commit 269a4e3157
19 changed files with 38 additions and 32 deletions

View File

@ -109,7 +109,7 @@ namespace NadekoBot.Modules.Administration
{
try
{
await (await user.CreateDMChannelAsync()).EmbedAsync(new EmbedBuilder().WithErrorColor()
await (await user.GetOrCreateDMChannelAsync()).EmbedAsync(new EmbedBuilder().WithErrorColor()
.WithDescription(GetText("warned_on", Context.Guild.ToString()))
.AddField(efb => efb.WithName(GetText("moderator")).WithValue(Context.User.ToString()))
.AddField(efb => efb.WithName(GetText("reason")).WithValue(reason ?? "-")))

View File

@ -154,7 +154,7 @@ namespace NadekoBot.Modules.Gambling
}
try
{
await (await Context.User.CreateDMChannelAsync())
await (await Context.User.GetOrCreateDMChannelAsync())
.EmbedAsync(new EmbedBuilder().WithOkColor()
.WithTitle(GetText("shop_purchase", Context.Guild.Name))
.AddField(efb => efb.WithName(GetText("item")).WithValue(item.Text).WithIsInline(false))

View File

@ -96,7 +96,7 @@ namespace NadekoBot.Modules.Help
if (com == null)
{
IMessageChannel ch = channel is ITextChannel ? await ((IGuildUser)Context.User).CreateDMChannelAsync() : channel;
IMessageChannel ch = channel is ITextChannel ? await ((IGuildUser)Context.User).GetOrCreateDMChannelAsync() : channel;
await ch.SendMessageAsync(HelpString).ConfigureAwait(false);
return;
}

View File

@ -32,7 +32,7 @@ namespace NadekoBot.Modules
_log = LogManager.GetCurrentClassLogger();
}
protected override void BeforeExecute()
protected override void BeforeExecute(CommandInfo cmd)
{
_cultureInfo = _localization.GetCultureInfo(Context.Guild?.Id);
}

View File

@ -667,7 +667,7 @@ namespace NadekoBot.Modules.Searches
str += new NadekoRandom().Next();
foreach (var usr in allUsrsArray)
{
await (await usr.CreateDMChannelAsync()).SendConfirmAsync(str).ConfigureAwait(false);
await (await usr.GetOrCreateDMChannelAsync()).SendConfirmAsync(str).ConfigureAwait(false);
}
}