"I can't breathe ok"
"I can't breathe ok"
SIASapphire - Imagine a Framework
Created by "I can't breathe ok" on 3/1/2025 in #sapphire-support
Problems with plugin api
Hey! I'm attempting to setup my bot with the plugins api. I've managed to make a route but whenever I start the bot I have no indication of the api starting. I've checked this.container.client.server.server.listening, which returned true and I also listed routes through the container. The problem i'm having is whenever I attempt to send a curl request or a web request to the url I get a connection refused error.
const { SapphireClient } = require("@sapphire/framework");
const { GatewayIntentBits } = require("discord.js");
const config = require("../config.json");
const { LogLevel } = require("@sapphire/framework");

// plugins
require("@sapphire/plugin-api/register");

const client = new SapphireClient({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers],
logger: { level: LogLevel.Debug },
prefix: "api",
listenOptions: {
port: 8976,
},
api: {
automaticallyConnect: true,
},
});

client.login(config.TOKEN);
const { SapphireClient } = require("@sapphire/framework");
const { GatewayIntentBits } = require("discord.js");
const config = require("../config.json");
const { LogLevel } = require("@sapphire/framework");

// plugins
require("@sapphire/plugin-api/register");

const client = new SapphireClient({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers],
logger: { level: LogLevel.Debug },
prefix: "api",
listenOptions: {
port: 8976,
},
api: {
automaticallyConnect: true,
},
});

client.login(config.TOKEN);
5 replies