#Listeners not registering?

1 messages · Page 1 of 1 (latest)

median pollen
#

I'm using sapphire with TS & TSUP, but registers aren't working...
listener code:

import { Events, Listener } from "@sapphire/framework";
import { ActivityType, type Client } from "discord.js";

export class ClientReadyListener extends Listener {
  public constructor(
    context: Listener.LoaderContext,
    options: Listener.Options
  ) {
    super(context, {
      ...options,
      event: Events.ClientReady,
      once: true,
    });
  }

  public run(client: Client) {
    client.logger.info(
      `Bot Client Logged in as ${client.user!.tag} (${client.application?.id})`
    );

    client.user!.setActivity({
      type: ActivityType.Watching,
      name: "over EBC",
    });
  }
}

file structure: https://fisher.likes-to.party/i/AFEnbv

past berryBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

median pollen
#

Sapphire is starting because I'm getting

[INFO] ApplicationCommandRegistries: Initializing...
[INFO] ApplicationCommandRegistries: Took 0ms to initialize.
ivory turret
#

Can you show your package.json?

median pollen
#

sure

#
{
  "name": "bot",
  "version": "0.0.0",
  "description": "",
  "main": "src/main.ts",
  "type": "module",
  "scripts": {
    "watch": "nodemon --watch src --exec tsup src --format esm",
    "start": "nodemon dist/main.js",
    "dev": "pnpm run \"/^(watch|start)/\""
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@discordjs/builders": "^1.8.2",
    "@sapphire/framework": "^5.2.1",
    "chalk": "^5.3.0",
    "discord.js": "14.x",
    "dotenv": "^16.4.5",
    "marked": "^13.0.2"
  },
  "devDependencies": {
    "nodemon": "^3.1.4",
    "tsup": "^8.1.0",
    "typescript": "^5.5.3"
  }
}
#

it's also been a hot minute since I've made a bot so I might be missing something

round sentinel
median pollen
#

that was the fix

#

thanks!