diff --git a/Program.cs b/Program.cs index 5239476..139c648 100644 --- a/Program.cs +++ b/Program.cs @@ -18,6 +18,7 @@ await bot.SetMyCommandsAsync(new[] { new BotCommand { Command = "yesno", Description = "Answes binary questions" }, new BotCommand { Command = "makedecision", Description = "Makes a decision. Expects a list of comma separated options." }, new BotCommand { Command = "choose", Description = "Chooses an item. Expects a list of comma separated options." }, + new BotCommand { Command = "spinbottle", Description = "Spins a bottle (for truth or dare). Expects a list of users participating separated by a space." }, new BotCommand { Command = "help", Description = "Lists all commands" }, }); @@ -27,6 +28,7 @@ var iBotCommands = new List { "yesno", "makedecision", "choose", + "spinbottle", "help", "start" }; @@ -133,6 +135,12 @@ async Task BotOnMessageReceived(ITelegramBotClient botClient, Message message) { options = new List { "Syntax error. (Can't select from zero options)" }; await botClient.SendTextMessageAsync(message.Chat.Id, RandomOption(options).Trim(), replyToMessageId: message.MessageId); break; + case "spinbottle": + var people = query?.Split(" ").Where(p => !string.IsNullOrWhiteSpace(p)).ToList(); + if (people == null || !people.Any()) + people = new List { "Syntax error. (Can't select from zero options)" }; + await botClient.SendTextMessageAsync(message.Chat.Id, RandomOption(people).Trim() + ", truth or dare?", replyToMessageId: message.MessageId); + break; case "help": case "start": await botClient.SendTextMessageAsync(message.Chat.Id, $"""