mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-14 20:19:35 +01:00
@@ -1,28 +1,28 @@
|
||||
import type {RuntimeConfig} from 'nuxt/schema'
|
||||
|
||||
interface WebhookContent {
|
||||
title: string
|
||||
description: string
|
||||
color: number
|
||||
title: string
|
||||
description: string
|
||||
color: number
|
||||
}
|
||||
|
||||
export async function sendDiscordWebhookMessage(config: RuntimeConfig, content: WebhookContent) {
|
||||
await $fetch(`https://discordapp.com/api/webhooks/${config.discordId}/${config.discordToken}`, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
embeds: [
|
||||
{
|
||||
title: content.title,
|
||||
description: content.description,
|
||||
color: content.color,
|
||||
url: 'https://arthurdanjou.fr/talents',
|
||||
footer: {
|
||||
text: 'Powered by Nuxt',
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
],
|
||||
username: 'ArtDanjRobot - Website',
|
||||
},
|
||||
})
|
||||
await $fetch(`https://discordapp.com/api/webhooks/${config.discordId}/${config.discordToken}`, {
|
||||
method: 'POST',
|
||||
body: {
|
||||
embeds: [
|
||||
{
|
||||
title: content.title,
|
||||
description: content.description,
|
||||
color: content.color,
|
||||
url: 'https://arthurdanjou.fr/talents',
|
||||
footer: {
|
||||
text: 'Powered by Nuxt',
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
],
|
||||
username: 'ArtDanjRobot - Website',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user