MCPcopy Create free account
hub / github.com/Botloader/botloader / createWebhook

Function createWebhook

components/runtime/src/ts/discord/dapi.ts:1207–1227  ·  view source on GitHub ↗
(fields: CreateWebhookFields)

Source from the content-addressed store, hash-verified

1205}
1206
1207export async function createWebhook(fields: CreateWebhookFields) {
1208 let imageData: string | null = null;
1209 if (fields.avatar) {
1210 if (fields.avatar instanceof Image) {
1211 imageData = fields.avatar.dataUri()
1212 } else {
1213 imageData = fields.avatar
1214 }
1215 }
1216
1217 let resp = await OpWrappers.callAsyncOp({
1218 kind: "discord_webhook_create",
1219 arg: {
1220 channel_id: fields.channel_id,
1221 icon: imageData,
1222 name: fields.name,
1223 }
1224 })
1225
1226 return Webhook.fromInternal(resp)
1227}
1228
1229
1230

Callers

nothing calls this directly

Calls 2

dataUriMethod · 0.80
fromInternalMethod · 0.45

Tested by

no test coverage detected