Add simple migration script
This commit is contained in:
parent
9ecc224ae1
commit
32ae82ca8d
6 changed files with 341 additions and 12 deletions
|
@ -33,6 +33,24 @@ namespace Geekbot.net.Commands.Admin
|
|||
_database = database;
|
||||
}
|
||||
|
||||
[Command("migrate", RunMode = RunMode.Async)]
|
||||
public async Task Migrate()
|
||||
{
|
||||
await ReplyAsync("starting migration");
|
||||
|
||||
try
|
||||
{
|
||||
var redisMigration = new RedisMigration(_database, _redis, _logger, _client);
|
||||
await redisMigration.Migrate();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_errorHandler.HandleCommandException(e, Context);
|
||||
}
|
||||
|
||||
await ReplyAsync("done");
|
||||
}
|
||||
|
||||
[Command("youtubekey", RunMode = RunMode.Async)]
|
||||
[Remarks(CommandCategories.Admin)]
|
||||
[Summary("Set the youtube api key")]
|
||||
|
@ -90,8 +108,14 @@ namespace Geekbot.net.Commands.Admin
|
|||
[Summary("Throw an error un purpose")]
|
||||
public void PurposefulError()
|
||||
{
|
||||
var e = new Exception("Error Generated by !owner error");
|
||||
_errorHandler.HandleCommandException(e, Context);
|
||||
try
|
||||
{
|
||||
throw new Exception("Error Generated by !owner error");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_errorHandler.HandleCommandException(e, Context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue