Hey,
I've been playing around with ansi but i can't for the life of me get it to work when sending webhooks, why is this?
code:
import { REST, Routes } from "discord.js";
import { codeBlock } from "discord.js";
const rest = new REST({ version: "10" }).setToken();
const payload = {
components: [
{
type: 17,
accent_color: null,
spoiler: false,
components: [
{
type: 9,
accessory: {
type: 2,
style: 2,
label: "Small Eel",
emoji: null,
disabled: false,
custom_id: "37e83076f00f4179b48f21be6d217d6d"
},
components: [
{
type: 10,
content: codeBlock(
"ansi",
"\u001b[2;31m\u001b[0m\u001b[0;2mtext text\u001b[0m\u001b[0;2mSupport Desk\u001b[0m"
)
}
]
}
]
}
],
flags: 32768
};
(async () => {
try {
const result = await rest.post(
Routes.webhook(webhookId, webhookToken),
{ body: payload, auth: false }
);
console.log(result);
} catch (error) {
console.error(error);
}
})();
the webhook executes just find, but the ansi text doesn't show. I used another tool called discohook but that doesn't do components v2, but i won't be sending everything using discohook when it comes to my bot