MCPcopy
hub / github.com/futantan/OpenGpt / sendMessageToDiscord

Function sendMessageToDiscord

src/utils/sendMessageToDiscord.ts:8–38  ·  view source on GitHub ↗
(v: {
  id: string
  name: string
  description: string
})

Source from the content-addressed store, hash-verified

6
7function noop() {}
8export function sendMessageToDiscord(v: {
9 id: string
10 name: string
11 description: string
12}) {
13 if (isDev) {
14 return
15 }
16 if (DISCORD_WEBHOOK_URL) {
17 return fetchPost(DISCORD_WEBHOOK_URL, {
18 username: 'OpenGpt 机器人',
19 embeds: [
20 {
21 author: {
22 name: 'OpenGpt',
23 url: 'https://open-gpt-app.vercel.app/',
24 icon_url: 'https://avatars.githubusercontent.com/u/6268441?v=4',
25 },
26 title: '有新的 App 被创建啦!🎉',
27 url: `https://open-gpt-app.vercel.app/app/${v.id}`,
28 description: `[点我直达](https://open-gpt-app.vercel.app/app/${v.id})`,
29 color: 15258703,
30 fields: [
31 { name: '应用名称', value: v.name, inline: false },
32 { name: '描述', value: v.description, inline: false },
33 ],
34 },
35 ],
36 }).catch(noop)
37 }
38}
39
40export function sendAlertToDiscord(message: string) {
41 if (isDev) {

Callers 1

openGptApp.tsFile · 0.90

Calls 1

fetchPostFunction · 0.90

Tested by

no test coverage detected