Skip to content

Extending the config file

You might have a configuration as such:

import { config } from "seyfert";
export default config.bot({
locations: {
base: "dist",
commands: "commands",
},
token: process.env.TOKEN!,
});

For instance, when adding some properties.

declare module 'seyfert' {
interface ExtendedRC {
prefix: string;
// even more properties
}
}

You will notice a type error in your seyfert.config.ts

If you did not see this error, maybe you missed a step.

Or you already had the prefix property on it

Terminal window
Property 'prefix' is missing in type '{ locations: ...

GREAT! So… how do I get the property?

As simple as:

const rc = await client.getRC();
console.log(rc.prefix);

What about locations?

declare module 'seyfert' {
interface ExtendedRCLocations {
music: string;
}
}

GREAT! So…

const rc = await client.getRC();
console.log(rc.locations.music);

The finished product would be something like this:

import { config } from "seyfert";
export default config.bot({
locations: {
base: "dist",
commands: "commands",
music: "lavalink", // dist/lavalink
},
token: process.env.TOKEN!,
prefix: "s!",
});