<commit_before>﻿using Discord;
using Discord.Commands;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using System.Text;
using System.Net.Http;
using NadekoBot.Services;
using System.Threading.Tasks;
using NadekoBot.Attributes;
using System.Text.RegularExpressions;
using System.Net;
using NadekoBot.Modules.Searches.Models;
using System.Collections.Generic;
using ImageSharp;
using NadekoBot.Extensions;
using System.IO;
using NadekoBot.Modules.Searches.Commands.OMDB;

namespace NadekoBot.Modules.Searches
{
    [NadekoModule("Searches", "~")]
    public partial class Searches : DiscordModule
    {
        private IGoogleApiService _google { get; }

        public Searches(ILocalization loc, CommandService cmds, ShardedDiscordClient client, IGoogleApiService youtube) : base(loc, cmds, client)
        {
            _google = youtube;
        }

        [NadekoCommand, Usage, Description, Aliases]
        [RequireContext(ContextType.Guild)]
        public async Task Weather(IUserMessage umsg, string city, string country)
        {
            var channel = (ITextChannel)umsg.Channel;
            city = city.Replace(" ", "");
            country = city.Replace(" ", "");
            string response;
            using (var http = new HttpClient())
                response = await http.GetStringAsync($"http://api.ninetales.us/nadekobot/weather/?city={city}&country={country}").ConfigureAwait(false);

            var obj = JObject.Parse(response)["weather"];
            double centiLucy = Double.Parse(obj["feelscentigrade"].ToString());
            uint[] colLucy = { 0x0000FF, 0xADD8E6, 0xFF0000, 0x8A8A8A};
            int colBaby = 0;
            if (centiLucy < -49)
            {
                colBaby = 0;
            } else if (centiLucy > -1 && centiLucy < 1)
            {
                colBaby = 1;
            } else if (centiLucy > 49)
            {
                colBaby = 2;
            } else {
				colBaby = 3;
			}

            var embed = new EmbedBuilder()
                .WithAuthor(eau => eau.WithName("Lucy's Forecast Today")
                .WithIconUrl("http://icons.iconarchive.com/icons/wineass/ios7-redesign/512/Weather-icon.png"))
                .WithDescription("\0")
                .AddField(fb => fb.WithName("🌍 **Weather for:**").WithValue($"{obj["target"]}").WithIsInline(true))
                .AddField(fb => fb.WithName("📏 **Lat,Long:**").WithValue($"{obj["latitude"]}, {obj["longitude"]}").WithIsInline(true))
                .AddField(fb => fb.WithName("☁ **Condition:**").WithValue($"{obj["condition"]}").WithIsInline(true))
                .AddField(fb => fb.WithName("😓 **Humidity:**").WithValue($"{obj["humidity"]}%").WithIsInline(true))
                .AddField(fb => fb.WithName("💨 **Wind Speed:**").WithValue($"{obj["windspeedk"]}km/h / {obj["windspeedm"]}mph").WithIsInline(true))
                .AddField(fb => fb.WithName("🌡 **Temperature:**").WithValue($"{obj["centigrade"]}°C / {obj["fahrenheit"]}°F").WithIsInline(true))
                .AddField(fb => fb.WithName("🔆 **Feels like:**").WithValue($"{obj["feelscentigrade"]}°C / {obj["feelsfahrenheit"]}°F").WithIsInline(true))
                .AddField(fb => fb.WithName("🌄 **Sunrise:**").WithValue($"{obj["sunrise"]}").WithIsInline(true))
                .AddField(fb => fb.WithName("🌇 **Sunset:**").WithValue($"{obj["sunset"]}").WithIsInline(true))
                .WithColor(colLucy[colBaby])
                .WithTimestamp(DateTime.Now);
            await channel.SendMessageAsync("-", embed: embed.Build()).ConfigureAwait(false);
        }

        [NadekoCommand, Usage, Description, Aliases]
        [RequireContext(ContextType.Guild)]
        public async Task Youtube(IUserMessage umsg, [Remainder] string query = null)
        {<commit_msg>remove color bs<commit_after>﻿using Discord;
using Discord.Commands;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using System.Text;
using System.Net.Http;
using NadekoBot.Services;
using System.Threading.Tasks;
using NadekoBot.Attributes;
using System.Text.RegularExpressions;
using System.Net;
using NadekoBot.Modules.Searches.Models;
using System.Collections.Generic;
using ImageSharp;
using NadekoBot.Extensions;
using System.IO;
using NadekoBot.Modules.Searches.Commands.OMDB;

namespace NadekoBot.Modules.Searches
{
    [NadekoModule("Searches", "~")]
    public partial class Searches : DiscordModule
    {
        private IGoogleApiService _google { get; }

        public Searches(ILocalization loc, CommandService cmds, ShardedDiscordClient client, IGoogleApiService youtube) : base(loc, cmds, client)
        {
            _google = youtube;
        }

        [NadekoCommand, Usage, Description, Aliases]
        [RequireContext(ContextType.Guild)]
        public async Task Weather(IUserMessage umsg, string city, string country)
        {
            var channel = (ITextChannel)umsg.Channel;
            city = city.Replace(" ", "");
            country = city.Replace(" ", "");
            string response;
            using (var http = new HttpClient())
                response = await http.GetStringAsync($"http://api.ninetales.us/nadekobot/weather/?city={city}&country={country}").ConfigureAwait(false);

            var obj = JObject.Parse(response)["weather"];

            var embed = new EmbedBuilder()
                .WithAuthor(eau => eau.WithName("Lucy's Forecast Today")
                .WithIconUrl("http://icons.iconarchive.com/icons/wineass/ios7-redesign/512/Weather-icon.png"))
                .WithDescription("\0")
                .AddField(fb => fb.WithName("🌍 **Weather for:**").WithValue($"{obj["target"]}").WithIsInline(true))
                .AddField(fb => fb.WithName("📏 **Lat,Long:**").WithValue($"{obj["latitude"]}, {obj["longitude"]}").WithIsInline(true))
                .AddField(fb => fb.WithName("☁ **Condition:**").WithValue($"{obj["condition"]}").WithIsInline(true))
                .AddField(fb => fb.WithName("😓 **Humidity:**").WithValue($"{obj["humidity"]}%").WithIsInline(true))
                .AddField(fb => fb.WithName("💨 **Wind Speed:**").WithValue($"{obj["windspeedk"]}km/h / {obj["windspeedm"]}mph").WithIsInline(true))
                .AddField(fb => fb.WithName("🌡 **Temperature:**").WithValue($"{obj["centigrade"]}°C / {obj["fahrenheit"]}°F").WithIsInline(true))
                .AddField(fb => fb.WithName("🔆 **Feels like:**").WithValue($"{obj["feelscentigrade"]}°C / {obj["feelsfahrenheit"]}°F").WithIsInline(true))
                .AddField(fb => fb.WithName("🌄 **Sunrise:**").WithValue($"{obj["sunrise"]}").WithIsInline(true))
                .AddField(fb => fb.WithName("🌇 **Sunset:**").WithValue($"{obj["sunset"]}").WithIsInline(true))
                .WithTimestamp(DateTime.Now);
            await channel.SendMessageAsync("-", embed: embed.Build()).ConfigureAwait(false);
        }

        [NadekoCommand, Usage, Description, Aliases]
        [RequireContext(ContextType.Guild)]
        public async Task Youtube(IUserMessage umsg, [Remainder] string query = null)
        {
{'fraction_non_alphanumeric': 0.163943661971831, 'fraction_numerical': 0.005352112676056338, 'mean_word_length': 3.0095990965556183, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5096730', 'n_tokens_mistral': 2325, 'n_tokens_neox': 2214, 'n_words': 359}