Update schemas and resolve some warnings

This commit is contained in:
jude
2024-07-16 10:42:32 +01:00
parent 54ee3594eb
commit febd04c374
26 changed files with 221 additions and 164 deletions

View File

@ -593,18 +593,11 @@ pub(crate) async fn create_reminder(
}
fn check_channel_matches_guild(ctx: &Context, channel_id: ChannelId, guild_id: GuildId) -> bool {
// validate channel
let channel = channel_id.to_channel_cached(&ctx.cache);
let channel_exists = channel.is_some();
return match ctx.cache.guild(guild_id) {
Some(guild) => guild.channels.get(&channel_id).is_some(),
if !channel_exists {
return false;
}
let channel_matches_guild =
channel.map_or(false, |c| c.guild(&ctx.cache).map_or(false, |g| g.id == guild_id));
channel_matches_guild
None => false,
};
}
async fn create_database_channel(