diff --git a/NadekoBot/Modules/Administration/Commands/CustomReactionsCommands.cs b/NadekoBot/Modules/Administration/Commands/CustomReactionsCommands.cs index 575e2493..7ed71e8b 100644 --- a/NadekoBot/Modules/Administration/Commands/CustomReactionsCommands.cs +++ b/NadekoBot/Modules/Administration/Commands/CustomReactionsCommands.cs @@ -22,7 +22,7 @@ namespace NadekoBot.Modules.Administration.Commands cgb.CreateCommand(Prefix + "addcustreact") .Alias(Prefix + "acr") - .Description($"Add a custom reaction. Guide here: **Bot Owner Only!** | `{Prefix}acr \"hello\" Hi there %user%`") + .Description($"Add a custom reaction. Guide here: **Bot Owner Only!** | `{Prefix}acr \"hello\" Hi there %user%`") .AddCheck(SimpleCheckers.OwnerOnly()) .Parameter("name", ParameterType.Required) .Parameter("message", ParameterType.Unparsed) @@ -145,7 +145,7 @@ namespace NadekoBot.Modules.Administration.Commands cgb.CreateCommand(Prefix + "delcustreact") .Alias(Prefix + "dcr") - .Description($"Deletes a custom reaction with given name (and index). **Bot Owner Only.**| `{Prefix}dcr index`") + .Description($"Deletes a custom reaction with given name (and optional index). **Bot Owner Only.**| `{Prefix}dcr \"Reaction Name\"` or `{Prefix}dcr \"Reaction Name\" 3`") .Parameter("name", ParameterType.Required) .Parameter("index", ParameterType.Optional) .AddCheck(SimpleCheckers.OwnerOnly()) diff --git a/NadekoBot/Modules/Administration/Commands/LogCommand.cs b/NadekoBot/Modules/Administration/Commands/LogCommand.cs index 87a0723e..21973116 100644 --- a/NadekoBot/Modules/Administration/Commands/LogCommand.cs +++ b/NadekoBot/Modules/Administration/Commands/LogCommand.cs @@ -21,7 +21,7 @@ namespace NadekoBot.Modules.Administration.Commands { NadekoBot.OnReady += () => { - NadekoBot.Client.MessageReceived += MsgRecivd; + //NadekoBot.Client.MessageReceived += MsgRecivd; NadekoBot.Client.MessageDeleted += MsgDltd; NadekoBot.Client.MessageUpdated += MsgUpdtd; NadekoBot.Client.UserUpdated += UsrUpdtd; @@ -202,35 +202,35 @@ namespace NadekoBot.Modules.Administration.Commands catch { } } - private async void MsgRecivd(object sender, MessageEventArgs e) - { - try - { - if (e.Server == null || e.Channel.IsPrivate || e.User.Id == NadekoBot.Client.CurrentUser.Id) - return; - var config = SpecificConfigurations.Default.Of(e.Server.Id); - var chId = config.LogServerChannel; - if (chId == null || e.Channel.Id == chId || config.LogserverIgnoreChannels.Contains(e.Channel.Id)) - return; - Channel ch; - if ((ch = e.Server.TextChannels.Where(tc => tc.Id == chId).FirstOrDefault()) == null) - return; - if (!string.IsNullOrWhiteSpace(e.Message.Text)) - { - await ch.SendMessage( - $@"🕔`{prettyCurrentTime}` **New Message** `#{e.Channel.Name}` -👤`{e.User?.ToString() ?? ("NULL")}` {e.Message.Text.Unmention()}").ConfigureAwait(false); - } - else - { - await ch.SendMessage( - $@"🕔`{prettyCurrentTime}` **File Uploaded** `#{e.Channel.Name}` -👤`{e.User?.ToString() ?? ("NULL")}` {e.Message.Attachments.FirstOrDefault()?.ProxyUrl}").ConfigureAwait(false); - } + // private async void MsgRecivd(object sender, MessageEventArgs e) + // { + // try + // { + // if (e.Server == null || e.Channel.IsPrivate || e.User.Id == NadekoBot.Client.CurrentUser.Id) + // return; + // var config = SpecificConfigurations.Default.Of(e.Server.Id); + // var chId = config.LogServerChannel; + // if (chId == null || e.Channel.Id == chId || config.LogserverIgnoreChannels.Contains(e.Channel.Id)) + // return; + // Channel ch; + // if ((ch = e.Server.TextChannels.Where(tc => tc.Id == chId).FirstOrDefault()) == null) + // return; + // if (!string.IsNullOrWhiteSpace(e.Message.Text)) + // { + // await ch.SendMessage( + // $@"🕔`{prettyCurrentTime}` **New Message** `#{e.Channel.Name}` + //👤`{e.User?.ToString() ?? ("NULL")}` {e.Message.Text.Unmention()}").ConfigureAwait(false); + // } + // else + // { + // await ch.SendMessage( + // $@"🕔`{prettyCurrentTime}` **File Uploaded** `#{e.Channel.Name}` + //👤`{e.User?.ToString() ?? ("NULL")}` {e.Message.Attachments.FirstOrDefault()?.ProxyUrl}").ConfigureAwait(false); + // } - } - catch { } - } + // } + // catch { } + // } private async void MsgDltd(object sender, MessageEventArgs e) { try diff --git a/NadekoBot/Modules/Games/Commands/TriviaCommand.cs b/NadekoBot/Modules/Games/Commands/TriviaCommand.cs index 75481309..3a24eebb 100644 --- a/NadekoBot/Modules/Games/Commands/TriviaCommand.cs +++ b/NadekoBot/Modules/Games/Commands/TriviaCommand.cs @@ -33,8 +33,11 @@ namespace NadekoBot.Modules.Games.Commands int num; return new Tuple(int.TryParse(s, out num), num); }).Where(t => t.Item1).Select(t => t.Item2).FirstOrDefault(); - if (number < 0) + if (number < 3) + { + await e.Channel.SendMessage("Number too small."); return; + } var triviaGame = new TriviaGame(e, showHints, number == 0 ? 10 : number); if (RunningTrivias.TryAdd(e.Server.Id, triviaGame)) await e.Channel.SendMessage($"**Trivia game started! {triviaGame.WinRequirement} points needed to win.**").ConfigureAwait(false); diff --git a/NadekoBot/Modules/Permissions/Classes/PermissionHelper.cs b/NadekoBot/Modules/Permissions/Classes/PermissionHelper.cs index c972953e..d4a07e21 100644 --- a/NadekoBot/Modules/Permissions/Classes/PermissionHelper.cs +++ b/NadekoBot/Modules/Permissions/Classes/PermissionHelper.cs @@ -59,7 +59,7 @@ namespace NadekoBot.Modules.Permissions.Classes foreach (var com in NadekoBot.Client.GetService().AllCommands) { - if (com.Text.ToUpperInvariant().Equals(normalizedCmdTxt) || com.Aliases.Select(c=>c.ToUpperInvariant()).Contains(normalizedCmdTxt)) + if (com.Text.ToUpperInvariant().Equals(normalizedCmdTxt) || com.Aliases.Select(c => c.ToUpperInvariant()).Contains(normalizedCmdTxt)) return com.Text; } throw new NullReferenceException("That command does not exist."); diff --git a/NadekoBot/Modules/Searches/Commands/StreamNotifications.cs b/NadekoBot/Modules/Searches/Commands/StreamNotifications.cs index 1513d0e7..f1bfb084 100644 --- a/NadekoBot/Modules/Searches/Commands/StreamNotifications.cs +++ b/NadekoBot/Modules/Searches/Commands/StreamNotifications.cs @@ -109,13 +109,13 @@ namespace NadekoBot.Modules.Searches.Commands cachedStatuses.TryAdd(hitboxUrl, result); return result; case StreamNotificationConfig.StreamType.Twitch: - var twitchUrl = $"https://api.twitch.tv/kraken/streams/{Uri.EscapeUriString(stream.Username)}"; + var twitchUrl = $"https://api.twitch.tv/kraken/streams/{Uri.EscapeUriString(stream.Username)}?client_id=67w6z9i09xv2uoojdm9l0wsyph4hxo6"; if (checkCache && cachedStatuses.TryGetValue(twitchUrl, out result)) return result; response = await SearchHelper.GetResponseStringAsync(twitchUrl).ConfigureAwait(false); data = JObject.Parse(response); isLive = !string.IsNullOrWhiteSpace(data["stream"].ToString()); - result = new Tuple(isLive, isLive ? data["stream"]["viewers"].ToString() : "0"); + result = new Tuple(isLive, isLive ? data["stream"]["viewers"].ToString() : stream.Username); cachedStatuses.TryAdd(twitchUrl, result); return result; case StreamNotificationConfig.StreamType.Beam: @@ -131,7 +131,7 @@ namespace NadekoBot.Modules.Searches.Commands default: break; } - return new Tuple(false, "0"); + return new Tuple(false, "NOT_FOUND"); } internal override void Init(CommandGroupBuilder cgb) @@ -180,7 +180,11 @@ namespace NadekoBot.Modules.Searches.Commands })); if (streamStatus.Item1) { - await e.Channel.SendMessage($"`Streamer {streamStatus.Item2} is online.`"); + await e.Channel.SendMessage($"`Streamer {stream} is online with {streamStatus.Item2} viewers.`"); + } + else + { + await e.Channel.SendMessage($"`Streamer {stream} is offline.`"); } } catch @@ -209,7 +213,11 @@ namespace NadekoBot.Modules.Searches.Commands })); if (streamStatus.Item1) { - await e.Channel.SendMessage($"`Streamer {streamStatus.Item2} is online.`"); + await e.Channel.SendMessage($"`Streamer {stream} is online with {streamStatus.Item2} viewers.`"); + } + else + { + await e.Channel.SendMessage($"`Streamer {stream} is offline.`"); } } catch @@ -238,7 +246,11 @@ namespace NadekoBot.Modules.Searches.Commands })); if (streamStatus.Item1) { - await e.Channel.SendMessage($"`Streamer {streamStatus.Item2} is online.`"); + await e.Channel.SendMessage($"`Streamer {stream} is online with {streamStatus.Item2} viewers.`"); + } + else + { + await e.Channel.SendMessage($"`Streamer {stream} is offline.`"); } } catch diff --git a/NadekoBot/NadekoBot.cs b/NadekoBot/NadekoBot.cs index a66de25d..41bbada1 100644 --- a/NadekoBot/NadekoBot.cs +++ b/NadekoBot/NadekoBot.cs @@ -204,7 +204,7 @@ namespace NadekoBot return; } #if NADEKO_RELEASE - await Task.Delay(220000).ConfigureAwait(false); + await Task.Delay(300000).ConfigureAwait(false); #else await Task.Delay(1000).ConfigureAwait(false); #endif diff --git a/NadekoBot/NadekoBot.csproj b/NadekoBot/NadekoBot.csproj index 223f778f..ae5e378e 100644 --- a/NadekoBot/NadekoBot.csproj +++ b/NadekoBot/NadekoBot.csproj @@ -204,6 +204,11 @@ + + True + True + Resources.resx + @@ -294,11 +299,6 @@ - - True - True - Resources.resx - @@ -324,13 +324,10 @@ PublicResXFileCodeGenerator - Resources.Designer.cs Designer + Resources.Designer.cs - - - diff --git a/NadekoBot/Properties/Resources.Designer.cs b/NadekoBot/Properties/Resources.Designer.cs index 5ebaee77..7a7bb7a4 100644 --- a/NadekoBot/Properties/Resources.Designer.cs +++ b/NadekoBot/Properties/Resources.Designer.cs @@ -580,16 +580,6 @@ namespace NadekoBot.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap hidden { - get { - object obj = ResourceManager.GetObject("hidden", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/NadekoBot/Properties/Resources.resx b/NadekoBot/Properties/Resources.resx index 98d2c435..b1b62029 100644 --- a/NadekoBot/Properties/Resources.resx +++ b/NadekoBot/Properties/Resources.resx @@ -136,9 +136,6 @@ ..\resources\images\coins\heads.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\resources\images\hidden.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\resources\images\cards\jack_of_clubs.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/NadekoBot/_Models/JSONModels/Configuration.cs b/NadekoBot/_Models/JSONModels/Configuration.cs index e01da5cf..499609ac 100644 --- a/NadekoBot/_Models/JSONModels/Configuration.cs +++ b/NadekoBot/_Models/JSONModels/Configuration.cs @@ -99,6 +99,12 @@ namespace NadekoBot.Classes.JSONModels } }, { "%mention% omega yato", new List() { "https://cdn.discordapp.com/attachments/168617088892534784/221047921410310144/Yato_Animated.gif" + } }, + { "%mention% smack", new List() { + "%target% https://66.media.tumblr.com/dd5d751f86002fd4a544dcef7a9763d6/tumblr_mjpheaAVj51s725bno1_500.gif", + "%target% https://media.giphy.com/media/jLeyZWgtwgr2U/giphy.gif", + "%target% http://orig11.deviantart.net/2d34/f/2013/339/1/2/golden_time_flower_slap_gif_by_paranoxias-d6wv007.gif", + "%target% http://media.giphy.com/media/LB1kIoSRFTC2Q/giphy.gif", } } }; @@ -192,7 +198,7 @@ For a specific command help, use `{0}h ""Command name""` (for example `-h ""!m q **LIST OF COMMANDS CAN BE FOUND ON THIS LINK** - + Nadeko Support Server: "; diff --git a/NadekoBot/bin/Debug/data/config_example.json b/NadekoBot/bin/Debug/data/config_example.json index 446ce36e..5c9bb0a4 100644 --- a/NadekoBot/bin/Debug/data/config_example.json +++ b/NadekoBot/bin/Debug/data/config_example.json @@ -91,6 +91,21 @@ ], "%mention% archer": [ "http://i.imgur.com/Bha9NhL.jpg" + ], + "%mention% formuoli": [ + "http://i.imgur.com/sCHYQhl.jpg" + ], + "%mention% mei": [ + "http://i.imgur.com/Xkrf5y7.png" + ], + "%mention% omega yato": [ + "https://cdn.discordapp.com/attachments/168617088892534784/221047921410310144/Yato_Animated.gif" + ], + "%mention% smack": [ + "%target% https://66.media.tumblr.com/dd5d751f86002fd4a544dcef7a9763d6/tumblr_mjpheaAVj51s725bno1_500.gif", + "%target% https://media.giphy.com/media/jLeyZWgtwgr2U/giphy.gif", + "%target% http://orig11.deviantart.net/2d34/f/2013/339/1/2/golden_time_flower_slap_gif_by_paranoxias-d6wv007.gif", + "%target% http://media.giphy.com/media/LB1kIoSRFTC2Q/giphy.gif" ] }, "RotatingStatuses": [], @@ -143,5 +158,5 @@ "CurrencySign": "🌸", "CurrencyName": "NadekoFlower", "DMHelpString": "Type `-h` for help.", - "HelpString": "You can use `{0}modules` command to see a list of all modules.\r\nYou can use `{0}commands ModuleName`\r\n(for example `{0}commands Administration`) to see a list of all of the commands in that module.\r\nFor a specific command help, use `{0}h \"Command name\"` (for example `-h \"!m q\"`)\r\n\r\n\r\n**LIST OF COMMANDS CAN BE FOUND ON THIS LINK**\r\n\r\n\r\n\r\nNadeko Support Server: " + "HelpString": "You can use `{0}modules` command to see a list of all modules.\r\nYou can use `{0}commands ModuleName`\r\n(for example `{0}commands Administration`) to see a list of all of the commands in that module.\r\nFor a specific command help, use `{0}h \"Command name\"` (for example `-h \"!m q\"`)\r\n\r\n\r\n**LIST OF COMMANDS CAN BE FOUND ON THIS LINK**\r\n\r\n\r\n\r\nNadeko Support Server: " } \ No newline at end of file diff --git a/NadekoBot/resources/images/hidden.png b/NadekoBot/resources/images/hidden.png deleted file mode 100644 index 11bcc55b..00000000 Binary files a/NadekoBot/resources/images/hidden.png and /dev/null differ diff --git a/NadekoBot/resources/images/rip/rip.png b/NadekoBot/resources/images/rip/rip.png new file mode 100644 index 00000000..6225b171 Binary files /dev/null and b/NadekoBot/resources/images/rip/rip.png differ diff --git a/NadekoBot/resources/images/rip/rose_overlay.png b/NadekoBot/resources/images/rip/rose_overlay.png new file mode 100644 index 00000000..767dcd1a Binary files /dev/null and b/NadekoBot/resources/images/rip/rose_overlay.png differ diff --git a/docs/Frequently Asked Questions.md b/docs/Frequently Asked Questions.md index 56be8a9c..c472a08d 100644 --- a/docs/Frequently Asked Questions.md +++ b/docs/Frequently Asked Questions.md @@ -1,45 +1,70 @@ -Frequently Asked Questions -####Q1: How do I get @Nadeko to join my server? -A: Send her a Direct Message with -h to get the link. Only Server Owners can allow the bot to join -####Q2: I want to change permissions, but it doesn't work D: -A: To change permissions, you have to set the ;permsrole (default permission role is called `Nadeko`, you can create a role named like that and assign it to yourself). *Only the owner of the server can change permissions without having this role.* -####Q3: Music doesn't work on a Mac?! -You have to build `mono` from source - [Mono Source][Mono Source]. -####Q5: I want to disable NSFW on my server, please? -A: You would first have to be able to change permissions (see Q4 ), and then run `;sm NSFW disable` -####Q6: How do I get NadekoFlowers/whatever I changed my currency to? -A: You get NadekoFlowers by answering Trivia questions or picking them up after they have been generated with `>gc`, which you can then either plant (give away to a channel so that someone can pick it), gamble it with $betflip, $betroll and $jr, or spend on healing and setting your type in the Pokemon game. -####Q7: I have an issue/bug/suggestion, where can I get it noticed? -A: First of all, check [Issues][Issues] and `#suggestions` for your problem/improvement. If it's not there, create a new issue on [Issues][Issues]. -####Q8: How do I use the command XXXX? -A: most commands have a description, with a usage guide if required; use -h command, like -h ;pr -####Q9: Music doesn't work!? -A: Music on @Nadeko will be re-enabled in the future, but for now your only option is to host yourself -If you are hosting your own bot, make sure ffmpeg is working correctly; running ffmpeg in the commandline should have a response. see [Guide](guides/Windows Guide.md) for more -####Q10: My music is still not working/very laggy? -A: Try switching server location, try giving the bot permissions on the server you want to use it on. -####Q12: I want to change data in the database (like NadekoFlowers or the pokemontypes of users, but how? -A: Open data/nadekobot.sqlite using sqlitebrowser (or some alternative), Browse Data, select relevant table, change data, Write changes -####Q13: The .greet and .bye commands doesn't work, but everything else is (From @Kong) -A: Set a greeting message by using .greetmsg YourMessageHere -and a bye-message by using .byemsg YourMessageHere -####Q15: How to import certs on linux? -A: -`certmgr -ssl https://discordapp.com` -`certmgr -ssl https://gateway.discord.gg` -####Q16: I want "BOT" tag with my bot and I can't follow up with Q14, is there a simple way? -A: Yes, you can create an application using your account and use the APP BOT USER TOKEN from here: [DiscordApp][DiscordApp] -NOTE: This will create a new bot account -####Q17: I made an application following Q16, but I can't add that new bot to my server, how do I invite it to my server? -A: You need to use oauth link to add it to you server, just copy your CLIENT ID (that's in the same Developer page where you brought your token) and replace `12345678` in the link below: -`https://discordapp.com/oauth2/authorize?client_id=12345678&scope=bot&permissions=66186303` -FOLLOW THIS [DETAILED GUIDE][DETAILED GUIDE] IF IT IS HARD FOR YOU TO UNDERSTAND -####Q18: I'm building NadekoBot from source, but I get hundreds of (namespace) errors without changing anything!? -A: Using Visual Studio, you can solve these errors by going to Tools -> `NuGet Package Manager -> Manage NuGet Packages` for Solution. Go to the Installed tab, select the Packages that were missing (usually `Newtonsoft.json` and `RestSharp`) and install them for all projects -####Q19: My bot has all permissions but it's still saying, "Failed to add roles. Bot has insufficient permissions.", how do I fix this? -A: Discord has added few new features and roles now follow hierarchy, that means you need to place your bot role above every-other role your server has. Also do NOTE that bot can only set/add all roles below its own highest role. And can not assign it's "highest role" to anyone else. +#Frequently Asked Questions -[Mono Source]:http://www.mono-project.com/docs/compiling-mono/mac/ -[Issues]: https://github.com/Kwoth/NadekoBot/issues -[DiscordApp]: https://discordapp.com/developers/applications/me -[DETAILED GUIDE]: http://discord.kongslien.net/guide.html + +###Question 1: How do I get Nadeko to join my server? +---- +**Answer:** Simply send Nadeko a Direct Message with -h and follow the link. **Only Server Owners can add the bot to the server** +###Question 2: I want to change permissions, but it isn't working! +---- +**Answer:** You must have the ;permsrole (by default this is the "Nadeko" role, for more details on permissions check [here](http://nadekobot.readthedocs.io/en/latest/Permissions%20System/ "Permissions")) + +**Please note:** *Only the Server Owner can change permissions without the "Nadeko" role*. +###Question 3: Music isn't working on Mac!! +---- +**Answer:** You will have to build `mono` from source. Simply follow the [mono-guide](http://www.mono-project.com/docs/compiling-mono/mac/ "Building mono"). +###Question 4: I want to disable NSFW on my server. +---- +**Answer:** To disable the NSFW Module for your server type, `;sm NSFW disable`. If this does not work refer to Question 2. +###Question 5: How do I get NadekoFlowers/Currency? +---- +**Answer:** You get NadekoFlowers by answering Trivia questions or picking them up after they have been generated with `>gc`, which you can then either plant (give away to a channel so that someone can pick it), gamble it with `$betflip`, `$betroll` and `$jr`, or spend on healing and setting your type in the Pokemon game. +###Question 6: I have an issue/bug/suggestion, where do I put it so it gets noticed? +----------- +**Answer:** First, check [issues](https://github.com/Kwoth/NadekoBot/issues "GitHub NadekoBot Issues"), then check the `#suggestions` in the Nadeko [help server](https://discord.gg/0ehQwTK2RBjAxzEY). + +If your problem or suggestion is not there, feel free to request it either in Issues or in `#suggestions`. +###Question 7: How do I use this command? +-------- +**Answer:** You can see the description and usage of certain commands by using `-h command` **i.e** `-h ;sm`. + +The whole list of commands can be found [here](http://nadekobot.readthedocs.io/en/latest/Commands%20List/ "Command List") +###Question 8: Music isn't working? +---- +**Answer:** Music is disabled on public Nadeko, it will be re-enabled later in the future. + +**If you would like music you must host Nadeko yourself**. Be sure you have FFMPEG installed correctly, read the [guide](http://nadekobot.readthedocs.io/en/latest/guides/Windows%20Guide/) for more info. +###Question 9: My music is still not working/very laggy? +---- +**Answer:** Try changing your discord [location][1], if this doesn't work be sure you have enabled the correct permissions for Nadeko. +[1]: https://support.discordapp.com/hc/en-us/articles/216661717-How-do-I-change-my-Voice-Server-Region- +###Question 10: I want to change data in the database (like NadekoFlowers or the pokemontypes of users, but how? +---- +**Answer:** Open data/nadekobot.sqlite using sqlitebrowser (or some alternative), Browse Data, select relevant table, change data, Write changes +###Question 11: The .greet and .bye commands doesn't work, but everything else is (From @Kong) +----- +**Answer:** Set a greeting message by using `.greetmsg YourMessageHere` and a bye-message by using `.byemsg YourMessageHere` +###Question 12: How do I import certs on linux? +------- +**Answer:** + +`certmgr -ssl https://discordapp.com` + +`certmgr -ssl https://gateway.discord.gg` +###Question 13: I want "BOT" tag with my bot a, is there a simple way? +---- +**Answer:** Yes, you can create an application using your account and use the APP BOT USER TOKEN from here: [DiscordApp][1] **NOTE: This will create a new bot account** +[1]:https://discordapp.com/developers/applications/me + +###Question 14: I made an application, but I can't add that new bot to my server, how do I invite it to my server? +---- +**Answer:** You need to use oauth link to add it to you server, just copy your CLIENT ID (that's in the same Developer page where you brought your token) and replace `12345678` in the link below: https://discordapp.com/oauth2/authorize?client_id=12345678&scope=bot&permissions=66186303 + +Follow this Detailed [Guide](http://discord.kongslien.net/guide.html) if you do not understand. +###Question 15:I'm building NadekoBot from source, but I get hundreds of (namespace) errors without changing anything!? +----- +**Answer:** Using Visual Studio, you can solve these errors by going to `Tools` -> `NuGet Package Manager` -> `Manage NuGet Packages for Solution`. Go to the Installed tab, select the Packages that were missing (usually `Newtonsoft.json` and `RestSharp`) and install them for all projects +###Question 16: My bot has all permissions but it's still saying, "Failed to add roles. Bot has insufficient permissions.". How do I fix this? +---------- +**Answer:** Discord has added a few new features and roles now follow hierarchy. This means you need to place your bot's role above every-other role your server has. + +**Please Note:** *The bot can only set/add all roles below its own highest role. It can not assign it's "highest role" to anyone else.* diff --git a/docs/JSON Explanations.md b/docs/JSON Explanations.md index fb299141..8d1cf6c2 100644 --- a/docs/JSON Explanations.md +++ b/docs/JSON Explanations.md @@ -1,42 +1,60 @@ -###Credentials.json and config.json -**This is how unedited credentials.json looks like:** +###Setting up your Credentials +If you do not see `credentials.json` you will need to rename `credentials_example.json` to `credentials.json`. + +**This is how the unedited credentials look:** ```json { "Token": "", "ClientId": "116275390695079945", "BotId": 1231231231231, "OwnerIds": [ - 123123123123, - 5675675679845 + 123123123123, + 5675675679845 ], "GoogleAPIKey": "", "SoundCloudClientID": "", "MashapeKey": "", - "LOLAPIKey": "", - "TrelloAppKey": "", + "LOLAPIKEY": "", + "TrelloAPPKey": "", "OsuAPIKey": "", - "CarbonKey": "" + "CarbonKey": "", } ``` -#### Required -- **Token** - Required to log in. See this [guide](http://discord.kongslien.net/guide.html) -- **OwnerIds** - Required for Owner-Only commands to work. Separate multiple IDs with a comma -- **BotId** - Required for custom reactions and conversation commands to work. +####Required Parts ++ **Token** - Required to log in. Refer to this [guide](http://discord.kongslien.net/guide.html) ++ **OwnerIds** - Required for the **Owner-Only** commands. Seperate multiple Id's with a comma. ++ **BotId** - Required for custom reactions and conversation commands to work. + + **Important : Bot ID and Client ID are the same in newer bot accounts due to recent Discord API changes.** -*BotId and OwnerIds are NOT names of the owner and the bot. If you do not know the id of your bot, put 2 random numbers in those fields, run the bot and do `.uid @MyBotName` - that will give you your bot\_id, do the same for yourself `.uid @MyName` and you will get a number to put inside brackets in OwnerIds field.* +_BotId and the OwnerIds are **NOT** the names of the owner and the bot. If you do not know the id of your bot, keep the two random numbers in those fields and +run the bot then do `.uid @MyBotName` - this will give you your bot_id. +Do the same for yourself with `.uid @MyName` Put these numbers in their respective field of the credentials._ -#### Optional -- **GoogleAPIKey** - Youtube song search. Playlist queuing. URL Shortener. ~i and ~img. -- **SoundCloudClientID** - Needed in order to queue soundcloud songs from sc links. For the Soundcloud Api key you need a Soundcloud account. You need to create a new app on [SoundcloudApp][SoundcloudApp] and after that go here [Your SC Apps][Your SC Apps] click on the name of your created your app and copy the Client ID. Paste it into credentials.json. -- **MashapeKey** - Urban dictionary, hashtag search, hearthstone cards.You need to create an account on their api marketplace here [Mashape][Mashape]. After that you need to go to `market.mashape.com/YOURNAMEHERE/applications/default-application` and press GET THE KEYS in the right top corner copy paste it into your `credentials.json` and you are ready to race! -- **LOLAPIKey** - [Champion.gg][Champion.gg] api key needed for LoL commands -- **TrelloAppKey** - Needed for trello commands -- **OsuAPIKey** - needed for osu top5 and beatmap commands. -- **CarbonKey** - carbonitex.net key if your bot is listed there in order to send stats (probably nobody needs this) +Setting up your API keys +==================== +####This part is completely optional, **However it is necessary for music to work properly** ++ **GoogleAPIKey** - Required for Youtube Song Search, Playlist queuing, and URL Shortener. `~i` and `~img`. + + You can get this api Key [here](https://console.developers.google.com/apis) ++ **SoundCloudClientID** - Required to queue soundloud songs from sc links. + + You will need to create a new app [here](http://soundcloud.com/you/apps). **Please note you must be logged into SoundCloud** + + You should come to a page that looks like this ![Imgur](http://i.imgur.com/RAZ2HDM.png) + + Simply click Register a new application and enter a name. + + After naming your app you will be brought to this page: ![Imgur](http://i.imgur.com/GH1gjKK.png) Copy the Client ID and click "save app" then paste the Client Id it into your `credentials.json` ++ **MashapeKey** - Required for Urban Disctionary, Hashtag search, and Hearthstone cards. + + You need to create an account on their [api marketplace](https://market.mashape.com/), after that go to `market.mashape.com/YOURNAMEHERE/applications/default-application` and press **Get the keys** in the top right corner. + + Copy the key and paste it into `credentials.json` ++ **LOLAPIKey** - Required for all League of Legends commands. + + You can get this key [here](http://api.champion.gg/) ++ **TrelloAppKey** - Required for the trello commands. + + You can get this key [here](https://trello.com/app-key) **Be sure you are logged into Trello first** ++ **OsuAPIKey** - Required for Osu commands + + You can get this key [here](https://osu.ppy.sh/p/api) **You will need to log in and like the soundcloud it may take a few tries** ++ **CarbonKey** -This key is for Carobnitex.net stats. + + Most likely unnecessary **Needed only if your bot is listed on Carbonitex.net** -Next to your exe you must also have a `data folder` in which there is `config.jso`n (among other things) which will contain some user specific config, like should the Bot join servers, should DMs to bot be forwarded to you and a list of IDs of blacklisted users, channels and servers. If you do not have `config.json`, you should rename `config_example.json` to `config.json`. +Config.json +=========== +In the folder where `NadekoBot.exe` is located you should also see a `Data` folder. In this folder you will find `config.json` among other files. +`config.json` contains user specific commands, such as: if DM's sent to the bot are forwarded to you, Blacklisted Ids, Servers, and channels...etc. -[SoundcloudApp]: http://soundcloud.com/you/apps/new -[Your SC Apps]: http://soundcloud.com/you/apps -[Mashape]: https://market.mashape.com/ -[Champion.gg]: www.champion.gg +**If you do not see** `config.json` **you need to rename** `config_example.json` **to** `config.json` diff --git a/docs/Permissions System.md b/docs/Permissions System.md index 23a697cc..321c5c4f 100644 --- a/docs/Permissions System.md +++ b/docs/Permissions System.md @@ -1,67 +1,79 @@ -# Overview -Ever stuck handling your Nadeko permissions? Look no further than this guide! -We'll handle a few example cases that we've seen frequently on the help channel, as well as explaining the order of permissions in general. Any command used here can be found in the [Commands list](Commands List.md#permissions) +Permissions Overview +=================== +Have you ever felt confused or even overwhelmed when trying to set Nadeko's permissions? In this guide we will be explaining how to use the +permission commands correctly and even cover a few common questions! Every command we discuss here can be found in the [Commands List](http://nadekobot.readthedocs.io/en/latest/Commands%20List/#permissions). -# How does it work? -Permissions are handy to set up to limit who in your server can use what. by default, every command is enabled for everyone, except for the administration commands, like `.kick` and `.prune`, which are set to correspond to discord's permissions, (kicking and managing messages respectively here), the permissions module, which we will show in the next paragraph, and some other commands throughout the other modules that are owner-only, meaning that only someone who has his or her id in the list of owners of the bot can use them. -Since you may not want to allow everyone to use the NSFW module, skip the current song, pick up flowers, or attack in the pokegame, you're in need of setting up permissions. +Why do we use the Permissions Commands? +------------------------------ +Permissions are very handy for setting who can use what commands in your server. By default, every command is enabled for everybody, however a few exclusions are the Administration Commands like, `.kick` and `.prune` and Bot Owner-Only commands as these require your id to be in [`credentials.json`](http://nadekobot.readthedocs.io/en/latest/JSON%20Explanations/ "Setting up your credentials"). +With the Permission Commands it is possible to restrict who can skip the current song, pick NadekoFlowers, or even use the NSFW module. -#First time setting up -When you want to change your first permissions, you need to fulfill one of two conditions: -* Be the owner of the server -* Have the role set by `;permrole` (Nadeko by default) +First Time Setup +------------------ +To change permissions you must meet one of two requirements, either: ++ **Be the Server Owner** ++ Have the role specified by `;permrole` (is Nadeko by default). -If you have neither of these, you **can't** set up permissions. -You may want to change the `;permrole` to the role of the admins, using `;permrole Admins`. +If you meet neither of these requirements, you ***can not*** edit permissions. -# Basics -Most of the commands found in the list are pretty much self-explanatory. `;rolemdl NSFW disable lurkers` would disable the NSFW module for the lurkers (let them come out of the shadows!). similarly `;chnlperms #general` would show which permissions are banned *specifically* for this channel. -Since permissions are enabled by default, the hierarchy of rulings is simple, if you disable something that affects a user, like `;sm nsfw disable`, you **can't** enable it in a particular other way, like `;cm nsfw enable #nsfw`. Now roles are an exemption to this, e.g. if all roles have music disabled except for the DJ role, you can still use music commands if you have the DJ role. +If you would like to allow Admins to edit permissions you may want to rename the `;permrole` to `;permrole Admins` and give each admin that role. -By default, the bot notifies when a command can't be used. To disable this, you can use `;verbose false`. +Basics & Heirachy +----- +Most of the commands found in the list describe what they do, but we will cover a few here. -# Common Cases -These are some common cases of particular settings of permissions. +If you would like to disable the NSFW module for a certain role you would use `;rolemdl NSFW disable SomeRole`. -## Create a music DJ -e.g. you only want your users to be able to see what's playing, and have a DJ role for the rest. -- `;arc music disable all`, disable all commands of the music module for everyone. -- `;arc music enable DJ`, give permissions to the DJ to do everything -- `;rc "!!nowplaying" enable all`, enable the command for everyone -- `;rc "!!getlink" enable all`, as above. -- `;rc "!!listqueue" enable all`, as above. +Similarly you can view which Modules and Commands are banned on a _specific_ channel with `;chnlperms SomeChannel`. -## Create a NSFW channel -You want to only allow NSFW commands in the #nsfw channel. -- `;cm nsfw disable all` disable the nsfw module in every channel. -- `;cm nsfw enable #nsfw` re-enable the nsfw module in the #nsfw channel. +The heirachy of the Permissions are simple. If you disable a Module/command with a command that affects the server, `;sm NSFW disable` you can not then enable it another way such as, `;cm NSFW enable SomeChannel`. Roles are an exemption to this, i.e if all roles except for the DJ Role have music disabled, you can still use music commands if you have the DJ Role. + +The bot, by default will notify you when a command can't be used. To disable this notification simply use `;verbose false`. --- *Thanks to @applemac for writing this guide* +Commonly Asked Questions +--------------- +###How do I create a music DJ? +To allow users to only see the current song and have a DJ role for queuing follow these five steps: -#Old Guide + 1. `;arc music disable all` +1. Disables all music commands for everyone. + 2. `;arc music enable DJ` +1. Gives all music commands to DJ role. + 3. `;rc !!nowplaying enable all` +1. Enables the "nowplaying" command for eveone. + 4. `;rc !!getlink enable all` +1. Enables the "getlink" command for everyone. + 5. `;rc !!listqueue enable all` +1. Enables the "listqueue" command for everyone. +###How do I create an NSFW channel? +You want to only allow NSFW commands in the #nsfw channel. - `;cm nsfw disable all` disable the nsfw module in every channel. - `;cm nsfw enable #nsfw` re-enable the nsfw module in the #nsfw channel. + +_-- Thanks to @applemac for writing this guide_ + +Old Guide +--------- **NadekoBot's permissions can be set up to be very specific through commands in the Permissions module.** Each command or module can be turned on or off at: -- a user level (so specific users can or cannot use a command/module) -- a role level (so only certain roles have access to certain commands/module) -- a channel level (so certain commands can be limited to certain channels, which can prevent music / trivia / NSFW spam in serious channels) -- a server level. +- The user level (so specific users can or cannot use a command/module) +- The role level (so only certain roles have access to certain commands/module) +- The channel level (so certain commands can be limited to certain channels, which can prevent music / trivia / NSFW spam in serious channels) +- The server level. -Use .modules to see a list of modules (sets of commands). -Use .commands [module_name] to see a list of commands in a certain module. +Use `.modules` to see a list of modules (sets of commands). Use `.commands [module_name]` to see a list of commands in a certain module. -Permissions use a semicolon as the prefix, so always start the command with a ;. +Permissions use a semicolon as the prefix, so always start the command with a `;`. -Follow the semicolon with the letter of the level which you want to edit. -- "u" for Users. -- "r" for Roles. -- "c" for Channels. +Follow the semicolon with the letter of the level which you want to edit: +- "u" for Users. +- "r" for Roles. +- "c" for Channels. - "s" for Servers. -Follow the level with whether you want to edit the permissions of a command or a module. -- "c" for Command. +Follow the level with whether you want to edit the permissions of a command or a module. +- "c" for Command. - "m" for Module. Follow with a space and then the command or module name (surround the command with quotation marks if there is a space within the command, for example "!!q" or "!!n"). @@ -70,18 +82,20 @@ Follow that with another space and, to enable it, type one of the following: [1, Follow that with another space and the name of the user, role, channel. (depending on the first letter you picked) -###### Examples #1 -- **;rm NSFW 0 [Role_Name]** Disables the NSFW module for the role, . -- **;cc "!!n" 0 [Channel_Name]** Disables skipping to the next song in the channel, . -- **;uc "!!q" 1 [User_Name]** Enables queuing of songs for the user, . -- **;sm Gambling 0** Disables gambling in the server. +####Examples #1 -Check permissions by using the letter of the level you want to check followed by a p, and then the name of the level in which you want to check. If there is no name, it will default to yourself for users, the @everyone role for roles, and the channel in which the command is sent for channels. +- `;rm NSFW 0 [Role_Name]` Disables the NSFW module for the role, +- `;cc "!!n" 0 [Channel_Name]` Disables skipping to the next song in the channel, +- `;uc "!!q" 1 [User_Name]` Enables queuing of songs for the user, +- `;sm Gambling 0 Disables` gambling in the server. + + Check permissions by using the letter of the level you want to check followed by a p, and then the name of the level in which you want to check. If there is no name, it will default to yourself for users, the @everyone role for roles, and the channel in which the command is sent for channels. -###### Examples #2 -- ;cp [Channel_Name] -- ;rp [Role_Name] +####Examples #2 -Insert an **a** before the level to edit the permission for all commands / modules for all users / roles / channels / server. +- `;cp [Channel_Name]` +- `;rp [Role_Name]` + +Insert an "a" before the level to edit the permission for all commands / modules for all users / roles / channels / server. Reference the Help command (-h) for more Permissions related commands. diff --git a/docs/guides/Linux Guide.md b/docs/guides/Linux Guide.md index cc2b2bdc..1d9953ab 100644 --- a/docs/guides/Linux Guide.md +++ b/docs/guides/Linux Guide.md @@ -68,6 +68,48 @@ tee -a /etc/apt/sources.list.d/mono-xamarin.list` `apt-get install ca-certificates-mono` `mozroots --import --sync` +####Mono Fix Socket Error + +The problem comes from Mono. Mono 4.6 is broken. + +To fix it on debian/ubuntu +``` +apt-get remove mono-complete mono-devel mono-runtime +apt-get autoremove +``` + +Now Check for some mono remaining parts as lib or others things and unistall them +``` +dpkg --get-selections | grep mono +``` +Now unistall them +``` +apt-get remove remainings-parts +``` +Now clzean apt cache +``` +apt get clean +apt-get autoclean +``` + +Check the exact version of Mono 4.2 +``` +apt-cache showpkg mono-devel +``` +And install it +``` +aptitude install mono-devel=version +``` +For me in ubuntu 16.04 it's : +``` +aptitude install mono-devel=4.2.1.102+dfsg2-7ubuntu4 +``` + +It will say if you want to stay in the same state ie uninstalled, say `n` after If will list all dependencies as 4.2 says say `y` + +Mono is now downgraded and installed at 4.2 version :D + + ####Installing Opus Voice Codec **4)** `sudo apt-get install libopus0 opus-tools` @@ -216,7 +258,7 @@ its your session name) so you can run the bot in background without having to ke For how to set up Nadeko for music and Google API Keys, follow [Setting up NadekoBot for Music](Windows Guide.md#setting-up-nadekobot-for-music) -Now time to **move bot to background** and to do that, press **CTRL+B+D** (this will ditach the nadeko session using TMUX), and you can finally close PuTTY now. +Now time to **move bot to background** and to do that, press **CTRL+B+D** (this will detach the nadeko session using TMUX), and you can finally close PuTTY now. Copy your CLIENT ID (that's in the same Developer page where you brought your token) and replace `12345678` in 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. @@ -235,11 +277,10 @@ Open **PuTTY** and login as you have before, type `reboot` and hit Enter. **FOLLOW THESE STEPS SERIALLY** -- **-21 OR 22** -- **-19** - **-16** - **-17** - **-18** +- **-19** - **-20** HIT **CTRL+B+D** and close **PuTTY** diff --git a/docs/guides/OSX Guide.md b/docs/guides/OSX Guide.md index a9161954..4fed4867 100644 --- a/docs/guides/OSX Guide.md +++ b/docs/guides/OSX Guide.md @@ -105,6 +105,13 @@ To build Mono in 64 bit mode instead use this to configure the build: ^this will create a new session named “nadeko” `(you can replace “nadeko” with anything you prefer and remember its your session name)`. +or if you want to use Screen, run: + +`screen -S nadeko` + +^this will create a new screen named “nadeko” `(you can replace “nadeko” with anything you prefer and remember its your +screen name)`. + `cd nadeko` - Start NadekoBot.exe using Mono: @@ -115,6 +122,8 @@ CHECK THE BOT IN DISCORD, IF EVERYTHING IS WORKING Now time to move bot to background and to do that, press CTRL+B+D (this will ditach the nadeko session using TMUX) +*if you used Screen press CTRL+A+D (this will detach the nadeko screen)* + ####Inviting your bot to your server - [Invite Guide][Invite Guide] - Create a new server in Discord. - Copy your `Client ID` from your [DiscordApp][DiscordApp]. @@ -136,12 +145,18 @@ Now time to move bot to background and to do that, press CTRL+B+D (this will dit For Music Setup and API keys check [Setting up NadekoBot for Music](Windows Guide.md#setting-up-nadekobot-for-music) and [JSON Explanations](JSON Explanations.md). -####Some more Info (just in case) +####Some more Info - TMUX -If you want to see the sessions after logging back again, type `tmux ls`, and that will give you the list of sessions running. -If you want to switch to/ see that session, type `tmux a -t nadeko` (nadeko is the name of the session we created before so, replace `“nadeko”` with the session name you created.) -If you want to kill NadekoBot session, type `tmux kill-session -t nadeko` +####Some more Info - Screen + +-If you want to see the sessions after logging back again, type `screen -ls`, and that will give you the list of screens. +-If you want to switch to/ see that screen, type `screen -r nadeko` (nadeko is the name of the screen we created before so, replace `“nadeko”` with the screen name you created.) +-If you want to kill the NadekoBot screen, type `screen -X -S nadeko quit` + [Homebrew]: http://brew.sh/ [Mono]: http://www.mono-project.com/docs/compiling-mono/mac/ [Releases]: https://github.com/Kwoth/NadekoBot/releases diff --git a/docs/guides/Windows Guide.md b/docs/guides/Windows Guide.md index a46a26c4..79137c4b 100644 --- a/docs/guides/Windows Guide.md +++ b/docs/guides/Windows Guide.md @@ -83,7 +83,7 @@ ________________________________________________________________________________ - Go to [Google Console][Google Console] and log in. - Create a new project (name does not matter). Once the project is created, go into "Enable and manage APIs." - Under the "Other Popular APIs" section, enable `URL Shortener API` and `Custom Search Api`. Under the `YouTube APIs` section, enable `YouTube Data API`. - - On the left tab, access `Credentials`. Click `Create Credentials` button. Click on `API Key`, and then `Server Key` in the new window that appears. Enter in a name for the `Server Key`. A new window will appear with your `Google API key`. + - On the left tab, access `Credentials`. Click `Create Credentials` button. Click on `API Key`. A new window will appear with your `Google API key`. - Copy the key. - Open up `credentials.json`. - For `"GoogleAPIKey"`, fill in with the new key we copied.