Switched from diesel to sqlx

This commit is contained in:
2024-09-05 11:52:14 -04:00
parent bce363db7e
commit d08800f9e0
42 changed files with 365 additions and 687 deletions

View File

@@ -82,13 +82,13 @@ impl EventHandler for Handler {
for guild in ready.guilds {
// Check if guild exists in database
let guild_id = guild.id.get() as i64;
if let Err(why) = GuildCache::get(guild_id) {
if let None = GuildCache::get_by_id(guild_id).await.unwrap() {
let guild_cache = GuildCache {
id: guild_id,
bot_id: 1,
volume: 100
};
guild_cache.insert();
guild_cache.insert().await.unwrap();
}
let commands = guild
.id