forked from cadence/out-of-your-element
finalise message editing
This commit is contained in:
parent
53b5438756
commit
56fe710392
4 changed files with 157 additions and 63 deletions
|
@ -58,6 +58,20 @@ async function sendMessageWithWebhook(channelID, data, threadID) {
|
|||
return result
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} channelID
|
||||
* @param {string} messageID
|
||||
* @param {DiscordTypes.RESTPatchAPIWebhookWithTokenMessageJSONBody & {files?: {name: string, file: Buffer}[]}} data
|
||||
* @param {string} [threadID]
|
||||
*/
|
||||
async function editMessageWithWebhook(channelID, messageID, data, threadID) {
|
||||
const result = await withWebhook(channelID, async webhook => {
|
||||
return discord.snow.webhook.editWebhookMessage(webhook.id, webhook.token, messageID, {...data, thread_id: threadID})
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
module.exports.ensureWebhook = ensureWebhook
|
||||
module.exports.withWebhook = withWebhook
|
||||
module.exports.sendMessageWithWebhook = sendMessageWithWebhook
|
||||
module.exports.editMessageWithWebhook = editMessageWithWebhook
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue