Skip to content

Message Basics

paige edited this page Aug 28, 2023 · 6 revisions

There are various ways to format and send messages

Sending In Channels

wc has a similar format for sending as Discord.JS with a few additions and changes

wc.channel.send(content);

// or

wc.send(content);

Replying To Messages

wc.reply(content);

Automatically Deleting

wc has built in auto deleting that can be used
In this example it deletes after 5 seconds

wc.send(content, {deleteAfter: "3s"});

Embeds

Embeds are put into messages using this:

wc.send(content, {embeds: [embed]});

// without content

wc.send({embeds: [embed]});

for multiple embeds you can do this:

wc.send(content, {embeds: [embed1, embed2]});

// without content

wc.send({embeds: [embed1, embed2]});

Components

Components like buttons and selections are put into messages using this:

// any of these work
let row = new wc.ActionRow([button]);
let row = new wc.ActionRow([selection]);
let row = new wc.ActionRow([button, selection]);

wc.send(content, {components: [row]});

// without content

wc.send({components: [row]});

Getting Message Context

This is already a part of Discord.JS but ported over
To get a message's context after sending it you can do this:

// YOU HAVE TO USE ASYNC TO USE AWAIT

let message = await wc.send("a");

console.log(message.content); // "a"
Clone this wiki locally