From d6ca8a8846ed18d768431b7a940060d8bdd6357f Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Fri, 22 Apr 2016 18:48:58 +0200 Subject: [PATCH 1/3] Update ComprehensiveGuide.md --- ComprehensiveGuide.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ComprehensiveGuide.md b/ComprehensiveGuide.md index 3cbd9f8b..2e5f2fee 100644 --- a/ComprehensiveGuide.md +++ b/ComprehensiveGuide.md @@ -9,6 +9,8 @@ ________________________________________________________________________________ - Go to (https://discordapp.com/developers/applications/me). Log in if you have to with your Discord account. Press "New Application" and fill out an App Name and, optionally, an app description and icon. Afterwards, create the application. Once the application is created, click on "Create a Bot User" and confirm it. You will then see the bot's username, ID and token. Reveal and copy the token and the bot ID. - Open up credentials.json. Paste the token into the Token field, between the quotes. Paste the ID into the BotID field. Leave email and password fields empty. Save and close credentials.json. - Go into data folder and make sure you have config.json file. If there is no config.json, rename the config_example.json to config.json. +- Copy your CLIENT ID (that's in the same Developer page where you brought your token) and replace `12345678` in the this link: +https://discordapp.com/oauth2/authorize?client_id=12345678&scope=bot&permissions=66186303 with it. Go to that link and you will be able to add your bot to your server. - Start NadekoBot.exe. In a text channel, **not a direct message**, type in [.uid @______] without the brackets, filling in the underlined portion with your name and send the message. Your bot will reply with a number; this is your ID. Copy this ID and close NadekoBot.exe. - Reopen credentials.json. Paste your ID into the square brackets ("OwnerIds": [1231312313]). You can add multiple owners by separating IDs with a comma. Close and save credentials.json. From b90cb958c9cb06fa2958b754465a8dfb2f92b365 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sat, 23 Apr 2016 08:39:08 +0200 Subject: [PATCH 2/3] message repeater fix? --- NadekoBot/Modules/Administration/Commands/MessageRepeater.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs b/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs index 09161ab8..ca41ad41 100644 --- a/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs +++ b/NadekoBot/Modules/Administration/Commands/MessageRepeater.cs @@ -68,7 +68,7 @@ namespace NadekoBot.Modules.Administration.Commands { await e.Channel.SendMessage("Repeating disabled").ConfigureAwait(false); Repeater rep; - if (repeaters.TryGetValue(e.Server, out rep)) + if (repeaters.TryRemove(e.Server, out rep)) rep.MessageTimer.Stop(); return; } From 207539317d2ff38cb24c9ae6022f61106d33dcdf Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sat, 23 Apr 2016 08:40:01 +0200 Subject: [PATCH 3/3] .announce command, thx to @Delicious-Flatbread --- .../Modules/Administration/AdministrationModule.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/NadekoBot/Modules/Administration/AdministrationModule.cs b/NadekoBot/Modules/Administration/AdministrationModule.cs index 5fc0e4c6..04452192 100644 --- a/NadekoBot/Modules/Administration/AdministrationModule.cs +++ b/NadekoBot/Modules/Administration/AdministrationModule.cs @@ -810,6 +810,20 @@ namespace NadekoBot.Modules.Administration Console.WriteLine(ex); } }); + + 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") + .Parameter("msg", ParameterType.Unparsed) + .AddCheck(SimpleCheckers.OwnerOnly()) + .Do(async e => + { + foreach (var ch in NadekoBot.Client.Servers.Select(s => s.DefaultChannel)) + { + await ch.SendMessage(e.GetArg("msg")); + } + + await e.Channel.SendMessage(":ok:"); + }); }); }