Quickstart: Initialize a Client
devTo start using oceanic.js, instantiate a new Client with your bot token and call .connect().
Important: Always attach a listener for the error event. If you do not, any errors will throw an UncaughtError and may terminate your process.
const { Client } = require("oceanic.js");
const client = new Client({ token: "[TOKEN]" });
client.on("ready", async() => {
console.log("Ready as", client.user.tag);
});
// Always add an error listener to prevent process termination
client.on("error", (err) => {
console.error("Something Broke!", err);
});
client.connect();