started adding commands

This commit is contained in:
jude
2020-08-09 23:59:31 +01:00
parent 6de542264a
commit 27c62e6ac2
6 changed files with 69 additions and 5 deletions

View File

@@ -36,7 +36,6 @@ use std::{
};
use crate::SQLPool;
use serenity::model::id::RoleId;
#[derive(Debug)]
pub enum PermissionLevel {
@@ -162,8 +161,8 @@ impl RegexFramework {
self
}
pub fn add_command(mut self, name: String, command: &'static Command) -> Self {
self.commands.insert(name, command);
pub fn add_command(mut self, name: &str, command: &'static Command) -> Self {
self.commands.insert(name.to_string(), command);
self
}
@@ -269,7 +268,7 @@ impl Framework for RegexFramework {
}
Err(sqlx::Error::RowNotFound) => {
sqlx::query!("INSERT INTO guilds (guild, name) VALUES (?, ?)", guild.id.as_u64(), guild.name)
let _ = sqlx::query!("INSERT INTO guilds (guild, name) VALUES (?, ?)", guild.id.as_u64(), guild.name)
.execute(&pool)
.await;