Re-implementing the API
This commit is contained in:
@@ -9,13 +9,13 @@ use crate::data::guilds::GuildCache;
|
||||
use super::{commands};
|
||||
use super::chat::{create_message_response, create_modal_response};
|
||||
|
||||
pub struct Handler {
|
||||
pub struct BotHandler {
|
||||
// Open AI Config
|
||||
pub oai: Option<OAI>,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl EventHandler for Handler {
|
||||
impl EventHandler for BotHandler {
|
||||
async fn message(&self, ctx: Context, msg: Message) {
|
||||
// Ignore bot messages
|
||||
if msg.author.bot {
|
||||
@@ -47,7 +47,8 @@ impl EventHandler for Handler {
|
||||
if let None = GuildCache::get_by_id(guild_id).await.unwrap() {
|
||||
let guild_cache = GuildCache {
|
||||
id: guild_id,
|
||||
bot_id: 1,
|
||||
name: guild.id.name(&ctx.cache),
|
||||
owner_id: None,
|
||||
volume: 100,
|
||||
};
|
||||
guild_cache.insert().await.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user