change how webhook information is in the webhook
This commit is contained in:
@@ -11,7 +11,7 @@ pub async fn req(db: &Db, user: User, target: Ref, msg: Ref) -> Result<EmptyResp
|
||||
return Err(Error::NotFound);
|
||||
}
|
||||
|
||||
if message.author.as_deref().unwrap_or_default() != user.id {
|
||||
if message.author != user.id {
|
||||
perms(&user)
|
||||
.channel(&target.as_channel(db).await?)
|
||||
.throw_permission(db, Permission::ManageMessages)
|
||||
|
||||
@@ -43,7 +43,7 @@ pub async fn req(
|
||||
return Err(Error::NotFound);
|
||||
}
|
||||
|
||||
if message.author.as_deref().unwrap_or_default() != user.id {
|
||||
if message.author != user.id {
|
||||
return Err(Error::CannotEditMessage);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ pub async fn req(db: &Db, user: User, target: Ref, data: Json<CreateWebhookBody>
|
||||
name: data.name,
|
||||
avatar,
|
||||
channel: channel.id().to_string(),
|
||||
token: nanoid::nanoid!(64)
|
||||
token: Some(nanoid::nanoid!(64))
|
||||
};
|
||||
|
||||
webhook.create(db).await?;
|
||||
|
||||
Reference in New Issue
Block a user