.roles updated string, missed af ile

This commit is contained in:
Kwoth 2016-10-15 23:14:28 +02:00
parent 17f76da220
commit 799b6cfae2
3 changed files with 50 additions and 4 deletions

View File

@ -0,0 +1,46 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace NadekoBot.Modules.Searches.Commands.OMDB
{
public static class OmdbProvider
{
private const string queryUrl = "http://www.omdbapi.com/?t={0}&y=&plot=full&r=json";
public static async Task<OmdbMovie> FindMovie(string name)
{
using (var http = new HttpClient())
{
var res = await http.GetStringAsync(String.Format(queryUrl,name.Trim().Replace(' ','+'))).ConfigureAwait(false);
var movie = JsonConvert.DeserializeObject<OmdbMovie>(res);
movie.Poster = await NadekoBot.Google.ShortenUrl(movie.Poster);
return movie;
}
}
}
public class OmdbMovie
{
public string Title { get; set; }
public string Year { get; set; }
public string ImdbRating { get; set; }
public string ImdbId { get; set; }
public string Genre { get; set; }
public string Plot { get; set; }
public string Poster { get; set; }
public override string ToString() =>
$@"`Title:` {Title}
`Year:` {Year}
`Rating:` {ImdbRating}
`Genre:` {Genre}
`Link:` http://www.imdb.com/title/{ImdbId}/
`Plot:` {Plot}";
}
}

View File

@ -5550,7 +5550,7 @@ namespace NadekoBot.Resources {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to List all roles on this server or a single user if specified.. /// Looks up a localized string similar to List roles on this server or a roles of a specific user if specified. Paginated. 20 roles per page..
/// </summary> /// </summary>
public static string roles_desc { public static string roles_desc {
get { get {
@ -5559,7 +5559,7 @@ namespace NadekoBot.Resources {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to `.roles`. /// Looks up a localized string similar to `.roles 2` or `.roles @Someone`.
/// </summary> /// </summary>
public static string roles_usage { public static string roles_usage {
get { get {

View File

@ -940,10 +940,10 @@
<value>roles</value> <value>roles</value>
</data> </data>
<data name="roles_desc" xml:space="preserve"> <data name="roles_desc" xml:space="preserve">
<value>List all roles on this server or a single user if specified.</value> <value>List roles on this server or a roles of a specific user if specified. Paginated. 20 roles per page.</value>
</data> </data>
<data name="roles_usage" xml:space="preserve"> <data name="roles_usage" xml:space="preserve">
<value>`.roles`</value> <value>`.roles 2` or `.roles @Someone`</value>
</data> </data>
<data name="channeltopic_cmd" xml:space="preserve"> <data name="channeltopic_cmd" xml:space="preserve">
<value>channeltopic ct</value> <value>channeltopic ct</value>