Not use old api
This commit is contained in:
parent
09dbdf83ad
commit
6cb0587a1b
@ -26,9 +26,9 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
if (count == 1)
|
if (count == 1)
|
||||||
{
|
{
|
||||||
if (rng.Next(0, 2) == 1)
|
if (rng.Next(0, 2) == 1)
|
||||||
await Context.Channel.SendFileAsync(headsPath, $"{Context.User.Mention} flipped " + Format.Code("Heads") + ".").ConfigureAwait(false);
|
await Context.Channel.SendFileAsync(File.Open(headsPath, FileMode.OpenOrCreate), $"{Context.User.Mention} flipped " + Format.Code("Heads") + ".").ConfigureAwait(false);
|
||||||
else
|
else
|
||||||
await Context.Channel.SendFileAsync(tailsPath, $"{Context.User.Mention} flipped " + Format.Code("Tails") + ".").ConfigureAwait(false);
|
await Context.Channel.SendFileAsync(File.Open(tailsPath, FileMode.OpenOrCreate), $"{Context.User.Mention} flipped " + Format.Code("Tails") + ".").ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (count > 10 || count < 1)
|
if (count > 10 || count < 1)
|
||||||
@ -93,7 +93,7 @@ namespace NadekoBot.Modules.Gambling
|
|||||||
str = $"{Context.User.Mention}`Better luck next time.`";
|
str = $"{Context.User.Mention}`Better luck next time.`";
|
||||||
}
|
}
|
||||||
|
|
||||||
await Context.Channel.SendFileAsync(imgPathToSend, str).ConfigureAwait(false);
|
await Context.Channel.SendFileAsync(File.Open(imgPathToSend, FileMode.OpenOrCreate), str).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ namespace NadekoBot.Modules.Games
|
|||||||
lastGenerations.AddOrUpdate(channel.Id, DateTime.Now, (id, old) => DateTime.Now);
|
lastGenerations.AddOrUpdate(channel.Id, DateTime.Now, (id, old) => DateTime.Now);
|
||||||
|
|
||||||
var sent = await channel.SendFileAsync(
|
var sent = await channel.SendFileAsync(
|
||||||
GetRandomCurrencyImagePath(),
|
File.Open(GetRandomCurrencyImagePath(), FileMode.OpenOrCreate),
|
||||||
$"❗ A random { Gambling.Gambling.CurrencyName } appeared! Pick it up by typing `{NadekoBot.ModulePrefixes[typeof(Games).Name]}pick`")
|
$"❗ A random { Gambling.Gambling.CurrencyName } appeared! Pick it up by typing `{NadekoBot.ModulePrefixes[typeof(Games).Name]}pick`")
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
plantedFlowers.AddOrUpdate(channel.Id, new List<IUserMessage>() { sent }, (id, old) => { old.Add(sent); return old; });
|
plantedFlowers.AddOrUpdate(channel.Id, new List<IUserMessage>() { sent }, (id, old) => { old.Add(sent); return old; });
|
||||||
@ -163,7 +163,7 @@ namespace NadekoBot.Modules.Games
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg = await Context.Channel.SendFileAsync(file, msgToSend).ConfigureAwait(false);
|
msg = await Context.Channel.SendFileAsync(File.Open(file, FileMode.OpenOrCreate), msgToSend).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
plantedFlowers.AddOrUpdate(Context.Channel.Id, new List<IUserMessage>() { msg }, (id, old) => { old.Add(msg); return old; });
|
plantedFlowers.AddOrUpdate(Context.Channel.Id, new List<IUserMessage>() { msg }, (id, old) => { old.Add(msg); return old; });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user