Eris
Coming from Eris? Don't worry, we'll help you move to Dreamcord!
Specifying your token
On Eris, you might've specified your bot token like this:
index.js
const bot = new Eris("Bot <your bot's token>");
But on Dreamcord, you specify your bot token in the connect
function, like this:
index.js
client.connect("<your bot's token>");
This is similar to how discord.js does it.
Specifying intents
On Eris, you might've specified intents like this:
index.js
const bot = new Eris("Bot <your bot's token>", {
intents: ["guilds", "guildMessages"],
});
But on Dreamcord, you specify intents using PascalCase
instead of camelCase
, like this:
index.js
const client = new Client({
intents: ["Guilds", "GuildMessages"],
});
Or through the Intents
enum, like this:
index.js
// Import the `Intents` enum from dreamcord
import { Intents } from "dreamcord";
const client = new Client({
intents: [Intents.Guilds, Intents.GuildMessages],
});
Or maybe even a mix of both!
index.js
// Import the `Intents` enum from dreamcord
import { Intents } from "dreamcord";
const client = new Client({
intents: ["Guilds", Intents.GuildMessages],
});
This is similar to how discord.js and Oceanic does it.
Sending a message
On Eris, you might've sent messages like this:
index.js
bot.createMessage(message.channel.id, "Hello!");
And for embeds, you might've done this:
index.js
bot.createMessage(message.channel.id, {
embeds: [
{
title: "I'm an embed!",
description:
"Here is some more info, with **awesome** formatting.\nPretty *neat*, huh?",
},
],
});
But on Dreamcord, you can send messages by using message.channel.send
, like this:
index.js
message.channel.send("Hello!");
Or for embeds, like this:
index.js
message.channel.send({
embeds: [
{
title: "I'm an embed!",
description:
"Here is some more info, with **awesome** formatting.\nPretty *neat*, huh?",
},
],
});
This is similar to how discord.js does it.