Merge pull request #4 from Kwoth/dev

Dev
This commit is contained in:
miraai 2016-09-18 18:52:43 +02:00 committed by GitHub
commit e1f7dd7471
14 changed files with 69 additions and 49 deletions

View File

@ -22,7 +22,7 @@ namespace NadekoBot.Modules.Administration.Commands
cgb.CreateCommand(Prefix + "addcustreact") cgb.CreateCommand(Prefix + "addcustreact")
.Alias(Prefix + "acr") .Alias(Prefix + "acr")
.Description($"Add a custom reaction. Guide here: <https://github.com/Kwoth/NadekoBot/wiki/Custom-Reactions> **Bot Owner Only!** | `{Prefix}acr \"hello\" Hi there %user%`") .Description($"Add a custom reaction. Guide here: <http://nadekobot.readthedocs.io/en/latest/Custom%20Reactions> **Bot Owner Only!** | `{Prefix}acr \"hello\" Hi there %user%`")
.AddCheck(SimpleCheckers.OwnerOnly()) .AddCheck(SimpleCheckers.OwnerOnly())
.Parameter("name", ParameterType.Required) .Parameter("name", ParameterType.Required)
.Parameter("message", ParameterType.Unparsed) .Parameter("message", ParameterType.Unparsed)

View File

@ -33,8 +33,11 @@ namespace NadekoBot.Modules.Games.Commands
int num; int num;
return new Tuple<bool, int>(int.TryParse(s, out num), num); return new Tuple<bool, int>(int.TryParse(s, out num), num);
}).Where(t => t.Item1).Select(t => t.Item2).FirstOrDefault(); }).Where(t => t.Item1).Select(t => t.Item2).FirstOrDefault();
if (number < 0) if (number < 3)
{
await e.Channel.SendMessage("Number too small.");
return; return;
}
var triviaGame = new TriviaGame(e, showHints, number == 0 ? 10 : number); var triviaGame = new TriviaGame(e, showHints, number == 0 ? 10 : number);
if (RunningTrivias.TryAdd(e.Server.Id, triviaGame)) if (RunningTrivias.TryAdd(e.Server.Id, triviaGame))
await e.Channel.SendMessage($"**Trivia game started! {triviaGame.WinRequirement} points needed to win.**").ConfigureAwait(false); await e.Channel.SendMessage($"**Trivia game started! {triviaGame.WinRequirement} points needed to win.**").ConfigureAwait(false);

View File

@ -59,7 +59,7 @@ namespace NadekoBot.Modules.Permissions.Classes
foreach (var com in NadekoBot.Client.GetService<CommandService>().AllCommands) foreach (var com in NadekoBot.Client.GetService<CommandService>().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; return com.Text;
} }
throw new NullReferenceException("That command does not exist."); throw new NullReferenceException("That command does not exist.");

View File

@ -109,13 +109,13 @@ namespace NadekoBot.Modules.Searches.Commands
cachedStatuses.TryAdd(hitboxUrl, result); cachedStatuses.TryAdd(hitboxUrl, result);
return result; return result;
case StreamNotificationConfig.StreamType.Twitch: 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)) if (checkCache && cachedStatuses.TryGetValue(twitchUrl, out result))
return result; return result;
response = await SearchHelper.GetResponseStringAsync(twitchUrl).ConfigureAwait(false); response = await SearchHelper.GetResponseStringAsync(twitchUrl).ConfigureAwait(false);
data = JObject.Parse(response); data = JObject.Parse(response);
isLive = !string.IsNullOrWhiteSpace(data["stream"].ToString()); isLive = !string.IsNullOrWhiteSpace(data["stream"].ToString());
result = new Tuple<bool, string>(isLive, isLive ? data["stream"]["viewers"].ToString() : "0"); result = new Tuple<bool, string>(isLive, isLive ? data["stream"]["viewers"].ToString() : stream.Username);
cachedStatuses.TryAdd(twitchUrl, result); cachedStatuses.TryAdd(twitchUrl, result);
return result; return result;
case StreamNotificationConfig.StreamType.Beam: case StreamNotificationConfig.StreamType.Beam:
@ -131,7 +131,7 @@ namespace NadekoBot.Modules.Searches.Commands
default: default:
break; break;
} }
return new Tuple<bool, string>(false, "0"); return new Tuple<bool, string>(false, "NOT_FOUND");
} }
internal override void Init(CommandGroupBuilder cgb) internal override void Init(CommandGroupBuilder cgb)
@ -180,7 +180,11 @@ namespace NadekoBot.Modules.Searches.Commands
})); }));
if (streamStatus.Item1) 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 catch
@ -209,7 +213,11 @@ namespace NadekoBot.Modules.Searches.Commands
})); }));
if (streamStatus.Item1) 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 catch
@ -238,7 +246,11 @@ namespace NadekoBot.Modules.Searches.Commands
})); }));
if (streamStatus.Item1) 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 catch

View File

@ -204,7 +204,7 @@ namespace NadekoBot
return; return;
} }
#if NADEKO_RELEASE #if NADEKO_RELEASE
await Task.Delay(220000).ConfigureAwait(false); await Task.Delay(300000).ConfigureAwait(false);
#else #else
await Task.Delay(1000).ConfigureAwait(false); await Task.Delay(1000).ConfigureAwait(false);
#endif #endif

View File

@ -204,6 +204,11 @@
<Compile Include="Modules\Searches\Commands\OsuCommands.cs" /> <Compile Include="Modules\Searches\Commands\OsuCommands.cs" />
<Compile Include="Modules\Searches\Commands\PokemonSearchCommands.cs" /> <Compile Include="Modules\Searches\Commands\PokemonSearchCommands.cs" />
<Compile Include="Modules\Utility\UtilityModule.cs" /> <Compile Include="Modules\Utility\UtilityModule.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="SQLite.cs" /> <Compile Include="SQLite.cs" />
<Compile Include="_Models\DataModels\TestDataModel.cs" /> <Compile Include="_Models\DataModels\TestDataModel.cs" />
<Compile Include="_Models\DataModels\Incident.cs" /> <Compile Include="_Models\DataModels\Incident.cs" />
@ -294,11 +299,6 @@
<Compile Include="Modules\Trello\TrelloModule.cs" /> <Compile Include="Modules\Trello\TrelloModule.cs" />
<Compile Include="NadekoBot.cs" /> <Compile Include="NadekoBot.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Classes\NadekoStats.cs" /> <Compile Include="Classes\NadekoStats.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -324,13 +324,10 @@
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator> <Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType> <SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="resources\images\hidden.png" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="resources\images\rip.png" /> <None Include="resources\images\rip.png" />
</ItemGroup> </ItemGroup>

View File

@ -580,16 +580,6 @@ namespace NadekoBot.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap hidden {
get {
object obj = ResourceManager.GetObject("hidden", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View File

@ -136,9 +136,6 @@
<data name="heads" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="heads" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\images\coins\heads.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\resources\images\coins\heads.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="hidden" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\images\hidden.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="jack_of_clubs" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="jack_of_clubs" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\images\cards\jack_of_clubs.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\resources\images\cards\jack_of_clubs.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>

View File

@ -99,6 +99,12 @@ namespace NadekoBot.Classes.JSONModels
} }, } },
{ "%mention% omega yato", new List<string>() { { "%mention% omega yato", new List<string>() {
"https://cdn.discordapp.com/attachments/168617088892534784/221047921410310144/Yato_Animated.gif" "https://cdn.discordapp.com/attachments/168617088892534784/221047921410310144/Yato_Animated.gif"
} },
{ "%mention% smack", new List<string>() {
"%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** **LIST OF COMMANDS CAN BE FOUND ON THIS LINK**
<https://github.com/Kwoth/NadekoBot/blob/master/commandlist.md> <http://nadekobot.readthedocs.io/en/latest/Commands%20List/>
Nadeko Support Server: <https://discord.gg/0ehQwTK2RBjAxzEY>"; Nadeko Support Server: <https://discord.gg/0ehQwTK2RBjAxzEY>";

View File

@ -91,6 +91,21 @@
], ],
"%mention% archer": [ "%mention% archer": [
"http://i.imgur.com/Bha9NhL.jpg" "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": [], "RotatingStatuses": [],

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1,69 +1,69 @@
#Frequently Asked Questions #Frequently Asked Questions
Question 1: How do I get Nadeko to join my server? ###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** **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! ###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")) **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*. **Please note:** *Only the Server Owner can change permissions without the "Nadeko" role*.
Question 3: Music isn't working on Mac!! ###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"). **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. ###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. **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? ###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. **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? ###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). **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`. 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? ###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`. **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") 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? ###Question 8: Music isn't working?
---- ----
**Answer:** Music is disabled on public Nadeko, it will be re-enabled later in the future. **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. **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? ###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. **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- [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? ###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 **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) ###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` **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? ###Question 12: How do I import certs on linux?
------- -------
**Answer:** **Answer:**
`certmgr -ssl https://discordapp.com` `certmgr -ssl https://discordapp.com`
`certmgr -ssl https://gateway.discord.gg` `certmgr -ssl https://gateway.discord.gg`
Question 13: I want "BOT" tag with my bot a, is there a simple way? ###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** **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 [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? ###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 **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. 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!? ###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 **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? ###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. **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.