fix guild ids

This commit is contained in:
jellywx 2020-12-22 14:44:45 +00:00
parent 392e1bb65e
commit 684661af42
3 changed files with 12 additions and 3 deletions

2
Cargo.lock generated
View File

@ -1316,7 +1316,7 @@ dependencies = [
[[package]] [[package]]
name = "reminder_rs" name = "reminder_rs"
version = "1.3.1" version = "1.3.2"
dependencies = [ dependencies = [
"Inflector", "Inflector",
"async-trait", "async-trait",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "reminder_rs" name = "reminder_rs"
version = "1.3.1" version = "1.3.2"
authors = ["jellywx <judesouthworth@pm.me>"] authors = ["jellywx <judesouthworth@pm.me>"]
edition = "2018" edition = "2018"

View File

@ -357,8 +357,17 @@ impl Framework for RegexFramework {
.get::<SQLPool>() .get::<SQLPool>()
.cloned() .cloned()
.expect("Could not get SQLPool from data"); .expect("Could not get SQLPool from data");
{
let guild = GuildData::from_guild(guild.clone(), &pool).await.unwrap();
GuildData::from_guild(guild, &pool).await; let _ = sqlx::query!(
"UPDATE channels SET guild_id = ? WHERE channel = ?",
guild.id,
msg.channel_id.as_u64(),
)
.execute(&pool)
.await;
}
if let Some(full_match) = self.command_matcher.captures(&msg.content) { if let Some(full_match) = self.command_matcher.captures(&msg.content) {
if check_prefix(&ctx, &guild, full_match.name("prefix")).await { if check_prefix(&ctx, &guild, full_match.name("prefix")).await {