Permissions: Resolve guild, allows ability to delete channels, delete others messages, etc.

This commit is contained in:
Paul
2021-06-02 12:35:01 +01:00
parent 1713ad057d
commit 812fa2a98f
3 changed files with 17 additions and 3 deletions

View File

@@ -17,6 +17,12 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
}
let target = target.fetch_channel().await?;
match target {
Channel::SavedMessages { .. }
| Channel::TextChannel { .. } => return Err(Error::CannotJoinCall),
_ => {}
}
let perm = permissions::PermissionCalculator::new(&user)
.with_channel(&target)
.for_channel()