geekbot/Geekbot.net/Modules/Roll.cs

25 lines
785 B
C#
Raw Normal View History

2017-04-12 22:43:52 +02:00
using System;
using System.Threading.Tasks;
using Discord.Commands;
namespace Geekbot.net.Modules
{
public class Roll : ModuleBase
{
[Command("roll"), Summary("Roll a number between 1 and 100.")]
public async Task RollCommand()
{
var rnd = new Random();
var number = rnd.Next(1, 100);
await ReplyAsync(Context.Message.Author.Mention + ", you rolled " + number);
}
2017-04-17 16:58:48 +02:00
[Command("dice"), Summary("Roll a dice")]
public async Task DiceCommand([Summary("The highest number on the dice")] int max = 6)
2017-04-12 22:43:52 +02:00
{
var rnd = new Random();
2017-04-17 16:58:48 +02:00
var number = rnd.Next(1, max);
2017-04-12 22:43:52 +02:00
await ReplyAsync(Context.Message.Author.Mention + ", you rolled " + number);
}
}
}