fix database, borrow

This commit is contained in:
mii
2022-10-31 12:46:59 +00:00
parent 1470612d8b
commit d10bfcc333
3 changed files with 4 additions and 3 deletions

3
.gitignore vendored
View File

@ -3,4 +3,5 @@ Cargo.lock
config.toml
credentials.json
/audio
*.mp3
*.mp3
*.swp

View File

@ -18,7 +18,7 @@ impl Database {
&mut self,
user_id: u64,
) -> redis::RedisResult<Option<UserConfig>> {
if let Ok(connection) = self.client.get_connection() {
if let Ok(mut connection) = self.client.get_connection() {
let config: String = connection
.get(format!("discord_user:{}", user_id))
.unwrap_or_default();

View File

@ -18,7 +18,7 @@ pub async fn voice_state_update(
old: Option<VoiceState>,
new: VoiceState,
) {
if new.member.unwrap().user.bot {
if new.member.clone().unwrap().user.bot {
return;
}
let guild_id = guild_id.unwrap();