Skip to content

Class: DiscordService ​

Service for sending messages to Discord via webhook.

Remarks ​

Accessible everywhere via k.discord. You never have to instantiate this service yourself — it is created by the SDK when the appli/widget starts.

Example ​

ts
await k.discord.message(
    'https://discord.com/api/webhooks/...',
    'The game just started! 🎮'
);

Implements ​

Methods ​

message() ​

ts
message(webhook, message): Promise<void>;

Sends a text message to Discord via a webhook.

Parameters ​

webhook ​

string

The URL of the target Discord webhook.

message ​

string

The content of the message to post.

Returns ​

Promise<void>

A promise resolved once the message has been sent.

Example ​

ts
await k.discord.message(myWebhook, 'Stream is live! 🔴');