renamed a function. removed name from guild

This commit is contained in:
2021-01-26 00:35:51 +00:00
parent 619678de36
commit d57e1d3ab1
4 changed files with 276 additions and 190 deletions

View File

@ -457,15 +457,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
};
match GuildData::get_from_id(guild.clone(), pool.clone()).await {
Some(mut guild_data) => {
let name = Some(guild.name);
if guild_data.name != name {
guild_data.name = name;
guild_data.commit(pool).await.unwrap();
}
Some(guild_data.prefix)
}
Some(guild_data) => Some(guild_data.prefix),
None => {
GuildData::create_from_guild(guild, pool).await.unwrap();