Command Categories (more or less)
This commit is contained in:
parent
f30c136785
commit
58ba2980f9
29 changed files with 97 additions and 17 deletions
|
@ -30,6 +30,7 @@ namespace Geekbot.net.Commands
|
||||||
|
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[RequireUserPermission(GuildPermission.Administrator)]
|
||||||
[Command("welcome", RunMode = RunMode.Async)]
|
[Command("welcome", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Admin)]
|
||||||
[Summary("Set a Welcome Message (use '$user' to mention the new joined user).")]
|
[Summary("Set a Welcome Message (use '$user' to mention the new joined user).")]
|
||||||
public async Task SetWelcomeMessage([Remainder] [Summary("message")] string welcomeMessage)
|
public async Task SetWelcomeMessage([Remainder] [Summary("message")] string welcomeMessage)
|
||||||
{
|
{
|
||||||
|
@ -40,6 +41,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("youtubekey", RunMode = RunMode.Async)]
|
[Command("youtubekey", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Admin)]
|
||||||
[Summary("Set the youtube api key")]
|
[Summary("Set the youtube api key")]
|
||||||
public async Task SetYoutubeKey([Summary("API Key")] string key)
|
public async Task SetYoutubeKey([Summary("API Key")] string key)
|
||||||
{
|
{
|
||||||
|
@ -55,6 +57,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("game", RunMode = RunMode.Async)]
|
[Command("game", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Admin)]
|
||||||
[Summary("Set the game that the bot is playing")]
|
[Summary("Set the game that the bot is playing")]
|
||||||
public async Task SetGame([Remainder] [Summary("Game")] string key)
|
public async Task SetGame([Remainder] [Summary("Game")] string key)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +75,8 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("popuserrepo", RunMode = RunMode.Async)]
|
[Command("popuserrepo", RunMode = RunMode.Async)]
|
||||||
[Summary("Set the game that the bot is playing")]
|
[Remarks(CommandCategories.Admin)]
|
||||||
|
[Summary("Populate user cache")]
|
||||||
public async Task popUserRepoCommand()
|
public async Task popUserRepoCommand()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -117,7 +121,8 @@ namespace Geekbot.net.Commands
|
||||||
|
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[RequireUserPermission(GuildPermission.Administrator)]
|
||||||
[Command("modchannel", RunMode = RunMode.Async)]
|
[Command("modchannel", RunMode = RunMode.Async)]
|
||||||
[Summary("Set the game that the bot is playing")]
|
[Remarks(CommandCategories.Admin)]
|
||||||
|
[Summary("Set a channel for moderation purposes")]
|
||||||
public async Task selectModChannel([Summary("ChannelId")] ulong channelId)
|
public async Task selectModChannel([Summary("ChannelId")] ulong channelId)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -143,6 +148,7 @@ namespace Geekbot.net.Commands
|
||||||
|
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[RequireUserPermission(GuildPermission.Administrator)]
|
||||||
[Command("showleave", RunMode = RunMode.Async)]
|
[Command("showleave", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Admin)]
|
||||||
[Summary("Notify modchannel when someone leaves")]
|
[Summary("Notify modchannel when someone leaves")]
|
||||||
public async Task showLeave([Summary("true/false")] bool enabled)
|
public async Task showLeave([Summary("true/false")] bool enabled)
|
||||||
{
|
{
|
||||||
|
@ -169,7 +175,8 @@ namespace Geekbot.net.Commands
|
||||||
|
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[RequireUserPermission(GuildPermission.Administrator)]
|
||||||
[Command("showdel", RunMode = RunMode.Async)]
|
[Command("showdel", RunMode = RunMode.Async)]
|
||||||
[Summary("Notify modchannel when someone leaves")]
|
[Remarks(CommandCategories.Admin)]
|
||||||
|
[Summary("Notify modchannel when someone deletes a message")]
|
||||||
public async Task showDelete([Summary("true/false")] bool enabled)
|
public async Task showDelete([Summary("true/false")] bool enabled)
|
||||||
{
|
{
|
||||||
var modChannelId = (ulong)_redis.HashGet($"{Context.Guild.Id}:Settings", "ModChannel");
|
var modChannelId = (ulong)_redis.HashGet($"{Context.Guild.Id}:Settings", "ModChannel");
|
||||||
|
|
|
@ -21,6 +21,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command(RunMode = RunMode.Async)]
|
[Command(RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Games)]
|
||||||
[Summary("Get your battletag")]
|
[Summary("Get your battletag")]
|
||||||
public async Task BattleTagCmd()
|
public async Task BattleTagCmd()
|
||||||
{
|
{
|
||||||
|
@ -44,6 +45,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command(RunMode = RunMode.Async)]
|
[Command(RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Games)]
|
||||||
[Summary("Save your battletag")]
|
[Summary("Save your battletag")]
|
||||||
public async Task BattleTagCmd([Summary("Battletag")] string tag)
|
public async Task BattleTagCmd([Summary("Battletag")] string tag)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
|
@ -9,6 +10,7 @@ namespace Geekbot.net.Commands
|
||||||
public class Cat : ModuleBase
|
public class Cat : ModuleBase
|
||||||
{
|
{
|
||||||
[Command("cat", RunMode = RunMode.Async)]
|
[Command("cat", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Return a random image of a cat.")]
|
[Summary("Return a random image of a cat.")]
|
||||||
public async Task Say()
|
public async Task Say()
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("checkem", RunMode = RunMode.Async)]
|
[Command("checkem", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Check for dubs")]
|
[Summary("Check for dubs")]
|
||||||
public async Task MuhDubs()
|
public async Task MuhDubs()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
{
|
{
|
||||||
|
@ -14,7 +15,8 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("choose", RunMode = RunMode.Async)]
|
[Command("choose", RunMode = RunMode.Async)]
|
||||||
[Summary("Seperate options with a semicolon.")]
|
[Remarks(CommandCategories.Helpers)]
|
||||||
|
[Summary("Let the bot choose for you, seperate options with a semicolon.")]
|
||||||
public async Task Command([Remainder] [Summary("option1;option2")] string choices)
|
public async Task Command([Remainder] [Summary("option1;option2")] string choices)
|
||||||
{
|
{
|
||||||
var choicesArray = choices.Split(';');
|
var choicesArray = choices.Split(';');
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("good", RunMode = RunMode.Async)]
|
[Command("good", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Karma)]
|
||||||
[Summary("Increase Someones Karma")]
|
[Summary("Increase Someones Karma")]
|
||||||
public async Task Good([Summary("@someone")] IUser user)
|
public async Task Good([Summary("@someone")] IUser user)
|
||||||
{
|
{
|
||||||
|
@ -64,6 +65,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("bad", RunMode = RunMode.Async)]
|
[Command("bad", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Karma)]
|
||||||
[Summary("Decrease Someones Karma")]
|
[Summary("Decrease Someones Karma")]
|
||||||
public async Task Bad([Summary("@someone")] IUser user)
|
public async Task Bad([Summary("@someone")] IUser user)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
{
|
{
|
||||||
|
@ -17,6 +18,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("dice", RunMode = RunMode.Async)]
|
[Command("dice", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Roll a dice.")]
|
[Summary("Roll a dice.")]
|
||||||
public async Task RollCommand([Remainder] [Summary("diceType")] string diceType = "1d20")
|
public async Task RollCommand([Remainder] [Summary("diceType")] string diceType = "1d20")
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
|
@ -9,6 +10,7 @@ namespace Geekbot.net.Commands
|
||||||
public class Dog : ModuleBase
|
public class Dog : ModuleBase
|
||||||
{
|
{
|
||||||
[Command("dog", RunMode = RunMode.Async)]
|
[Command("dog", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Return a random image of a dog.")]
|
[Summary("Return a random image of a dog.")]
|
||||||
public async Task Say()
|
public async Task Say()
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
{
|
{
|
||||||
|
@ -15,6 +16,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("8ball", RunMode = RunMode.Async)]
|
[Command("8ball", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Ask 8Ball a Question.")]
|
[Summary("Ask 8Ball a Question.")]
|
||||||
public async Task Ball([Remainder] [Summary("Question")] string echo)
|
public async Task Ball([Remainder] [Summary("Question")] string echo)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.Media;
|
using Geekbot.net.Lib.Media;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
|
@ -14,6 +15,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("fortune", RunMode = RunMode.Async)]
|
[Command("fortune", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Get a random fortune")]
|
[Summary("Get a random fortune")]
|
||||||
public async Task GetAFortune()
|
public async Task GetAFortune()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
{
|
{
|
||||||
public class Google : ModuleBase
|
public class Google : ModuleBase
|
||||||
{
|
{
|
||||||
[Command("google", RunMode = RunMode.Async)]
|
[Command("google", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Fun)]
|
||||||
[Summary("Google Something.")]
|
[Summary("Google Something.")]
|
||||||
public async Task Eyes([Remainder, Summary("SearchText")] string searchText)
|
public async Task Eyes([Remainder, Summary("SearchText")] string searchText)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("serverstats", RunMode = RunMode.Async)]
|
[Command("serverstats", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Statistics)]
|
||||||
[Summary("Show some info about the bot.")]
|
[Summary("Show some info about the bot.")]
|
||||||
public async Task getInfo()
|
public async Task getInfo()
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,6 +19,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("help", RunMode = RunMode.Async)]
|
[Command("help", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Helpers)]
|
||||||
[Summary("List all Commands")]
|
[Summary("List all Commands")]
|
||||||
public async Task GetHelp()
|
public async Task GetHelp()
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("info", RunMode = RunMode.Async)]
|
[Command("info", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Helpers)]
|
||||||
[Summary("Get Information about the bot")]
|
[Summary("Get Information about the bot")]
|
||||||
public async Task BotInfo()
|
public async Task BotInfo()
|
||||||
{
|
{
|
||||||
|
@ -51,6 +52,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("uptime", RunMode = RunMode.Async)]
|
[Command("uptime", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Helpers)]
|
||||||
[Summary("Get the Bot Uptime")]
|
[Summary("Get the Bot Uptime")]
|
||||||
public async Task BotUptime()
|
public async Task BotUptime()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
{
|
{
|
||||||
|
@ -7,6 +8,7 @@ namespace Geekbot.net.Commands
|
||||||
{
|
{
|
||||||
[Command("👀", RunMode = RunMode.Async)]
|
[Command("👀", RunMode = RunMode.Async)]
|
||||||
[Summary("Look at the bot.")]
|
[Summary("Look at the bot.")]
|
||||||
|
[Remarks(CommandCategories.Fun)]
|
||||||
public async Task Eyes()
|
public async Task Eyes()
|
||||||
{
|
{
|
||||||
await ReplyAsync("S... Stop looking at me... baka!");
|
await ReplyAsync("S... Stop looking at me... baka!");
|
||||||
|
|
|
@ -19,6 +19,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("pokedex", RunMode = RunMode.Async)]
|
[Command("pokedex", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Helpers)]
|
||||||
[Summary("A Pokedex Tool")]
|
[Summary("A Pokedex Tool")]
|
||||||
public async Task GetPokemon([Summary("pokemonName")] string pokemonName)
|
public async Task GetPokemon([Summary("pokemonName")] string pokemonName)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,6 +26,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command()]
|
[Command()]
|
||||||
|
[Remarks(CommandCategories.Quotes)]
|
||||||
[Summary("Return a random quoute from the database")]
|
[Summary("Return a random quoute from the database")]
|
||||||
public async Task getRandomQuote()
|
public async Task getRandomQuote()
|
||||||
{
|
{
|
||||||
|
@ -43,6 +44,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("save")]
|
[Command("save")]
|
||||||
|
[Remarks(CommandCategories.Quotes)]
|
||||||
[Summary("Save a quote from the last sent message by @user")]
|
[Summary("Save a quote from the last sent message by @user")]
|
||||||
public async Task saveQuote([Summary("@user")] IUser user)
|
public async Task saveQuote([Summary("@user")] IUser user)
|
||||||
{
|
{
|
||||||
|
@ -67,6 +69,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("save")]
|
[Command("save")]
|
||||||
|
[Remarks(CommandCategories.Quotes)]
|
||||||
[Summary("Save a quote from a message id")]
|
[Summary("Save a quote from a message id")]
|
||||||
public async Task saveQuote([Summary("messageId")] ulong messageId)
|
public async Task saveQuote([Summary("messageId")] ulong messageId)
|
||||||
{
|
{
|
||||||
|
@ -92,6 +95,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("make")]
|
[Command("make")]
|
||||||
|
[Remarks(CommandCategories.Quotes)]
|
||||||
[Summary("Create a quote from the last sent message by @user")]
|
[Summary("Create a quote from the last sent message by @user")]
|
||||||
public async Task returnSpecifiedQuote([Summary("@user")] IUser user)
|
public async Task returnSpecifiedQuote([Summary("@user")] IUser user)
|
||||||
{
|
{
|
||||||
|
@ -109,6 +113,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("make")]
|
[Command("make")]
|
||||||
|
[Remarks(CommandCategories.Quotes)]
|
||||||
[Summary("Create a quote from a message id")]
|
[Summary("Create a quote from a message id")]
|
||||||
public async Task returnSpecifiedQuote([Summary("messageId")] ulong messageId)
|
public async Task returnSpecifiedQuote([Summary("messageId")] ulong messageId)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.Media;
|
using Geekbot.net.Lib.Media;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
|
@ -14,6 +15,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("panda", RunMode = RunMode.Async)]
|
[Command("panda", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Get a random panda image")]
|
[Summary("Get a random panda image")]
|
||||||
public async Task panda()
|
public async Task panda()
|
||||||
{
|
{
|
||||||
|
@ -22,6 +24,7 @@ namespace Geekbot.net.Commands
|
||||||
|
|
||||||
[Command("croissant", RunMode = RunMode.Async)]
|
[Command("croissant", RunMode = RunMode.Async)]
|
||||||
[Alias("gipfeli")]
|
[Alias("gipfeli")]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Get a random croissant image")]
|
[Summary("Get a random croissant image")]
|
||||||
public async Task croissant()
|
public async Task croissant()
|
||||||
{
|
{
|
||||||
|
@ -29,6 +32,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("pumpkin", RunMode = RunMode.Async)]
|
[Command("pumpkin", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Get a random pumpkin image")]
|
[Summary("Get a random pumpkin image")]
|
||||||
public async Task pumpkin()
|
public async Task pumpkin()
|
||||||
{
|
{
|
||||||
|
@ -36,6 +40,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("squirrel", RunMode = RunMode.Async)]
|
[Command("squirrel", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Get a random squirrel image")]
|
[Summary("Get a random squirrel image")]
|
||||||
public async Task squirrel()
|
public async Task squirrel()
|
||||||
{
|
{
|
||||||
|
@ -43,6 +48,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("turtle", RunMode = RunMode.Async)]
|
[Command("turtle", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Randomness)]
|
||||||
[Summary("Get a random turtle image")]
|
[Summary("Get a random turtle image")]
|
||||||
public async Task turtle()
|
public async Task turtle()
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,6 +27,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("rank", RunMode = RunMode.Async)]
|
[Command("rank", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Statistics)]
|
||||||
[Summary("get user top 10")]
|
[Summary("get user top 10")]
|
||||||
public async Task RankCmd()
|
public async Task RankCmd()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
|
@ -17,8 +18,9 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("roll", RunMode = RunMode.Async)]
|
[Command("roll", RunMode = RunMode.Async)]
|
||||||
[Summary("Roll a number between 1 and 100.")]
|
[Remarks(CommandCategories.Fun)]
|
||||||
public async Task RollCommand([Remainder] [Summary("stuff...")] string stuff = "nothing")
|
[Summary("Guess which number the bot will roll (1-100")]
|
||||||
|
public async Task RollCommand([Remainder] [Summary("guess")] string stuff = "noGuess")
|
||||||
{
|
{
|
||||||
var number = rnd.Next(1, 100);
|
var number = rnd.Next(1, 100);
|
||||||
var guess = 1000;
|
var guess = 1000;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord;
|
using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
{
|
{
|
||||||
|
@ -8,6 +9,7 @@ namespace Geekbot.net.Commands
|
||||||
{
|
{
|
||||||
[RequireUserPermission(GuildPermission.Administrator)]
|
[RequireUserPermission(GuildPermission.Administrator)]
|
||||||
[Command("say", RunMode = RunMode.Async)]
|
[Command("say", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Admin)]
|
||||||
[Summary("Say Something.")]
|
[Summary("Say Something.")]
|
||||||
public async Task Echo([Remainder] [Summary("What?")] string echo)
|
public async Task Echo([Remainder] [Summary("What?")] string echo)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord;
|
using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands
|
namespace Geekbot.net.Commands
|
||||||
|
@ -18,6 +19,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("Ship", RunMode = RunMode.Async)]
|
[Command("Ship", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Fun)]
|
||||||
[Summary("Ask the Shipping meter")]
|
[Summary("Ask the Shipping meter")]
|
||||||
public async Task Command([Summary("@User1")] IUser user1, [Summary("@User2")] IUser user2)
|
public async Task Command([Summary("@User1")] IUser user1, [Summary("@User2")] IUser user2)
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,6 +19,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("stats", RunMode = RunMode.Async)]
|
[Command("stats", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Statistics)]
|
||||||
[Summary("Get information about this user")]
|
[Summary("Get information about this user")]
|
||||||
public async Task User([Summary("@someone")] IUser user = null)
|
public async Task User([Summary("@someone")] IUser user = null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
|
using Geekbot.net.Lib;
|
||||||
using Google.Apis.Services;
|
using Google.Apis.Services;
|
||||||
using Google.Apis.YouTube.v3;
|
using Google.Apis.YouTube.v3;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
@ -17,6 +18,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("yt", RunMode = RunMode.Async)]
|
[Command("yt", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Helpers)]
|
||||||
[Summary("Search for something on youtube.")]
|
[Summary("Search for something on youtube.")]
|
||||||
public async Task Yt([Remainder] [Summary("Title")] string searchQuery)
|
public async Task Yt([Remainder] [Summary("Title")] string searchQuery)
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("anime", RunMode = RunMode.Async)]
|
[Command("anime", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Helpers)]
|
||||||
[Summary("Show Info about an Anime.")]
|
[Summary("Show Info about an Anime.")]
|
||||||
public async Task searchAnime([Remainder, Summary("AnimeName")] string animeName)
|
public async Task searchAnime([Remainder, Summary("AnimeName")] string animeName)
|
||||||
{
|
{
|
||||||
|
@ -66,6 +67,7 @@ namespace Geekbot.net.Commands
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("manga", RunMode = RunMode.Async)]
|
[Command("manga", RunMode = RunMode.Async)]
|
||||||
|
[Remarks(CommandCategories.Helpers)]
|
||||||
[Summary("Show Info about a Manga.")]
|
[Summary("Show Info about a Manga.")]
|
||||||
public async Task searchManga([Remainder, Summary("MangaName")] string mangaName)
|
public async Task searchManga([Remainder, Summary("MangaName")] string mangaName)
|
||||||
{
|
{
|
||||||
|
|
15
Geekbot.net/Lib/CommandCategories.cs
Normal file
15
Geekbot.net/Lib/CommandCategories.cs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
namespace Geekbot.net.Lib
|
||||||
|
{
|
||||||
|
public class CommandCategories
|
||||||
|
{
|
||||||
|
public const string Randomness = "Randomness";
|
||||||
|
public const string Karma = "Karma";
|
||||||
|
public const string Quotes = "Quotes";
|
||||||
|
public const string Fun = "Fun";
|
||||||
|
public const string Statistics = "Statistics";
|
||||||
|
public const string Helpers = "Helpers";
|
||||||
|
public const string Games = "Games";
|
||||||
|
public const string Admin = "Admin";
|
||||||
|
public const string Uncategorized = "Uncategorized";
|
||||||
|
}
|
||||||
|
}
|
|
@ -105,16 +105,16 @@ namespace Geekbot.net
|
||||||
|
|
||||||
userRepository = new UserRepository(redis, logger);
|
userRepository = new UserRepository(redis, logger);
|
||||||
var errorHandler = new ErrorHandler(logger);
|
var errorHandler = new ErrorHandler(logger);
|
||||||
var RandomClient = new Random();
|
var randomClient = new Random();
|
||||||
var fortunes = new FortunesProvider(RandomClient, logger);
|
var fortunes = new FortunesProvider(randomClient, logger);
|
||||||
var mediaProvider = new MediaProvider(RandomClient, logger);
|
var mediaProvider = new MediaProvider(randomClient, logger);
|
||||||
var malClient = new MalClient(redis, logger);
|
var malClient = new MalClient(redis, logger);
|
||||||
|
|
||||||
services.AddSingleton<IErrorHandler>(errorHandler);
|
services.AddSingleton<IErrorHandler>(errorHandler);
|
||||||
services.AddSingleton(redis);
|
services.AddSingleton(redis);
|
||||||
services.AddSingleton<ILogger>(logger);
|
services.AddSingleton<ILogger>(logger);
|
||||||
services.AddSingleton<IUserRepository>(userRepository);
|
services.AddSingleton<IUserRepository>(userRepository);
|
||||||
services.AddSingleton(RandomClient);
|
services.AddSingleton(randomClient);
|
||||||
services.AddSingleton<IFortunesProvider>(fortunes);
|
services.AddSingleton<IFortunesProvider>(fortunes);
|
||||||
services.AddSingleton<IMediaProvider>(mediaProvider);
|
services.AddSingleton<IMediaProvider>(mediaProvider);
|
||||||
services.AddSingleton<IMalClient>(malClient);
|
services.AddSingleton<IMalClient>(malClient);
|
||||||
|
@ -162,10 +162,7 @@ namespace Geekbot.net
|
||||||
}
|
}
|
||||||
if (!args.Contains("--disable-api"))
|
if (!args.Contains("--disable-api"))
|
||||||
{
|
{
|
||||||
logger.Information("[API] Starting Webserver");
|
startWebApi();
|
||||||
var webApiUrl = new Uri("http://localhost:12995");
|
|
||||||
new NancyHost(webApiUrl).Start();
|
|
||||||
logger.Information($"[API] Webserver now running on {webApiUrl}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Information("[Geekbot] Done and ready for use\n");
|
logger.Information("[Geekbot] Done and ready for use\n");
|
||||||
|
@ -185,6 +182,14 @@ namespace Geekbot.net
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async Task startWebApi()
|
||||||
|
{
|
||||||
|
logger.Information("[API] Starting Webserver");
|
||||||
|
var webApiUrl = new Uri("http://localhost:12995");
|
||||||
|
new NancyHost(webApiUrl).Start();
|
||||||
|
logger.Information($"[API] Webserver now running on {webApiUrl}");
|
||||||
|
}
|
||||||
|
|
||||||
private async Task<Task> FinishSetup()
|
private async Task<Task> FinishSetup()
|
||||||
{
|
{
|
||||||
var appInfo = await client.GetApplicationInfoAsync();
|
var appInfo = await client.GetApplicationInfoAsync();
|
||||||
|
|
|
@ -38,6 +38,7 @@ namespace Geekbot.net.WebApi
|
||||||
{
|
{
|
||||||
Name = cmd.Name,
|
Name = cmd.Name,
|
||||||
Summary = cmd.Summary,
|
Summary = cmd.Summary,
|
||||||
|
Category = cmd.Remarks ?? CommandCategories.Uncategorized,
|
||||||
IsAdminCommand = (param.Contains("admin")),
|
IsAdminCommand = (param.Contains("admin")),
|
||||||
Aliases = cmd.Aliases.ToArray(),
|
Aliases = cmd.Aliases.ToArray(),
|
||||||
Params = cmdParamsObj
|
Params = cmdParamsObj
|
||||||
|
@ -60,6 +61,7 @@ namespace Geekbot.net.WebApi
|
||||||
public class CommandDto
|
public class CommandDto
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
public string Category { get; set; }
|
||||||
public string Summary { get; set; }
|
public string Summary { get; set; }
|
||||||
public bool IsAdminCommand { get; set; }
|
public bool IsAdminCommand { get; set; }
|
||||||
public Array Aliases { get; set; }
|
public Array Aliases { get; set; }
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using Nancy;
|
using System;
|
||||||
|
using Nancy;
|
||||||
using Nancy.Bootstrapper;
|
using Nancy.Bootstrapper;
|
||||||
using Nancy.TinyIoc;
|
using Nancy.TinyIoc;
|
||||||
|
|
||||||
|
@ -13,8 +14,9 @@ namespace Geekbot.net.WebApi
|
||||||
pipelines.AfterRequest.AddItemToEndOfPipeline((ctx) =>
|
pipelines.AfterRequest.AddItemToEndOfPipeline((ctx) =>
|
||||||
{
|
{
|
||||||
ctx.Response.WithHeader("Access-Control-Allow-Origin", "*")
|
ctx.Response.WithHeader("Access-Control-Allow-Origin", "*")
|
||||||
.WithHeader("Access-Control-Allow-Methods", "POST,GET")
|
.WithHeader("Access-Control-Allow-Methods", "GET")
|
||||||
.WithHeader("Access-Control-Allow-Headers", "Accept, Origin, Content-type");
|
.WithHeader("Access-Control-Allow-Headers", "Accept, Origin, Content-type")
|
||||||
|
.WithHeader("Last-Modified", DateTime.Now.ToString());
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue