Adding Initial API support, updating readme
This commit is contained in:
parent
6732506dae
commit
92015d8880
27 changed files with 78 additions and 33 deletions
25
Geekbot.net/Commands/Choose.cs
Normal file
25
Geekbot.net/Commands/Choose.cs
Normal file
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Discord.Commands;
|
||||
|
||||
namespace Geekbot.net.Commands
|
||||
{
|
||||
public class Choose : ModuleBase
|
||||
{
|
||||
private readonly Random rnd;
|
||||
|
||||
public Choose(Random RandomClient)
|
||||
{
|
||||
rnd = RandomClient;
|
||||
}
|
||||
|
||||
[Command("choose", RunMode = RunMode.Async)]
|
||||
[Summary("Seperate options with a semicolon.")]
|
||||
public async Task Command([Remainder] [Summary("option1;option2")] string choices)
|
||||
{
|
||||
var choicesArray = choices.Split(';');
|
||||
var choice = rnd.Next(choicesArray.Length);
|
||||
await ReplyAsync($"I choose **{choicesArray[choice]}**");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue