diff --git a/NadekoBot/Modules/Administration/AdministrationModule.cs b/NadekoBot/Modules/Administration/AdministrationModule.cs index 2b53821c..6d6ffacf 100644 --- a/NadekoBot/Modules/Administration/AdministrationModule.cs +++ b/NadekoBot/Modules/Administration/AdministrationModule.cs @@ -630,7 +630,7 @@ namespace NadekoBot.Modules.Administration }); cgb.CreateCommand(Prefix + "heap") - .Description("Shows allocated memory - **Owner Only!**") + .Description("Shows allocated memory - **Bot Owner Only!**") .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => { @@ -710,7 +710,7 @@ namespace NadekoBot.Modules.Administration cgb.CreateCommand(Prefix + "die") .Alias(Prefix + "graceful") - .Description("Shuts the bot down and notifies users about the restart. **Owner Only!**") + .Description("Shuts the bot down and notifies users about the restart. **Bot Owner Only!**") .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => { @@ -721,7 +721,7 @@ namespace NadekoBot.Modules.Administration cgb.CreateCommand(Prefix + "newname") .Alias(Prefix + "setname") - .Description("Give the bot a new name. **Owner Only!**") + .Description("Give the bot a new name. **Bot Owner Only!**") .Parameter("new_name", ParameterType.Unparsed) .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => @@ -733,7 +733,7 @@ namespace NadekoBot.Modules.Administration cgb.CreateCommand(Prefix + "newavatar") .Alias(Prefix + "setavatar") - .Description("Sets a new avatar image for the NadekoBot. **Owner Only!**") + .Description("Sets a new avatar image for the NadekoBot. **Bot Owner Only!**") .Parameter("img", ParameterType.Unparsed) .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => @@ -754,7 +754,7 @@ namespace NadekoBot.Modules.Administration }); cgb.CreateCommand(Prefix + "setgame") - .Description("Sets the bots game. **Owner Only!**") + .Description("Sets the bots game. **Bot Owner Only!**") .Parameter("set_game", ParameterType.Unparsed) .Do(e => { @@ -781,23 +781,23 @@ namespace NadekoBot.Modules.Administration Channel commsChannel = null; cgb.CreateCommand(Prefix + "commsuser") - .Description("Sets a user for through-bot communication. Only works if server is set. Resets commschannel. **Owner Only!**") - .Parameter("name", ParameterType.Unparsed) - .AddCheck(SimpleCheckers.OwnerOnly()) - .Do(async e => - { - commsUser = commsServer?.FindUsers(e.GetArg("name")).FirstOrDefault(); - if (commsUser != null) - { - commsChannel = null; - await e.Channel.SendMessage("User for comms set.").ConfigureAwait(false); - } - else - await e.Channel.SendMessage("No server specified or user.").ConfigureAwait(false); - }); + .Description("Sets a user for through-bot communication. Only works if server is set. Resets commschannel. **Bot Owner Only!**") + .Parameter("name", ParameterType.Unparsed) + .AddCheck(SimpleCheckers.OwnerOnly()) + .Do(async e => + { + commsUser = commsServer?.FindUsers(e.GetArg("name")).FirstOrDefault(); + if (commsUser != null) + { + commsChannel = null; + await e.Channel.SendMessage("User for comms set.").ConfigureAwait(false); + } + else + await e.Channel.SendMessage("No server specified or user.").ConfigureAwait(false); + }); cgb.CreateCommand(Prefix + "commsserver") - .Description("Sets a server for through-bot communication. **Owner Only!**") + .Description("Sets a server for through-bot communication. **Bot Owner Only!**") .Parameter("server", ParameterType.Unparsed) .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => @@ -810,7 +810,7 @@ namespace NadekoBot.Modules.Administration }); 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. **Bot Owner Only!**") .Parameter("ch", ParameterType.Unparsed) .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => @@ -826,7 +826,7 @@ namespace NadekoBot.Modules.Administration }); 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. **Bot Owner Only!**\n**Usage**: .send Message text multi word!") .Parameter("msg", ParameterType.Unparsed) .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => @@ -903,7 +903,7 @@ namespace NadekoBot.Modules.Administration }); cgb.CreateCommand(Prefix + "unstuck") - .Description("Clears the message queue. **Owner Only!**") + .Description("Clears the message queue. **Bot Owner Only!**") .AddCheck(SimpleCheckers.OwnerOnly()) .Do(e => { @@ -974,7 +974,7 @@ namespace NadekoBot.Modules.Administration }); cgb.CreateCommand(Prefix + "announce") - .Description($"Sends a message to all servers' general channel bot is connected to.**Owner Only!**\n**Usage**: {Prefix}announce Useless spam") + .Description($"Sends a message to all servers' general channel bot is connected to.**Bot Owner Only!**\n**Usage**: {Prefix}announce Useless spam") .Parameter("msg", ParameterType.Unparsed) .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => diff --git a/NadekoBot/Modules/Administration/Commands/CustomReactionsCommands.cs b/NadekoBot/Modules/Administration/Commands/CustomReactionsCommands.cs index 09fe9d57..dcda6459 100644 --- a/NadekoBot/Modules/Administration/Commands/CustomReactionsCommands.cs +++ b/NadekoBot/Modules/Administration/Commands/CustomReactionsCommands.cs @@ -21,7 +21,7 @@ namespace NadekoBot.Modules.Administration.Commands cgb.CreateCommand(Prefix + "addcustomreaction") .Alias(Prefix + "acr") - .Description($"Add a custom reaction. Guide here: **Owner Only!** \n**Usage**: {Prefix}acr \"hello\" I love saying hello to %user%") + .Description($"Add a custom reaction. Guide here: **Bot Owner Only!** \n**Usage**: {Prefix}acr \"hello\" I love saying hello to %user%") .AddCheck(SimpleCheckers.OwnerOnly()) .Parameter("name", ParameterType.Required) .Parameter("message", ParameterType.Unparsed) diff --git a/NadekoBot/Modules/Administration/Commands/LogCommand.cs b/NadekoBot/Modules/Administration/Commands/LogCommand.cs index ad020ba4..7b7c1a48 100644 --- a/NadekoBot/Modules/Administration/Commands/LogCommand.cs +++ b/NadekoBot/Modules/Administration/Commands/LogCommand.cs @@ -328,14 +328,13 @@ $@"🕔`{prettyCurrentTime}` **Message** 📝 `#{e.Channel.Name}` }); cgb.CreateCommand(Module.Prefix + "logserver") - .Description("Toggles logging in this channel. Logs every message sent/deleted/edited on the server. **Owner Only!**") + .Description("Toggles logging in this channel. Logs every message sent/deleted/edited on the server. **Bot Owner Only!**") .AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.ManageServer()) .Do(DoFunc()); cgb.CreateCommand(Module.Prefix + "userpresence") - .Description("Starts logging to this channel when someone from the server goes online/offline/idle. **Owner Only!**") - .AddCheck(SimpleCheckers.OwnerOnly()) + .Description("Starts logging to this channel when someone from the server goes online/offline/idle.") .AddCheck(SimpleCheckers.ManageServer()) .Do(async e => { @@ -351,9 +350,8 @@ $@"🕔`{prettyCurrentTime}` **Message** 📝 `#{e.Channel.Name}` }); cgb.CreateCommand(Module.Prefix + "voicepresence") - .Description("Toggles logging to this channel whenever someone joins or leaves a voice channel you are in right now. **Owner Only!**") + .Description("Toggles logging to this channel whenever someone joins or leaves a voice channel you are in right now.") .Parameter("all", ParameterType.Optional) - .AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.ManageServer()) .Do(async e => { diff --git a/NadekoBot/Modules/Administration/Commands/Remind.cs b/NadekoBot/Modules/Administration/Commands/Remind.cs index 667ef82b..8e171af5 100644 --- a/NadekoBot/Modules/Administration/Commands/Remind.cs +++ b/NadekoBot/Modules/Administration/Commands/Remind.cs @@ -180,7 +180,7 @@ namespace NadekoBot.Modules.Administration.Commands cgb.CreateCommand(Module.Prefix + "remindmsg") .Description("Sets message for when the remind is triggered. " + " Available placeholders are %user% - user who ran the command, %message% -" + - " Message specified in the remind, %target% - target channel of the remind. **Owner only!**") + " Message specified in the remind, %target% - target channel of the remind. **Bot Owner Only!**") .Parameter("msg", ParameterType.Unparsed) .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => diff --git a/NadekoBot/Modules/Administration/Commands/SelfCommands.cs b/NadekoBot/Modules/Administration/Commands/SelfCommands.cs index 1530eee4..d6e3acd7 100644 --- a/NadekoBot/Modules/Administration/Commands/SelfCommands.cs +++ b/NadekoBot/Modules/Administration/Commands/SelfCommands.cs @@ -1,11 +1,7 @@ -using NadekoBot.Classes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Discord.Commands; +using Discord.Commands; +using NadekoBot.Classes; using NadekoBot.Modules.Permissions.Classes; +using System.Linq; namespace NadekoBot.Modules.Administration.Commands { @@ -18,14 +14,14 @@ namespace NadekoBot.Modules.Administration.Commands internal override void Init(CommandGroupBuilder cgb) { cgb.CreateCommand(Module.Prefix + "leave") - .Description("Makes Nadeko leave the server. Either name or id required.\n**Usage**:.leave NSFW") + .Description("Makes Nadeko leave the server. Either name or id required.\n**Usage**: `.leave 123123123331`") .Parameter("arg", ParameterType.Required) .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => { - var arg = e.GetArg("arg")?.Trim(); + var arg = e.GetArg("arg").Trim(); var server = NadekoBot.Client.Servers.FirstOrDefault(s => s.Id.ToString() == arg) ?? - NadekoBot.Client.FindServers(arg.Trim()).FirstOrDefault(); + NadekoBot.Client.FindServers(arg).FirstOrDefault(); if (server == null) { await e.Channel.SendMessage("Cannot find that server").ConfigureAwait(false); diff --git a/NadekoBot/Modules/Conversations/Commands/RequestsCommand.cs b/NadekoBot/Modules/Conversations/Commands/RequestsCommand.cs deleted file mode 100644 index c606feae..00000000 --- a/NadekoBot/Modules/Conversations/Commands/RequestsCommand.cs +++ /dev/null @@ -1,133 +0,0 @@ -using Discord.Commands; -using NadekoBot.Extensions; -using NadekoBot.Modules; -using NadekoBot.Modules.Permissions.Classes; -using System; -using System.Threading.Tasks; - -namespace NadekoBot.Classes.Conversations.Commands -{ - internal class RequestsCommand : DiscordCommand - { - public void SaveRequest(CommandEventArgs e, string text) - { - DbHandler.Instance.InsertData(new DataModels.Request - { - RequestText = text, - UserName = e.User.Name, - UserId = (long)e.User.Id, - ServerId = (long)e.Server.Id, - ServerName = e.Server.Name, - DateAdded = DateTime.Now - }); - } - // todo what if it's too long? - public string GetRequests() - { - var task = DbHandler.Instance.GetAllRows(); - - var str = "Here are all current requests for NadekoBot:\n\n"; - foreach (var reqObj in task) - { - str += $"{reqObj.Id}. by **{reqObj.UserName}** from **{reqObj.ServerName}** at {reqObj.DateAdded.ToLocalTime()}\n" + - $"**{reqObj.RequestText}**\n----------\n"; - } - return str + "\n__Type [@NadekoBot clr] to clear all of my messages.__"; - } - - public bool DeleteRequest(int requestNumber) => - DbHandler.Instance.Delete(requestNumber) != null; - - /// - /// Delete a request with a number and returns that request object. - /// - /// RequestObject of the request. Null if none - public DataModels.Request ResolveRequest(int requestNumber) => - DbHandler.Instance.Delete(requestNumber); - - internal override void Init(CommandGroupBuilder cgb) - { - - cgb.CreateCommand("req") - .Alias("request") - .Description("Requests a feature for nadeko.\n**Usage**: @NadekoBot req new_feature") - .Parameter("all", ParameterType.Unparsed) - .Do(async e => - { - var str = e.Args[0]; - - try - { - SaveRequest(e, str); - } - catch - { - await e.Channel.SendMessage("Something went wrong.").ConfigureAwait(false); - return; - } - await e.Channel.SendMessage("Thank you for your request.").ConfigureAwait(false); - }); - - cgb.CreateCommand("lr") - .Description("PMs the user all current nadeko requests.") - .Do(async e => - { - var str = await Task.Run(() => GetRequests()).ConfigureAwait(false); - if (str.Trim().Length > 110) - await e.User.Send(str).ConfigureAwait(false); - else - await e.User.Send("No requests atm.").ConfigureAwait(false); - }); - - cgb.CreateCommand("dr") - .Description("Deletes a request. **Owner Only!**") - .Parameter("reqNumber", ParameterType.Required) - .AddCheck(SimpleCheckers.OwnerOnly()) - .Do(async e => - { - try - { - if (DeleteRequest(int.Parse(e.Args[0]))) - { - await e.Channel.SendMessage(e.User.Mention + " Request deleted.").ConfigureAwait(false); - } - else - { - await e.Channel.SendMessage("No request on that number.").ConfigureAwait(false); - } - } - catch - { - await e.Channel.SendMessage("Error deleting request, probably NaN error.").ConfigureAwait(false); - } - }); - - cgb.CreateCommand("rr") - .Description("Resolves a request. **Owner Only!**") - .Parameter("reqNumber", ParameterType.Required) - .AddCheck(SimpleCheckers.OwnerOnly()) - .Do(async e => - { - try - { - var sc = ResolveRequest(int.Parse(e.Args[0])); - if (sc != null) - { - await e.Channel.SendMessage(e.User.Mention + " Request resolved, notice sent.").ConfigureAwait(false); - await NadekoBot.Client.GetServer((ulong)sc.ServerId).GetUser((ulong)sc.UserId).Send("**This request of yours has been resolved:**\n" + sc.RequestText).ConfigureAwait(false); - } - else - { - await e.Channel.SendMessage("No request on that number.").ConfigureAwait(false); - } - } - catch - { - await e.Channel.SendMessage("Error resolving request, probably NaN error.").ConfigureAwait(false); - } - }); - } - - public RequestsCommand(DiscordModule module) : base(module) { } - } -} diff --git a/NadekoBot/Modules/Conversations/Conversations.cs b/NadekoBot/Modules/Conversations/Conversations.cs index 52d1b29a..bb928110 100644 --- a/NadekoBot/Modules/Conversations/Conversations.cs +++ b/NadekoBot/Modules/Conversations/Conversations.cs @@ -20,7 +20,6 @@ namespace NadekoBot.Modules.Conversations public Conversations() { commands.Add(new CopyCommand(this)); - commands.Add(new RequestsCommand(this)); commands.Add(new RipCommand(this)); } diff --git a/NadekoBot/Modules/Gambling/GamblingModule.cs b/NadekoBot/Modules/Gambling/GamblingModule.cs index 5c0c8919..668c1383 100644 --- a/NadekoBot/Modules/Gambling/GamblingModule.cs +++ b/NadekoBot/Modules/Gambling/GamblingModule.cs @@ -94,7 +94,7 @@ namespace NadekoBot.Modules.Gambling }); cgb.CreateCommand(Prefix + "award") - .Description("Gives someone a certain amount of flowers. **Owner only!**\n**Usage**: `$award 100 @person`") + .Description("Gives someone a certain amount of flowers. **Bot Owner Only!**\n**Usage**: `$award 100 @person`") .AddCheck(SimpleCheckers.OwnerOnly()) .Parameter("amount", ParameterType.Required) .Parameter("receiver", ParameterType.Unparsed) @@ -116,7 +116,7 @@ namespace NadekoBot.Modules.Gambling }); cgb.CreateCommand(Prefix + "take") - .Description("Takes a certain amount of flowers from someone. **Owner only!**") + .Description("Takes a certain amount of flowers from someone. **Bot Owner Only!**") .AddCheck(SimpleCheckers.OwnerOnly()) .Parameter("amount", ParameterType.Required) .Parameter("rektperson", ParameterType.Unparsed) diff --git a/NadekoBot/Modules/Help/Commands/HelpCommand.cs b/NadekoBot/Modules/Help/Commands/HelpCommand.cs index bfb99d7d..21ef73a9 100644 --- a/NadekoBot/Modules/Help/Commands/HelpCommand.cs +++ b/NadekoBot/Modules/Help/Commands/HelpCommand.cs @@ -78,7 +78,7 @@ Version: `{NadekoStats.Instance.BotVersion}`"; .Parameter("command", ParameterType.Unparsed) .Do(HelpFunc()); cgb.CreateCommand(Module.Prefix + "hgit") - .Description("Generates the commandlist.md file. **Owner Only!**") + .Description("Generates the commandlist.md file. **Bot Owner Only!**") .AddCheck(SimpleCheckers.OwnerOnly()) .Do(DoGitFunc()); cgb.CreateCommand(Module.Prefix + "readme") diff --git a/NadekoBot/Modules/Music/MusicModule.cs b/NadekoBot/Modules/Music/MusicModule.cs index 4fcf3a36..220417ff 100644 --- a/NadekoBot/Modules/Music/MusicModule.cs +++ b/NadekoBot/Modules/Music/MusicModule.cs @@ -299,7 +299,7 @@ namespace NadekoBot.Modules.Music }); cgb.CreateCommand("lopl") - .Description("Queues all songs from a directory. **Owner Only!**\n**Usage**: `!m lopl C:/music/classical`") + .Description("Queues all songs from a directory. **Bot Owner Only!**\n**Usage**: `!m lopl C:/music/classical`") .Parameter("directory", ParameterType.Unparsed) .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => @@ -339,7 +339,7 @@ namespace NadekoBot.Modules.Music }); cgb.CreateCommand("lo") - .Description("Queues a local file by specifying a full path. **Owner Only!**\n**Usage**: `!m lo C:/music/mysong.mp3`") + .Description("Queues a local file by specifying a full path. **Bot Owner Only!**\n**Usage**: `!m lo C:/music/mysong.mp3`") .Parameter("path", ParameterType.Unparsed) .AddCheck(SimpleCheckers.OwnerOnly()) .Do(async e => @@ -393,7 +393,7 @@ namespace NadekoBot.Modules.Music }); cgb.CreateCommand("cleanup") - .Description("Cleans up hanging voice connections. **Owner Only!**\n**Usage**: `!m cleanup`") + .Description("Cleans up hanging voice connections. **Bot Owner Only!**\n**Usage**: `!m cleanup`") .AddCheck(SimpleCheckers.OwnerOnly()) .Do(e => {