diff --git a/src/NadekoBot/Modules/Administration/Commands/ServerGreetCommands.cs b/src/NadekoBot/Modules/Administration/Commands/ServerGreetCommands.cs index 6409e4c0..757ac1e6 100644 --- a/src/NadekoBot/Modules/Administration/Commands/ServerGreetCommands.cs +++ b/src/NadekoBot/Modules/Administration/Commands/ServerGreetCommands.cs @@ -43,7 +43,7 @@ namespace NadekoBot.Modules.Administration if (channel == null) //maybe warn the server owner that the channel is missing return; - var msg = conf.ChannelByeMessageText.Replace("%user%", user.Username).Replace("%server%", user.Guild.Name); + var msg = conf.ChannelByeMessageText.Replace("%user%", user.Mention).Replace("%server%", user.Guild.Name); if (string.IsNullOrWhiteSpace(msg)) return; try @@ -284,7 +284,7 @@ namespace NadekoBot.Modules.Administration if (string.IsNullOrWhiteSpace(text)) { - await channel.SendMessageAsync("`Current bye message:` " + conf.ChannelGreetMessageText.SanitizeMentions()); + await channel.SendMessageAsync("`Current bye message:` " + conf.ChannelByeMessageText.SanitizeMentions()); return; } await channel.SendMessageAsync("New bye message set.").ConfigureAwait(false); diff --git a/src/NadekoBot/Modules/Gambling/Commands/DrawCommand.cs b/src/NadekoBot/Modules/Gambling/Commands/DrawCommand.cs index 1de5650a..a5a20e6e 100644 --- a/src/NadekoBot/Modules/Gambling/Commands/DrawCommand.cs +++ b/src/NadekoBot/Modules/Gambling/Commands/DrawCommand.cs @@ -31,14 +31,13 @@ namespace NadekoBot.Modules.Gambling [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] - public async Task Draw(IUserMessage msg) + public async Task Draw(IUserMessage msg, int num = 1) { var channel = (ITextChannel)msg.Channel; var cards = AllDecks.GetOrAdd(channel.Guild, (s) => new Cards()); - - var num = 1; var images = new List(); var cardObjects = new List(); + if (num > 5) num = 5; for (var i = 0; i < num; i++) { if (cards.CardPool.Count == 0 && i != 0) @@ -48,17 +47,18 @@ namespace NadekoBot.Modules.Gambling } var currentCard = cards.DrawACard(); cardObjects.Add(currentCard); - using (var stream = File.OpenRead(Path.Combine(cardsPath, currentCard.GetName()))) + using (var stream = File.OpenRead(Path.Combine(cardsPath, currentCard.ToString().ToLowerInvariant()+ ".jpg").Replace(' ','_'))) images.Add(new Image(stream)); } MemoryStream bitmapStream = new MemoryStream(); images.Merge().SaveAsPng(bitmapStream); bitmapStream.Position = 0; - await channel.SendFileAsync(bitmapStream, images.Count + " cards.jpg", $"{msg.Author.Mention} drew (TODO: CARD NAMES HERE)").ConfigureAwait(false); + //todo CARD NAMES? + var toSend = $"{msg.Author.Mention}"; if (cardObjects.Count == 5) - { - await channel.SendMessageAsync($"{msg.Author.Mention} `{Cards.GetHandValue(cardObjects)}`").ConfigureAwait(false); - } + toSend += $" drew `{Cards.GetHandValue(cardObjects)}`"; + + await channel.SendFileAsync(bitmapStream, images.Count + " cards.jpg", toSend).ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases] diff --git a/src/NadekoBot/data/images/cards/8_of_clubs.jpg b/src/NadekoBot/data/images/cards/eight_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/8_of_clubs.jpg rename to src/NadekoBot/data/images/cards/eight_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/8_of_diamonds.jpg b/src/NadekoBot/data/images/cards/eight_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/8_of_diamonds.jpg rename to src/NadekoBot/data/images/cards/eight_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/8_of_hearts.jpg b/src/NadekoBot/data/images/cards/eight_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/8_of_hearts.jpg rename to src/NadekoBot/data/images/cards/eight_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/8_of_spades.jpg b/src/NadekoBot/data/images/cards/eight_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/8_of_spades.jpg rename to src/NadekoBot/data/images/cards/eight_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/5_of_clubs.jpg b/src/NadekoBot/data/images/cards/five_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/5_of_clubs.jpg rename to src/NadekoBot/data/images/cards/five_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/5_of_diamonds.jpg b/src/NadekoBot/data/images/cards/five_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/5_of_diamonds.jpg rename to src/NadekoBot/data/images/cards/five_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/5_of_hearts.jpg b/src/NadekoBot/data/images/cards/five_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/5_of_hearts.jpg rename to src/NadekoBot/data/images/cards/five_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/5_of_spades.jpg b/src/NadekoBot/data/images/cards/five_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/5_of_spades.jpg rename to src/NadekoBot/data/images/cards/five_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/4_of_clubs.jpg b/src/NadekoBot/data/images/cards/four_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/4_of_clubs.jpg rename to src/NadekoBot/data/images/cards/four_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/4_of_diamonds.jpg b/src/NadekoBot/data/images/cards/four_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/4_of_diamonds.jpg rename to src/NadekoBot/data/images/cards/four_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/4_of_hearts.jpg b/src/NadekoBot/data/images/cards/four_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/4_of_hearts.jpg rename to src/NadekoBot/data/images/cards/four_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/4_of_spades.jpg b/src/NadekoBot/data/images/cards/four_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/4_of_spades.jpg rename to src/NadekoBot/data/images/cards/four_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/9_of_clubs.jpg b/src/NadekoBot/data/images/cards/nine_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/9_of_clubs.jpg rename to src/NadekoBot/data/images/cards/nine_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/9_of_diamonds.jpg b/src/NadekoBot/data/images/cards/nine_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/9_of_diamonds.jpg rename to src/NadekoBot/data/images/cards/nine_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/9_of_hearts.jpg b/src/NadekoBot/data/images/cards/nine_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/9_of_hearts.jpg rename to src/NadekoBot/data/images/cards/nine_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/9_of_spades.jpg b/src/NadekoBot/data/images/cards/nine_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/9_of_spades.jpg rename to src/NadekoBot/data/images/cards/nine_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/7_of_clubs.jpg b/src/NadekoBot/data/images/cards/seven_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/7_of_clubs.jpg rename to src/NadekoBot/data/images/cards/seven_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/7_of_diamonds.jpg b/src/NadekoBot/data/images/cards/seven_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/7_of_diamonds.jpg rename to src/NadekoBot/data/images/cards/seven_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/7_of_hearts.jpg b/src/NadekoBot/data/images/cards/seven_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/7_of_hearts.jpg rename to src/NadekoBot/data/images/cards/seven_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/7_of_spades.jpg b/src/NadekoBot/data/images/cards/seven_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/7_of_spades.jpg rename to src/NadekoBot/data/images/cards/seven_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/6_of_clubs.jpg b/src/NadekoBot/data/images/cards/six_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/6_of_clubs.jpg rename to src/NadekoBot/data/images/cards/six_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/6_of_diamonds.jpg b/src/NadekoBot/data/images/cards/six_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/6_of_diamonds.jpg rename to src/NadekoBot/data/images/cards/six_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/6_of_hearts.jpg b/src/NadekoBot/data/images/cards/six_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/6_of_hearts.jpg rename to src/NadekoBot/data/images/cards/six_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/6_of_spades.jpg b/src/NadekoBot/data/images/cards/six_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/6_of_spades.jpg rename to src/NadekoBot/data/images/cards/six_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/10_of_clubs.jpg b/src/NadekoBot/data/images/cards/ten_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/10_of_clubs.jpg rename to src/NadekoBot/data/images/cards/ten_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/10_of_diamonds.jpg b/src/NadekoBot/data/images/cards/ten_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/10_of_diamonds.jpg rename to src/NadekoBot/data/images/cards/ten_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/10_of_hearts.jpg b/src/NadekoBot/data/images/cards/ten_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/10_of_hearts.jpg rename to src/NadekoBot/data/images/cards/ten_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/10_of_spades.jpg b/src/NadekoBot/data/images/cards/ten_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/10_of_spades.jpg rename to src/NadekoBot/data/images/cards/ten_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/3_of_clubs.jpg b/src/NadekoBot/data/images/cards/three_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/3_of_clubs.jpg rename to src/NadekoBot/data/images/cards/three_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/3_of_diamonds.jpg b/src/NadekoBot/data/images/cards/three_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/3_of_diamonds.jpg rename to src/NadekoBot/data/images/cards/three_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/3_of_hearts.jpg b/src/NadekoBot/data/images/cards/three_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/3_of_hearts.jpg rename to src/NadekoBot/data/images/cards/three_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/3_of_spades.jpg b/src/NadekoBot/data/images/cards/three_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/3_of_spades.jpg rename to src/NadekoBot/data/images/cards/three_of_spades.jpg diff --git a/src/NadekoBot/data/images/cards/2_of_clubs.jpg b/src/NadekoBot/data/images/cards/two_of_clubs.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/2_of_clubs.jpg rename to src/NadekoBot/data/images/cards/two_of_clubs.jpg diff --git a/src/NadekoBot/data/images/cards/2_of_diamonds.jpg b/src/NadekoBot/data/images/cards/two_of_diamonds.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/2_of_diamonds.jpg rename to src/NadekoBot/data/images/cards/two_of_diamonds.jpg diff --git a/src/NadekoBot/data/images/cards/2_of_hearts.jpg b/src/NadekoBot/data/images/cards/two_of_hearts.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/2_of_hearts.jpg rename to src/NadekoBot/data/images/cards/two_of_hearts.jpg diff --git a/src/NadekoBot/data/images/cards/2_of_spades.jpg b/src/NadekoBot/data/images/cards/two_of_spades.jpg similarity index 100% rename from src/NadekoBot/data/images/cards/2_of_spades.jpg rename to src/NadekoBot/data/images/cards/two_of_spades.jpg