started moving prefixes to a field

This commit is contained in:
Master Kwoth 2016-03-06 09:56:17 +01:00
parent cdf90a15be
commit c75676e7f5
5 changed files with 95 additions and 78 deletions

View File

@ -16,8 +16,8 @@ namespace NadekoBot.Commands {
public static Dictionary<string, Func<string>> PlayingPlaceholders { get; } = public static Dictionary<string, Func<string>> PlayingPlaceholders { get; } =
new Dictionary<string, Func<string>> { new Dictionary<string, Func<string>> {
{"%servers%", () => NadekoBot.Client.Servers.Count().ToString()}, {"%servers%", () => NadekoBot.Client.Servers.Count().ToString()},
{"%users%", () => NadekoBot.Client.Servers.SelectMany(s => s.Users).Count().ToString()}, { {"%users%", () => NadekoBot.Client.Servers.SelectMany(s => s.Users).Count().ToString()},
"%playing%", () => { {"%playing%", () => {
var cnt = Music.MusicPlayers.Count(kvp => kvp.Value.CurrentSong != null); var cnt = Music.MusicPlayers.Count(kvp => kvp.Value.CurrentSong != null);
if (cnt != 1) return cnt.ToString(); if (cnt != 1) return cnt.ToString();
try { try {
@ -55,8 +55,7 @@ namespace NadekoBot.Commands {
if (string.IsNullOrWhiteSpace(status)) if (string.IsNullOrWhiteSpace(status))
return; return;
Task.Run(() => { NadekoBot.Client.SetGame(status); }); Task.Run(() => { NadekoBot.Client.SetGame(status); });
} } catch { }
catch {}
}; };
} }
@ -88,7 +87,7 @@ namespace NadekoBot.Commands {
lock (playingPlaceholderLock) { lock (playingPlaceholderLock) {
rotatingStatuses.Add(arg); rotatingStatuses.Add(arg);
} }
await e.Channel.SendMessage("🆗 `Added a new paying string.`"); await e.Channel.SendMessage("🆗 `Added a new playing string.`");
}); });
cgb.CreateCommand(".listplaying") cgb.CreateCommand(".listplaying")

View File

@ -32,7 +32,7 @@ namespace NadekoBot.Modules {
commands.ForEach(cmd => cmd.Init(cgb)); commands.ForEach(cmd => cmd.Init(cgb));
cgb.CreateCommand(".sr").Alias(".setrole") cgb.CreateCommand(Prefix + "sr").Alias(Prefix + "setrole")
.Description("Sets a role for a given user.\n**Usage**: .sr @User Guest") .Description("Sets a role for a given user.\n**Usage**: .sr @User Guest")
.Parameter("user_name", ParameterType.Required) .Parameter("user_name", ParameterType.Required)
.Parameter("role_name", ParameterType.Unparsed) .Parameter("role_name", ParameterType.Unparsed)
@ -68,7 +68,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".rr").Alias(".removerole") cgb.CreateCommand(Prefix + "rr").Alias(Prefix + "removerole")
.Description("Removes a role from a given user.\n**Usage**: .rr @User Admin") .Description("Removes a role from a given user.\n**Usage**: .rr @User Admin")
.Parameter("user_name", ParameterType.Required) .Parameter("user_name", ParameterType.Required)
.Parameter("role_name", ParameterType.Unparsed) .Parameter("role_name", ParameterType.Unparsed)
@ -99,7 +99,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".r").Alias(".role").Alias(".cr") cgb.CreateCommand(Prefix + "r").Alias(Prefix + "role").Alias(Prefix + "cr")
.Description("Creates a role with a given name.**Usage**: .r Awesome Role") .Description("Creates a role with a given name.**Usage**: .r Awesome Role")
.Parameter("role_name", ParameterType.Unparsed) .Parameter("role_name", ParameterType.Unparsed)
.AddCheck(SimpleCheckers.CanManageRoles) .AddCheck(SimpleCheckers.CanManageRoles)
@ -114,7 +114,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".rolecolor").Alias(".rc") cgb.CreateCommand(Prefix + "rolecolor").Alias(Prefix + "rc")
.Parameter("role_name", ParameterType.Required) .Parameter("role_name", ParameterType.Required)
.Parameter("r", ParameterType.Optional) .Parameter("r", ParameterType.Optional)
.Parameter("g", ParameterType.Optional) .Parameter("g", ParameterType.Optional)
@ -153,7 +153,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".roles") cgb.CreateCommand(Prefix + "roles")
.Description("List all roles on this server or a single user if specified.") .Description("List all roles on this server or a single user if specified.")
.Parameter("user", ParameterType.Unparsed) .Parameter("user", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -167,7 +167,7 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage("`List of roles:` \n• " + string.Join("\n• ", e.Server.Roles)); await e.Channel.SendMessage("`List of roles:` \n• " + string.Join("\n• ", e.Server.Roles));
}); });
cgb.CreateCommand(".b").Alias(".ban") cgb.CreateCommand(Prefix + "b").Alias(Prefix + "ban")
.Parameter("user", ParameterType.Required) .Parameter("user", ParameterType.Required)
.Parameter("msg", ParameterType.Optional) .Parameter("msg", ParameterType.Optional)
.Description("Bans a user by id or name with an optional message.\n**Usage**: .b \"@some Guy\" Your behaviour is toxic.") .Description("Bans a user by id or name with an optional message.\n**Usage**: .b \"@some Guy\" Your behaviour is toxic.")
@ -194,7 +194,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".k").Alias(".kick") cgb.CreateCommand(Prefix + "k").Alias(Prefix + "kick")
.Parameter("user") .Parameter("user")
.Parameter("msg", ParameterType.Unparsed) .Parameter("msg", ParameterType.Unparsed)
.Description("Kicks a mentioned user.") .Description("Kicks a mentioned user.")
@ -220,7 +220,7 @@ namespace NadekoBot.Modules {
} }
} }
}); });
cgb.CreateCommand(".mute") cgb.CreateCommand(Prefix + "mute")
.Description("Mutes mentioned user or users.") .Description("Mutes mentioned user or users.")
.Parameter("throwaway", ParameterType.Unparsed) .Parameter("throwaway", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -240,7 +240,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".unmute") cgb.CreateCommand(Prefix + "unmute")
.Description("Unmutes mentioned user or users.") .Description("Unmutes mentioned user or users.")
.Parameter("throwaway", ParameterType.Unparsed) .Parameter("throwaway", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -260,8 +260,8 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".deafen") cgb.CreateCommand(Prefix + "deafen")
.Alias(".deaf") .Alias(Prefix + "deaf")
.Description("Deafens mentioned user or users") .Description("Deafens mentioned user or users")
.Parameter("throwaway", ParameterType.Unparsed) .Parameter("throwaway", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -281,8 +281,8 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".undeafen") cgb.CreateCommand(Prefix + "undeafen")
.Alias(".undeaf") .Alias(Prefix + "undeaf")
.Description("Undeafens mentioned user or users") .Description("Undeafens mentioned user or users")
.Parameter("throwaway", ParameterType.Unparsed) .Parameter("throwaway", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -302,7 +302,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".rvch") cgb.CreateCommand(Prefix + "rvch")
.Description("Removes a voice channel with a given name.") .Description("Removes a voice channel with a given name.")
.Parameter("channel_name", ParameterType.Required) .Parameter("channel_name", ParameterType.Required)
.Do(async e => { .Do(async e => {
@ -316,7 +316,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".vch").Alias(".cvch") cgb.CreateCommand(Prefix + "vch").Alias(Prefix + "cvch")
.Description("Creates a new voice channel with a given name.") .Description("Creates a new voice channel with a given name.")
.Parameter("channel_name", ParameterType.Required) .Parameter("channel_name", ParameterType.Required)
.Do(async e => { .Do(async e => {
@ -330,7 +330,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".rch").Alias(".rtch") cgb.CreateCommand(Prefix + "rch").Alias(Prefix + "rtch")
.Description("Removes a text channel with a given name.") .Description("Removes a text channel with a given name.")
.Parameter("channel_name", ParameterType.Required) .Parameter("channel_name", ParameterType.Required)
.Do(async e => { .Do(async e => {
@ -346,7 +346,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".ch").Alias(".tch") cgb.CreateCommand(Prefix + "ch").Alias(Prefix + "tch")
.Description("Creates a new text channel with a given name.") .Description("Creates a new text channel with a given name.")
.Parameter("channel_name", ParameterType.Required) .Parameter("channel_name", ParameterType.Required)
.Do(async e => { .Do(async e => {
@ -360,7 +360,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".st").Alias(".settopic") cgb.CreateCommand(Prefix + "st").Alias(Prefix + "settopic")
.Description("Sets a topic on the current channel.") .Description("Sets a topic on the current channel.")
.Parameter("topic", ParameterType.Unparsed) .Parameter("topic", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -370,7 +370,7 @@ namespace NadekoBot.Modules {
} catch { } } catch { }
}); });
cgb.CreateCommand(".uid").Alias(".userid") cgb.CreateCommand(Prefix + "uid").Alias(Prefix + "userid")
.Description("Shows user ID.") .Description("Shows user ID.")
.Parameter("user", ParameterType.Optional) .Parameter("user", ParameterType.Optional)
.Do(async e => { .Do(async e => {
@ -379,27 +379,27 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage($"Id of the user { usr.Name } is { usr.Id }"); await e.Channel.SendMessage($"Id of the user { usr.Name } is { usr.Id }");
}); });
cgb.CreateCommand(".cid").Alias(".channelid") cgb.CreateCommand(Prefix + "cid").Alias(Prefix + "channelid")
.Description("Shows current channel ID.") .Description("Shows current channel ID.")
.Do(async e => await e.Channel.SendMessage("This channel's ID is " + e.Channel.Id)); .Do(async e => await e.Channel.SendMessage("This channel's ID is " + e.Channel.Id));
cgb.CreateCommand(".sid").Alias(".serverid") cgb.CreateCommand(Prefix + "sid").Alias(Prefix + "serverid")
.Description("Shows current server ID.") .Description("Shows current server ID.")
.Do(async e => await e.Channel.SendMessage("This server's ID is " + e.Server.Id)); .Do(async e => await e.Channel.SendMessage("This server's ID is " + e.Server.Id));
cgb.CreateCommand(".stats") cgb.CreateCommand(Prefix + "stats")
.Description("Shows some basic stats for Nadeko.") .Description("Shows some basic stats for Nadeko.")
.Do(async e => { .Do(async e => {
await e.Channel.SendMessage(await NadekoStats.Instance.GetStats()); await e.Channel.SendMessage(await NadekoStats.Instance.GetStats());
}); });
cgb.CreateCommand(".heap") cgb.CreateCommand(Prefix + "heap")
.Description("Shows allocated memory - OWNER ONLY") .Description("Shows allocated memory - OWNER ONLY")
.AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.OwnerOnly())
.Do(async e => { .Do(async e => {
var heap = await Task.Run(() => NadekoStats.Instance.Heap()); var heap = await Task.Run(() => NadekoStats.Instance.Heap());
await e.Channel.SendMessage($"`Heap Size:` {heap}"); await e.Channel.SendMessage($"`Heap Size:` {heap}");
}); });
cgb.CreateCommand(".prune") cgb.CreateCommand(Prefix + "prune")
.Parameter("num", ParameterType.Required) .Parameter("num", ParameterType.Required)
.Description("Prunes a number of messages from the current channel.\n**Usage**: .prune 5") .Description("Prunes a number of messages from the current channel.\n**Usage**: .prune 5")
.Do(async e => { .Do(async e => {
@ -414,8 +414,8 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".die") cgb.CreateCommand(Prefix + "die")
.Alias(".graceful") .Alias(Prefix + "graceful")
.Description("Works only for the owner. Shuts the bot down and notifies users about the restart.") .Description("Works only for the owner. Shuts the bot down and notifies users about the restart.")
.Do(async e => { .Do(async e => {
if (NadekoBot.IsOwner(e.User.Id)) { if (NadekoBot.IsOwner(e.User.Id)) {
@ -425,7 +425,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand(".clr") cgb.CreateCommand(Prefix + "clr")
.Description("Clears some of Nadeko's (or some other user's if supplied) messages from the current channel.\n**Usage**: .clr @X") .Description("Clears some of Nadeko's (or some other user's if supplied) messages from the current channel.\n**Usage**: .clr @X")
.Parameter("user", ParameterType.Unparsed) .Parameter("user", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -447,8 +447,8 @@ namespace NadekoBot.Modules {
}); });
}); });
cgb.CreateCommand(".newname") cgb.CreateCommand(Prefix + "newname")
.Alias(".setname") .Alias(Prefix + "setname")
.Description("Give the bot a new name.") .Description("Give the bot a new name.")
.Parameter("new_name", ParameterType.Unparsed) .Parameter("new_name", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -457,8 +457,8 @@ namespace NadekoBot.Modules {
await client.CurrentUser.Edit(NadekoBot.Creds.Password, e.GetArg("new_name")); await client.CurrentUser.Edit(NadekoBot.Creds.Password, e.GetArg("new_name"));
}); });
cgb.CreateCommand(".newavatar") cgb.CreateCommand(Prefix + "newavatar")
.Alias(".setavatar") .Alias(Prefix + "setavatar")
.Description("Sets a new avatar image for the NadekoBot.") .Description("Sets a new avatar image for the NadekoBot.")
.Parameter("img", ParameterType.Unparsed) .Parameter("img", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -475,7 +475,7 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage("New avatar set."); await e.Channel.SendMessage("New avatar set.");
}); });
cgb.CreateCommand(".setgame") cgb.CreateCommand(Prefix + "setgame")
.Description("Sets the bots game.") .Description("Sets the bots game.")
.Parameter("set_game", ParameterType.Unparsed) .Parameter("set_game", ParameterType.Unparsed)
.Do(e => { .Do(e => {
@ -484,7 +484,7 @@ namespace NadekoBot.Modules {
client.SetGame(e.GetArg("set_game")); client.SetGame(e.GetArg("set_game"));
}); });
cgb.CreateCommand(".checkmyperms") cgb.CreateCommand(Prefix + "checkmyperms")
.Description("Checks your userspecific permissions on this channel.") .Description("Checks your userspecific permissions on this channel.")
.Do(async e => { .Do(async e => {
var output = "```\n"; var output = "```\n";
@ -499,7 +499,7 @@ namespace NadekoBot.Modules {
User commsUser = null; User commsUser = null;
Channel commsChannel = null; Channel commsChannel = null;
cgb.CreateCommand(".commsuser") cgb.CreateCommand(Prefix + "commsuser")
.Description("Sets a user for through-bot communication. Only works if server is set. Resets commschannel.**Owner only**.") .Description("Sets a user for through-bot communication. Only works if server is set. Resets commschannel.**Owner only**.")
.Parameter("name", ParameterType.Unparsed) .Parameter("name", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -512,7 +512,7 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage("No server specified or user."); await e.Channel.SendMessage("No server specified or user.");
}); });
cgb.CreateCommand(".commsserver") cgb.CreateCommand(Prefix + "commsserver")
.Description("Sets a server for through-bot communication.**Owner only**.") .Description("Sets a server for through-bot communication.**Owner only**.")
.Parameter("server", ParameterType.Unparsed) .Parameter("server", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -524,7 +524,7 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage("No such server."); await e.Channel.SendMessage("No such server.");
}); });
cgb.CreateCommand(".commschannel") cgb.CreateCommand(Prefix + "commschannel")
.Description("Sets a channel for through-bot communication. Only works if server is set. Resets commsuser.**Owner only**.") .Description("Sets a channel for through-bot communication. Only works if server is set. Resets commsuser.**Owner only**.")
.Parameter("ch", ParameterType.Unparsed) .Parameter("ch", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -537,7 +537,7 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage("No server specified or channel is invalid."); await e.Channel.SendMessage("No server specified or channel is invalid.");
}); });
cgb.CreateCommand(".send") cgb.CreateCommand(Prefix + "send")
.Description("Send a message to someone on a different server through the bot.**Owner only.**\n **Usage**: .send Message text multi word!") .Description("Send a message to someone on a different server through the bot.**Owner only.**\n **Usage**: .send Message text multi word!")
.Parameter("msg", ParameterType.Unparsed) .Parameter("msg", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -550,8 +550,8 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage("Failed. Make sure you've specified server and [channel or user]"); await e.Channel.SendMessage("Failed. Make sure you've specified server and [channel or user]");
}); });
cgb.CreateCommand(".menrole") cgb.CreateCommand(Prefix + "menrole")
.Alias(".mentionrole") .Alias(Prefix + "mentionrole")
.Description("Mentions every person from the provided role or roles (separated by a ',') on this server. Requires you to have mention everyone permission.") .Description("Mentions every person from the provided role or roles (separated by a ',') on this server. Requires you to have mention everyone permission.")
.Parameter("roles", ParameterType.Unparsed) .Parameter("roles", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -578,7 +578,7 @@ namespace NadekoBot.Modules {
}); });
}); });
cgb.CreateCommand(".parsetosql") cgb.CreateCommand(Prefix + "parsetosql")
.Description("Loads exported parsedata from /data/parsedata/ into sqlite database.") .Description("Loads exported parsedata from /data/parsedata/ into sqlite database.")
.Do(async e => { .Do(async e => {
if (!NadekoBot.IsOwner(e.User.Id)) if (!NadekoBot.IsOwner(e.User.Id))
@ -592,14 +592,14 @@ namespace NadekoBot.Modules {
}); });
}); });
cgb.CreateCommand(".unstuck") cgb.CreateCommand(Prefix + "unstuck")
.Description("Clears the message queue. **OWNER ONLY**") .Description("Clears the message queue. **OWNER ONLY**")
.AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.OwnerOnly())
.Do(e => { .Do(e => {
NadekoBot.Client.MessageQueue.Clear(); NadekoBot.Client.MessageQueue.Clear();
}); });
cgb.CreateCommand(".donators") cgb.CreateCommand(Prefix + "donators")
.Description("List of lovely people who donated to keep this project alive.") .Description("List of lovely people who donated to keep this project alive.")
.Do(async e => { .Do(async e => {
await Task.Run(async () => { await Task.Run(async () => {
@ -612,8 +612,8 @@ namespace NadekoBot.Modules {
}); });
//THIS IS INTENTED TO BE USED ONLY BY THE ORIGINAL BOT OWNER //THIS IS INTENTED TO BE USED ONLY BY THE ORIGINAL BOT OWNER
cgb.CreateCommand(".adddon") cgb.CreateCommand(Prefix + "adddon")
.Alias(".donadd") .Alias(Prefix + "donadd")
.Description("Add a donator to the database.") .Description("Add a donator to the database.")
.Parameter("donator") .Parameter("donator")
.Parameter("amount") .Parameter("amount")
@ -635,7 +635,7 @@ namespace NadekoBot.Modules {
}); });
}); });
cgb.CreateCommand(".videocall") cgb.CreateCommand(Prefix + "videocall")
.Description("Creates a private appear.in video call link for you and other mentioned people. The link is sent to mentioned people via a private message.") .Description("Creates a private appear.in video call link for you and other mentioned people. The link is sent to mentioned people via a private message.")
.Parameter("arg", ParameterType.Unparsed) .Parameter("arg", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {

View File

@ -4,6 +4,7 @@ using Discord.Modules;
using NadekoBot.Commands; using NadekoBot.Commands;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System.IO; using System.IO;
using Discord.Commands;
using NadekoBot.Extensions; using NadekoBot.Extensions;
//🃏 //🃏
@ -13,7 +14,7 @@ namespace NadekoBot.Modules {
private readonly string[] _8BallAnswers; private readonly string[] _8BallAnswers;
private readonly Random rng = new Random(); private readonly Random rng = new Random();
public Games() { public Games() {
commands.Add(new Trivia()); commands.Add(new Trivia());
commands.Add(new SpeedTyping()); commands.Add(new SpeedTyping());
commands.Add(new PollCommand()); commands.Add(new PollCommand());
@ -31,7 +32,7 @@ namespace NadekoBot.Modules {
commands.ForEach(cmd => cmd.Init(cgb)); commands.ForEach(cmd => cmd.Init(cgb));
cgb.CreateCommand(">choose") cgb.CreateCommand(Prefix + "choose")
.Description("Chooses a thing from a list of things\n**Usage**: >choose Get up;Sleep;Sleep more") .Description("Chooses a thing from a list of things\n**Usage**: >choose Get up;Sleep;Sleep more")
.Parameter("list", Discord.Commands.ParameterType.Unparsed) .Parameter("list", Discord.Commands.ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -44,7 +45,7 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage(list[rng.Next(0, list.Length)]); await e.Channel.SendMessage(list[rng.Next(0, list.Length)]);
}); });
cgb.CreateCommand(">8ball") cgb.CreateCommand(Prefix + "8ball")
.Description("Ask the 8ball a yes/no question.") .Description("Ask the 8ball a yes/no question.")
.Parameter("question", Discord.Commands.ParameterType.Unparsed) .Parameter("question", Discord.Commands.ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -57,7 +58,7 @@ namespace NadekoBot.Modules {
} catch { } } catch { }
}); });
cgb.CreateCommand(">") cgb.CreateCommand(Prefix + "attack")
.Description("Attack a person. Supported attacks: 'splash', 'strike', 'burn', 'surge'.\n**Usage**: > strike @User") .Description("Attack a person. Supported attacks: 'splash', 'strike', 'burn', 'surge'.\n**Usage**: > strike @User")
.Parameter("attack_type", Discord.Commands.ParameterType.Required) .Parameter("attack_type", Discord.Commands.ParameterType.Required)
.Parameter("target", Discord.Commands.ParameterType.Required) .Parameter("target", Discord.Commands.ParameterType.Required)
@ -79,7 +80,7 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage($"{ e.User.Mention }{GetImage(GetType(e.User.Id))} {response}"); await e.Channel.SendMessage($"{ e.User.Mention }{GetImage(GetType(e.User.Id))} {response}");
}); });
cgb.CreateCommand("poketype") cgb.CreateCommand(Prefix + "poketype")
.Parameter("target", Discord.Commands.ParameterType.Required) .Parameter("target", Discord.Commands.ParameterType.Required)
.Description("Gets the users element type. Use this to do more damage with strike!") .Description("Gets the users element type. Use this to do more damage with strike!")
.Do(async e => { .Do(async e => {
@ -91,6 +92,24 @@ namespace NadekoBot.Modules {
var t = GetType(usr.Id); var t = GetType(usr.Id);
await e.Channel.SendMessage($"{usr.Name}'s type is {GetImage(t)} {t}"); await e.Channel.SendMessage($"{usr.Name}'s type is {GetImage(t)} {t}");
}); });
cgb.CreateCommand(Prefix + "linux")
.Description("Prints a customizable Linux interjection")
.Parameter("gnu", ParameterType.Required)
.Parameter("linux", ParameterType.Required)
.Do(async e => {
var guhnoo = e.Args[0];
var loonix = e.Args[1];
await e.Channel.SendMessage(
$@"
I'd just like to interject for moment. What you're refering to as {loonix}, is in fact, {guhnoo}/{loonix}, or as I've recently taken to calling it, {guhnoo} plus {loonix}. {loonix} is not an operating system unto itself, but rather another free component of a fully functioning {guhnoo} system made useful by the {guhnoo} corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.
Many computer users run a modified version of the {guhnoo} system every day, without realizing it. Through a peculiar turn of events, the version of {guhnoo} which is widely used today is often called {loonix}, and many of its users are not aware that it is basically the {guhnoo} system, developed by the {guhnoo} Project.
There really is a {loonix}, and these people are using it, but it is just a part of the system they use. {loonix} is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. {loonix} is normally used in combination with the {guhnoo} operating system: the whole system is basically {guhnoo} with {loonix} added, or {guhnoo}/{loonix}. All the so-called {loonix} distributions are really distributions of {guhnoo}/{loonix}.
");
});
}); });
} }
/* /*

View File

@ -16,7 +16,7 @@ namespace NadekoBot.Modules {
cgb.AddCheck(Classes.Permissions.PermissionChecker.Instance); cgb.AddCheck(Classes.Permissions.PermissionChecker.Instance);
cgb.CreateCommand("~hentai") cgb.CreateCommand(Prefix + "hentai")
.Description("Shows a random NSFW hentai image from gelbooru and danbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +)\n**Usage**: ~hentai yuri+kissing") .Description("Shows a random NSFW hentai image from gelbooru and danbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +)\n**Usage**: ~hentai yuri+kissing")
.Parameter("tag", ParameterType.Unparsed) .Parameter("tag", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -24,34 +24,34 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage(":heart: Gelbooru: " + await SearchHelper.GetGelbooruImageLink(tag)); await e.Channel.SendMessage(":heart: Gelbooru: " + await SearchHelper.GetGelbooruImageLink(tag));
await e.Channel.SendMessage(":heart: Danbooru: " + await SearchHelper.GetDanbooruImageLink(tag)); await e.Channel.SendMessage(":heart: Danbooru: " + await SearchHelper.GetDanbooruImageLink(tag));
}); });
cgb.CreateCommand("~danbooru") cgb.CreateCommand(Prefix + "danbooru")
.Description("Shows a random hentai image from danbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +)\n**Usage**: ~danbooru yuri+kissing") .Description("Shows a random hentai image from danbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +)\n**Usage**: ~danbooru yuri+kissing")
.Parameter("tag", ParameterType.Unparsed) .Parameter("tag", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
var tag = e.GetArg("tag")?.Trim() ?? ""; var tag = e.GetArg("tag")?.Trim() ?? "";
await e.Channel.SendMessage(await SearchHelper.GetDanbooruImageLink(tag)); await e.Channel.SendMessage(await SearchHelper.GetDanbooruImageLink(tag));
}); });
cgb.CreateCommand("~gelbooru") cgb.CreateCommand(Prefix + "gelbooru")
.Description("Shows a random hentai image from gelbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +)\n**Usage**: ~gelbooru yuri+kissing") .Description("Shows a random hentai image from gelbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +)\n**Usage**: ~gelbooru yuri+kissing")
.Parameter("tag", ParameterType.Unparsed) .Parameter("tag", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
var tag = e.GetArg("tag")?.Trim() ?? ""; var tag = e.GetArg("tag")?.Trim() ?? "";
await e.Channel.SendMessage(await SearchHelper.GetGelbooruImageLink(tag)); await e.Channel.SendMessage(await SearchHelper.GetGelbooruImageLink(tag));
}); });
cgb.CreateCommand("~e621") cgb.CreateCommand(Prefix + "e621")
.Description("Shows a random hentai image from e621.net with a given tag. Tag is optional but preffered. Use spaces for multiple tags.\n**Usage**: ~e621 yuri+kissing") .Description("Shows a random hentai image from e621.net with a given tag. Tag is optional but preffered. Use spaces for multiple tags.\n**Usage**: ~e621 yuri+kissing")
.Parameter("tag", ParameterType.Unparsed) .Parameter("tag", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
var tag = e.GetArg("tag")?.Trim() ?? ""; var tag = e.GetArg("tag")?.Trim() ?? "";
await e.Channel.SendMessage(await SearchHelper.GetE621ImageLink(tag)); await e.Channel.SendMessage(await SearchHelper.GetE621ImageLink(tag));
}); });
cgb.CreateCommand("~cp") cgb.CreateCommand(Prefix + "cp")
.Description("We all know where this will lead you to.") .Description("We all know where this will lead you to.")
.Parameter("anything", ParameterType.Unparsed) .Parameter("anything", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
await e.Channel.SendMessage("http://i.imgur.com/MZkY1md.jpg"); await e.Channel.SendMessage("http://i.imgur.com/MZkY1md.jpg");
}); });
cgb.CreateCommand("~boobs") cgb.CreateCommand(Prefix + "boobs")
.Description("Real adult content.") .Description("Real adult content.")
.Do(async e => { .Do(async e => {
try { try {
@ -61,8 +61,8 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage($"💢 {ex.Message}"); await e.Channel.SendMessage($"💢 {ex.Message}");
} }
}); });
cgb.CreateCommand("~butts") cgb.CreateCommand(Prefix + "butts")
.Alias("~ass","~butt") .Alias(Prefix + "ass",Prefix + "butt")
.Description("Real adult content.") .Description("Real adult content.")
.Do(async e => { .Do(async e => {
try { try {

View File

@ -28,7 +28,7 @@ namespace NadekoBot.Modules {
commands.ForEach(cmd => cmd.Init(cgb)); commands.ForEach(cmd => cmd.Init(cgb));
cgb.CreateCommand("~yt") cgb.CreateCommand(Prefix + "yt")
.Parameter("query", ParameterType.Unparsed) .Parameter("query", ParameterType.Unparsed)
.Description("Searches youtubes and shows the first result") .Description("Searches youtubes and shows the first result")
.Do(async e => { .Do(async e => {
@ -38,8 +38,8 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage(shortUrl); await e.Channel.SendMessage(shortUrl);
}); });
cgb.CreateCommand("~ani") cgb.CreateCommand(Prefix + "ani")
.Alias("~anime", "~aq") .Alias(Prefix + "anime", Prefix + "aq")
.Parameter("query", ParameterType.Unparsed) .Parameter("query", ParameterType.Unparsed)
.Description("Queries anilist for an anime and shows the first result.") .Description("Queries anilist for an anime and shows the first result.")
.Do(async e => { .Do(async e => {
@ -55,8 +55,8 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage(result.ToString()); await e.Channel.SendMessage(result.ToString());
}); });
cgb.CreateCommand("~mang") cgb.CreateCommand(Prefix + "mang")
.Alias("~manga").Alias("~mq") .Alias(Prefix + "manga").Alias(Prefix + "mq")
.Parameter("query", ParameterType.Unparsed) .Parameter("query", ParameterType.Unparsed)
.Description("Queries anilist for a manga and shows the first result.") .Description("Queries anilist for a manga and shows the first result.")
.Do(async e => { .Do(async e => {
@ -71,14 +71,14 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage(result); await e.Channel.SendMessage(result);
}); });
cgb.CreateCommand("~randomcat") cgb.CreateCommand(Prefix + "randomcat")
.Description("Shows a random cat image.") .Description("Shows a random cat image.")
.Do(async e => { .Do(async e => {
await e.Channel.SendMessage(JObject.Parse( await e.Channel.SendMessage(JObject.Parse(
await SearchHelper.GetResponseStringAsync("http://www.random.cat/meow"))["file"].ToString()); await SearchHelper.GetResponseStringAsync("http://www.random.cat/meow"))["file"].ToString());
}); });
cgb.CreateCommand("~i") cgb.CreateCommand(Prefix + "i")
.Description("Pulls the first image found using a search parameter. Use ~ir for different results.\n**Usage**: ~i cute kitten") .Description("Pulls the first image found using a search parameter. Use ~ir for different results.\n**Usage**: ~i cute kitten")
.Parameter("query", ParameterType.Unparsed) .Parameter("query", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -93,7 +93,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand("~ir") cgb.CreateCommand(Prefix + "ir")
.Description("Pulls a random image using a search parameter.\n**Usage**: ~ir cute kitten") .Description("Pulls a random image using a search parameter.\n**Usage**: ~ir cute kitten")
.Parameter("query", ParameterType.Unparsed) .Parameter("query", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -107,8 +107,7 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage($"💢 {ex.Message}"); await e.Channel.SendMessage($"💢 {ex.Message}");
} }
}); });
cgb.CreateCommand("lmgtfy") cgb.CreateCommand(Prefix + "lmgtfy")
.Alias("~lmgtfy")
.Description("Google something for an idiot.") .Description("Google something for an idiot.")
.Parameter("ffs", ParameterType.Unparsed) .Parameter("ffs", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -116,7 +115,7 @@ namespace NadekoBot.Modules {
await e.Channel.SendMessage(await $"http://lmgtfy.com/?q={ Uri.EscapeUriString(e.GetArg("ffs").ToString()) }".ShortenUrl()); await e.Channel.SendMessage(await $"http://lmgtfy.com/?q={ Uri.EscapeUriString(e.GetArg("ffs").ToString()) }".ShortenUrl());
}); });
cgb.CreateCommand("~hs") cgb.CreateCommand(Prefix + "hs")
.Description("Searches for a Hearthstone card and shows its image. Takes a while to complete.\n**Usage**:~hs Ysera") .Description("Searches for a Hearthstone card and shows its image. Takes a while to complete.\n**Usage**:~hs Ysera")
.Parameter("name", ParameterType.Unparsed) .Parameter("name", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -148,7 +147,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand("~osu") cgb.CreateCommand(Prefix + "osu")
.Description("Shows osu stats for a player.\n**Usage**:~osu Name") .Description("Shows osu stats for a player.\n**Usage**:~osu Name")
.Parameter("usr", ParameterType.Unparsed) .Parameter("usr", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -172,7 +171,7 @@ namespace NadekoBot.Modules {
} }
}); });
cgb.CreateCommand("~ud") cgb.CreateCommand(Prefix + "ud")
.Description("Searches Urban Dictionary for a word.\n**Usage**:~ud Pineapple") .Description("Searches Urban Dictionary for a word.\n**Usage**:~ud Pineapple")
.Parameter("query", ParameterType.Unparsed) .Parameter("query", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -196,7 +195,7 @@ namespace NadekoBot.Modules {
} }
}); });
// thanks to Blaubeerwald // thanks to Blaubeerwald
cgb.CreateCommand("~#") cgb.CreateCommand(Prefix + "#")
.Description("Searches Tagdef.com for a hashtag.\n**Usage**:~# ff") .Description("Searches Tagdef.com for a hashtag.\n**Usage**:~# ff")
.Parameter("query", ParameterType.Unparsed) .Parameter("query", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {
@ -221,7 +220,7 @@ namespace NadekoBot.Modules {
}); });
//todo when moved from parse //todo when moved from parse
/* /*
cgb.CreateCommand("~osubind") cgb.CreateCommand(Prefix + "osubind")
.Description("Bind discord user to osu name\n**Usage**: ~osubind My osu name") .Description("Bind discord user to osu name\n**Usage**: ~osubind My osu name")
.Parameter("osu_name", ParameterType.Unparsed) .Parameter("osu_name", ParameterType.Unparsed)
.Do(async e => { .Do(async e => {