.roles updated string, missed af ile
This commit is contained in:
parent
17f76da220
commit
799b6cfae2
46
src/NadekoBot/Modules/Searches/Commands/OMDB/OmdbProvider.cs
Normal file
46
src/NadekoBot/Modules/Searches/Commands/OMDB/OmdbProvider.cs
Normal 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}";
|
||||
}
|
||||
}
|
@ -5550,7 +5550,7 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
|
||||
/// <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>
|
||||
public static string roles_desc {
|
||||
get {
|
||||
@ -5559,7 +5559,7 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to `.roles`.
|
||||
/// Looks up a localized string similar to `.roles 2` or `.roles @Someone`.
|
||||
/// </summary>
|
||||
public static string roles_usage {
|
||||
get {
|
||||
|
@ -940,10 +940,10 @@
|
||||
<value>roles</value>
|
||||
</data>
|
||||
<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 name="roles_usage" xml:space="preserve">
|
||||
<value>`.roles`</value>
|
||||
<value>`.roles 2` or `.roles @Someone`</value>
|
||||
</data>
|
||||
<data name="channeltopic_cmd" xml:space="preserve">
|
||||
<value>channeltopic ct</value>
|
||||
|
Loading…
Reference in New Issue
Block a user