e621 search is now async

This commit is contained in:
Master Kwoth 2016-04-24 13:26:16 +02:00
parent 207539317d
commit 9e79f6822f
2 changed files with 4 additions and 5 deletions

View File

@ -263,9 +263,7 @@ namespace NadekoBot.Classes
{ {
try try
{ {
ServicePointManager.Expect100Continue = true; XDocument doc = await Task.Run(() => XDocument.Load(" http://e621.net/post/index.xml?tags=" + Uri.EscapeUriString(tags) + "%20order:random&limit=1"));
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
XDocument doc = XDocument.Load(" https://e621.net/post/index.xml?tags="+Uri.EscapeUriString(tags)+"%20order:random&limit=1");
int id = Convert.ToInt32(doc.Root.Element("post").Element("id").Value); int id = Convert.ToInt32(doc.Root.Element("post").Element("id").Value);
return (doc.Root.Element("post").Element("file_url").Value); return (doc.Root.Element("post").Element("file_url").Value);
} }

View File

@ -2,7 +2,7 @@
######You can donate on paypal: `nadekodiscordbot@gmail.com` or Bitcoin `17MZz1JAqME39akMLrVT4XBPffQJ2n1EPa` ######You can donate on paypal: `nadekodiscordbot@gmail.com` or Bitcoin `17MZz1JAqME39akMLrVT4XBPffQJ2n1EPa`
#NadekoBot List Of Commands #NadekoBot List Of Commands
Version: `NadekoBot v0.9.5950.11393` Version: `NadekoBot v0.9.5957.32647`
### Administration ### Administration
Command and aliases | Description | Usage Command and aliases | Description | Usage
----------------|--------------|------- ----------------|--------------|-------
@ -74,7 +74,8 @@ Command and aliases | Description | Usage
`.unstuck` | Clears the message queue. **Owner Only!** `.unstuck` | Clears the message queue. **Owner Only!**
`.donators` | List of lovely people who donated to keep this project alive. `.donators` | List of lovely people who donated to keep this project alive.
`.adddon`, `.donadd` | Add a donator to the database. `.adddon`, `.donadd` | Add a donator to the database.
`.videocall` | Creates a private appear.in video call link for you and other mentioned people. The link is sent to mentioned people via a private message. `.videocall` | Creates a private <http://www.appear.in> video call link for you and other mentioned people. The link is sent to mentioned people via a private message.
`.announce` | Sends a message to all servers' general channel bot is connected to.**Owner Only!** | .announce Useless spam
### Help ### Help
Command and aliases | Description | Usage Command and aliases | Description | Usage