random stuff

This commit is contained in:
Master Kwoth 2016-07-04 08:46:26 +02:00
parent 1b96e520e7
commit 7695112232
5 changed files with 4 additions and 12 deletions

View File

@ -28,15 +28,6 @@ namespace NadekoBot.Modules.Translator.Helpers
return GoogleTranslator._languageModeMap.Keys.OrderBy(p => p); return GoogleTranslator._languageModeMap.Keys.OrderBy(p => p);
} }
} }
/// <summary>
/// Gets the error.
/// </summary>
public Exception Error {
get;
private set;
}
#endregion #endregion
#region Public methods #region Public methods
@ -66,7 +57,7 @@ namespace NadekoBot.Modules.Translator.Helpers
using (HttpClient http = new HttpClient()) using (HttpClient http = new HttpClient())
{ {
http.DefaultRequestHeaders.Add("user-agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"); http.DefaultRequestHeaders.Add("user-agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36");
text = await http.GetStringAsync(url); text = await http.GetStringAsync(url).ConfigureAwait(false);
} }
return JArray.Parse(text)[0][0][0].ToString(); return JArray.Parse(text)[0][0][0].ToString();

View File

@ -31,7 +31,7 @@ namespace NadekoBot.Modules.Translator
if (string.IsNullOrWhiteSpace(text)) if (string.IsNullOrWhiteSpace(text))
return; return;
string translation = await t.Translate(text, from, to); string translation = await t.Translate(text, from, to).ConfigureAwait(false);
await e.Channel.SendMessage(translation).ConfigureAwait(false); await e.Channel.SendMessage(translation).ConfigureAwait(false);
} }
catch (Exception ex) catch (Exception ex)

View File

@ -134,6 +134,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Classes\ObservableConcurrentDictionary.cs" />
<Compile Include="Modules\Administration\Commands\AutoAssignRole.cs" /> <Compile Include="Modules\Administration\Commands\AutoAssignRole.cs" />
<Compile Include="Modules\Administration\Commands\CustomReactionsCommands.cs" /> <Compile Include="Modules\Administration\Commands\CustomReactionsCommands.cs" />
<Compile Include="Modules\Administration\Commands\SelfAssignedRolesCommand.cs" /> <Compile Include="Modules\Administration\Commands\SelfAssignedRolesCommand.cs" />
@ -496,7 +497,7 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="lib\ScaredFingers.UnitsConversion.dll" /> <Content Include="Classes\lib\ScaredFingers.UnitsConversion.dll" />
<None Include="resources\images\rose_overlay.png" /> <None Include="resources\images\rose_overlay.png" />
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup />