Make errorhandler and languagehandler async, await all database actions

This commit is contained in:
runebaas 2018-06-13 22:18:57 +02:00
parent 926a632641
commit 95618b1f8b
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
46 changed files with 181 additions and 137 deletions

View file

@ -27,7 +27,7 @@ namespace Geekbot.net.Commands.Utils
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
await _errorHandler.HandleCommandException(e, Context);
}
}
}

View file

@ -60,7 +60,7 @@ namespace Geekbot.net.Commands.Utils.Changelog
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
await _errorHandler.HandleCommandException(e, Context);
}
}
}

View file

@ -24,14 +24,14 @@ namespace Geekbot.net.Commands.Utils
{
try
{
var transDict = _translation.GetDict(Context);
var transDict = await _translation.GetDict(Context);
var choicesArray = choices.Split(';');
var choice = new Random().Next(choicesArray.Length);
await ReplyAsync(string.Format(transDict["Choice"], choicesArray[choice]));
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
await _errorHandler.HandleCommandException(e, Context);
}
}
}

View file

@ -35,7 +35,7 @@ namespace Geekbot.net.Commands.Utils
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
await _errorHandler.HandleCommandException(e, Context);
}
}
}

View file

@ -32,7 +32,7 @@ namespace Geekbot.net.Commands.Utils
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
await _errorHandler.HandleCommandException(e, Context);
}
}
}

View file

@ -51,7 +51,7 @@ namespace Geekbot.net.Commands.Utils
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
await _errorHandler.HandleCommandException(e, Context);
}
}
@ -66,7 +66,7 @@ namespace Geekbot.net.Commands.Utils
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
await _errorHandler.HandleCommandException(e, Context);
}
}
}

View file

@ -48,7 +48,7 @@ namespace Geekbot.net.Commands.Utils
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
await _errorHandler.HandleCommandException(e, Context);
}
}
@ -120,7 +120,7 @@ namespace Geekbot.net.Commands.Utils
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
await _errorHandler.HandleCommandException(e, Context);
}
}
@ -148,7 +148,7 @@ namespace Geekbot.net.Commands.Utils
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context);
await _errorHandler.HandleCommandException(e, Context);
}
}

View file

@ -45,7 +45,7 @@ namespace Geekbot.net.Commands.Utils.Quote
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context, "Whoops, seems like the quote was to edgy to return");
await _errorHandler.HandleCommandException(e, Context, "Whoops, seems like the quote was to edgy to return");
}
}
@ -79,7 +79,7 @@ namespace Geekbot.net.Commands.Utils.Quote
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context,
await _errorHandler.HandleCommandException(e, Context,
"I counldn't find a quote from that user :disappointed:");
}
}
@ -112,7 +112,7 @@ namespace Geekbot.net.Commands.Utils.Quote
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context,
await _errorHandler.HandleCommandException(e, Context,
"I couldn't find a message with that id :disappointed:");
}
}
@ -131,7 +131,7 @@ namespace Geekbot.net.Commands.Utils.Quote
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context,
await _errorHandler.HandleCommandException(e, Context,
"I counldn't find a quote from that user :disappointed:");
}
}
@ -149,7 +149,7 @@ namespace Geekbot.net.Commands.Utils.Quote
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context,
await _errorHandler.HandleCommandException(e, Context,
"I couldn't find a message with that id :disappointed:");
}
}
@ -178,7 +178,7 @@ namespace Geekbot.net.Commands.Utils.Quote
}
catch (Exception e)
{
_errorHandler.HandleCommandException(e, Context, "I couldn't find a quote with that id :disappointed:");
await _errorHandler.HandleCommandException(e, Context, "I couldn't find a quote with that id :disappointed:");
}
}