Stop offering deletion Slack refuses
chat.delete only removes what the bot posted itself, so webhook messages answer cant_delete_message no matter how the id is found. Runs without a stored id now say so instead of leading into a dead end.
This commit is contained in:
@@ -120,6 +120,10 @@ export async function performDeleteMessage(viewer: Viewer, formData: FormData):
|
||||
return invalid('runNotSent')
|
||||
}
|
||||
|
||||
if (!run.messageTs) {
|
||||
return invalid('runNotDeletable')
|
||||
}
|
||||
|
||||
const values = await readSettings(['slack.botToken', 'slack.channel'])
|
||||
const token = values.get('slack.botToken')?.trim()
|
||||
const channel = run.channel ?? values.get('slack.channel')?.trim()
|
||||
|
||||
Reference in New Issue
Block a user