error: reading root with @piece

constructor () {
super({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessageReactions
],
presence: {
status: 'dnd',
activities: [
{
name: 'TBot',
type: ActivityType.Listening,
}
]
}
});
this.stores.registerPath(join(this.rootData.root, 'fortnite'));
this.stores.registerPath(join(this.rootData.root, 'stw'));
this.stores.registerPath(join(this.rootData.root, 'anime'));

this.stores.registerPath(join(this.rootData.root, 'fortnite'));
constructor () {
super({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMessageReactions
],
presence: {
status: 'dnd',
activities: [
{
name: 'TBot',
type: ActivityType.Listening,
}
]
}
});
this.stores.registerPath(join(this.rootData.root, 'fortnite'));
this.stores.registerPath(join(this.rootData.root, 'stw'));
this.stores.registerPath(join(this.rootData.root, 'anime'));

this.stores.registerPath(join(this.rootData.root, 'fortnite'));
^ TypeError: Cannot read properties of undefined (reading 'root') I'm following the guide at https://www.sapphirejs.dev/docs/Guide/additional-information/implementing-a-discordpy-like-cog-system
Sapphire Framework
Implementing a discord.py like Cog system | Sapphire
Developer who come from the Python ecosystem may be familiar with the "Cog ↗️" system that discord.py has
Solution:
Sorry. Apparently my Japanese keyboard changed the characters to identical ones and confused part of the code.
Jump to solution
1 Reply
Solution
Kass507
Kass5075mo ago
Sorry. Apparently my Japanese keyboard changed the characters to identical ones and confused part of the code.

Did you find this page helpful?