public static TwitchCommand[] GetAll(TwitchConnection connection)
{
List<object[]> results = _table.Select(null, null, "ChannelUserId=?a AND BotUserId=?b",
new object[] { connection.channel.user.id, connection.bot.user.id }, null, 0);
if(results != null) {
TwitchCommand[] commands = new TwitchCommand[results.Count];
for(int i = 0; i < results.Count; i++) {
commands[i] = new SqlTwitchCommand(
results[i][0].FromSql<uint>(),
connection,
results[i][3].FromSql<string>(),
results[i][4].FromSql<string>(),
results[i][5].FromSql<bool>(),
TimeSpan.FromSeconds(results[i][6].FromSql<int>()),
results[i][7].FromSql<string>());
}
return commands;
} else {
return null;
}
}