diff --git a/NadekoBot/Modules/Administration.cs b/NadekoBot/Modules/Administration.cs index fb9e3155..52c0cfc1 100644 --- a/NadekoBot/Modules/Administration.cs +++ b/NadekoBot/Modules/Administration.cs @@ -1,4 +1,5 @@ using Discord.Modules; +using System.Linq; namespace NadekoBot.Modules { @@ -12,7 +13,34 @@ namespace NadekoBot.Modules { manager.CreateCommands("", cgb => { - commands.ForEach(com => com.Init(cgb)); + var client = manager.Client; + + commands.ForEach(cmd => cmd.Init(cgb)); + + cgb.CreateCommand(".uid") + .Description("Shows user id") + .Parameter("user",Discord.Commands.ParameterType.Required) + .Do(async e => + { + if (e.Message.MentionedUsers.Any()) + await client.SendMessage(e.Channel, "Id of the user " + e.Message.MentionedUsers.First().Mention + " is " + e.Message.MentionedUsers.First().Id); + else + await client.SendMessage(e.Channel, "You must mention a user."); + }); + + cgb.CreateCommand(".cid") + .Description("Shows current channel id") + .Do(async e => + { + await client.SendMessage(e.Channel, "This channel's id is " + e.Channel.Id); + }); + + cgb.CreateCommand(".sid") + .Description("Shows current server id") + .Do(async e => + { + await client.SendMessage(e.Channel, "This server's id is " + e.Server.Id); + }); }); } diff --git a/NadekoBot/Modules/Conversations.cs b/NadekoBot/Modules/Conversations.cs index e1b6777d..6068316f 100644 --- a/NadekoBot/Modules/Conversations.cs +++ b/NadekoBot/Modules/Conversations.cs @@ -36,6 +36,7 @@ namespace NadekoBot.Modules public override void Install(ModuleManager manager) { Random rng = new Random(); + manager.CreateCommands("", cgb => { var client = manager.Client; @@ -53,7 +54,6 @@ namespace NadekoBot.Modules { await client.SendMessage(e.Channel, Mention.User(e.User) + "\\o\\"); }); - }); manager.CreateCommands(NadekoBot.botMention, cgb => @@ -71,7 +71,7 @@ namespace NadekoBot.Modules else await client.SendMessage(e.Channel, Mention.User(e.User) + ", Don't be silly."); }); - + CreateCommand(cgb, "die") .Description("Works only for the owner. Shuts the bot down.") .Do(async e => @@ -189,7 +189,6 @@ namespace NadekoBot.Modules string str = "I am online for " + time.Days + " days, " + time.Hours + " hours, and " + time.Minutes + " minutes."; await client.SendMessage(e.Channel, str); }); - CreateCommand(cgb, "fire") .Description("Shows a unicode fire message. Optional parameter [x] tells her how many times to repeat the fire.\nUsage: @NadekoBot fire [x]") .Parameter("times", ParameterType.Optional) @@ -469,20 +468,6 @@ namespace NadekoBot.Modules { await client.SendMessage(e.Channel, "Calling " + e.Args[0] + "..."); }); - - cgb.CreateCommand("cid") - .Description("Shows current channel id") - .Do(async e => - { - await client.SendMessage(e.Channel, "This channel's id is " + e.Channel.Id); - }); - - cgb.CreateCommand("sid") - .Description("Shows current server id") - .Do(async e => - { - await client.SendMessage(e.Channel, "This server's id is " + e.Server.Id); - }); CreateCommand(cgb, "hide") .Description("Hides nadeko in plain sight!11!!") .Do(async e => diff --git a/NadekoBot/NadekoBot.cs b/NadekoBot/NadekoBot.cs index f15e8d95..a3d33cab 100644 --- a/NadekoBot/NadekoBot.cs +++ b/NadekoBot/NadekoBot.cs @@ -4,10 +4,8 @@ using System.IO; using Newtonsoft.Json; using Discord.Commands; using Discord.Modules; -using System.Text.RegularExpressions; using Parse; using NadekoBot.Modules; -using System.Timers; namespace NadekoBot { @@ -64,7 +62,7 @@ namespace NadekoBot //install modules modules.Install(new Administration(), "Administration", FilterType.Unrestricted); - modules.Install(new Conversations(), "Conversation", FilterType.Unrestricted); + modules.Install(new Conversations(), "Conversations", FilterType.Unrestricted); modules.Install(new Gambling(), "Gambling", FilterType.Unrestricted); modules.Install(new Games(), "Games", FilterType.Unrestricted); modules.Install(new Music(), "Music", FilterType.Unrestricted);