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:
Matthias G
2026-08-03 13:19:20 +02:00
parent 7e2a00842e
commit 78ff7d2c3f
4 changed files with 15 additions and 7 deletions
+4
View File
@@ -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()