Sapphire - Imagine a Framework

SIA

Sapphire - Imagine a Framework

Sapphire is a next-gen object-oriented Discord.js bot framework.

Join

sapphire-support

discordjs-support

old-sapphire-support

old-discordjs-support

old-application-commands-and-interactions

'"discord.js"' has no exported member named 'WebhookEditMessageOptions'. Did you mean 'WebhookFetchM

Error: '"discord.js"' has no exported member named 'WebhookEditMessageOptions'. Did you mean 'WebhookFetchMessageOptions' Project Created with sapphire new - typescript complete I just changed WebhookEditMessageOptions with WebhookEditMessageOptions...
Solution:
<:_:898645160219521134> WebhookFetchMessageOptions Options that can be passed into fetchMessage....

Monorepos

Does Sapphire work and play nice with monorepos?
Solution:
it does, you just have to set it up properly in regards to the cwd when starting a bot

Question regarding slash commands / aliases

Hi, is there a way for me to register command aliases as slash commands as well? For example: Command named one has aliases: ['two', 'three'] Is it possible for the command to be run via all of these: /one. /two and /three? They can have the same description and options....
Solution:
You cannot have aliases on slash commands

disable commands by dashboard.

I want to disable commands through dashboard so, is there any way to dynamically disable commands ?
Solution:
<command>.enabled = false

What is the difference between response.status and response.statusCode ?

When using the API Plugin of Sapphire.
Solution:
Hey, StatusCode is a value, status is a function that assigns the desired status to the StatusCode value...

Hey what is DEVELOPMENT MODE and how do I disable it

I tried setting the Node_Env to something else but it did not change it in the console
Solution:
I seee hmmm

BotList Autopost of stats is not working

I am using the bot list plugin https://github.com/devtomio/sapphire-plugin-botlist I set everything that I need to but it's not updating the stats somehow. Did I miss anything or is this an Issue on the Plugins' side?...
Solution:
Contact devtomio. This is not an official sapphire plugin therefore you won't get support for it on the sapphire support channel.

Miss matching objects on permission setting.

Typescript says that permissionOverwrites does not exits in GuildBasedChannel, even tho it exists, is there a specific way to setup permissions for a channel that i'm not understanding here?
Solution:
See https://discord.com/channels/222078108977594368/769862166131245066/1076213839990894604 Use !isStageChannel(channel) (function from @sapphire/discord.js-utilities) to eliminate the StageChannel type...

requiredClientPermissions check always rejecting

While requiredUserPermissions: ['ManageRoles'] works great. The client check requiredClientPermissions: ['ManageRoles'] seems to always block. It is throwing not a specific missing permissions error but an I was unable to resolve my permissions in the ${commandType} command invocation channel. Unless I am doing something wrong, it looks like the problem is that the check is referencing the application id channel.permissionsFor(interaction.applicationId) when it should be referencing either the clients guild member or user ID. https://github.com/sapphiredev/framework/blob/179b21e7f74c4d9a506e1be98d7487f939ec0ae7/src/preconditions/ClientPermissions.ts#L71...
Solution:
Closing this as the fix has been released in v4.2.1

Unable to get member data from users that have left / kicked

Hi, I am trying to get data from members who have left the discord server or have been kicked. But I keep getting undefined errors and I am unsure why here is my code. This only happen in sapphire ```ts @ApplyOptions<Listener.Options>({ event: Events.GuildMemberRemove, name: 'Handle Guild Member Kick/Leave' })...
Solution:
1. Unrelated to Sapphire 2. You're implementing the event parameters incorrectly, see https://discord.js.org/#/docs/discord.js/main/class/Client?scrollTo=e-guildMemberRemove...

Catch all chat input command errors listener

Hello ! I tried using the Events.ChatInputCommandError listener to catch any errors thrown by the chat input command, but it never seems to catch any errors. Am I missing something?...
Solution:
Because the error is thrown in a subcommand and it is not the same event... See https://www.sapphirejs.dev/docs/Documentation/api-plugins/modules/subcommands_src#subcommandpluginevents...

Multiple Clients on one file/instance

I was wondering if its possible to run multiple clients on one file (i.e. .forEach()-ing new Client())? I tried a basic implementation and the commands we're spammed after running one once (see screenshot)...
Solution:
Absolutely not, Sapphire interacts with container which exists as a singleton (only one instance). I don't know why you want to do this, but worker threads or forks are your only way....

How to present Slashcommands?

How can I present the Slashcommands of my bot in his About Me like for example carl.gg does?
Solution:
your bot has to be verified, then it's automatic you dont configure it...

Interaction Handlers

Am I required to specify to sapphire where my interaction handlers directory is? A interaction-handlers directory doesn't seem to be detected. - β”œβ”€ Loaded 0 interaction-handlers....
Solution:
For AnswerOverflow: sapphire auto detects the interaction-handlers directory

bot won't get on and connect to discord.

hi, my bot won't turn on. i've coded a lot of bots before with sapphire and they worked just fine, decided to make a new project, coded the structure and everything good but when i run my "yarn watch:start" - "watch:start": "tsc-watch --onSuccess \"node ./dist/index.js\"" it just won't turn on....

How Do I Make a Project in my current Directory?

I want to make the proj in workspaces/DashMate not like workspaces/DashMate/${ProjName}
Solution:
currently not a feature, just create the directory then move the content.

Bot wont go online

when I try to run the script yarn dev I get this problem
Solution:
Hey @Shen (Currently Sick), The port used by the api plugin is already used so cannot connect. Try to change the port use this one πŸ™‚...

GuildDelete Event somehow gets triggered when I restart my Bot

I have no idea whats happening but if my bot (docker container) restarts, this notification gets sent. A lot of information is missing as you can see just the guildID is valid, it’s always the same guildid and the bot has left this server some time ago already. What is going on?...
Solution:
thats what I got on DiscordJS server

TypeError: Class extends value undefined is not a constructor or null

Hey, newbie here in both TypeScript and Sapphire, and I'm trying to build a command but I'm getting the error specified in the title, my code for the constructor is the following: ```ts public constructor(context: CommandContext, options: Command.Options) { super(context, { description: 'Play a song',...
Solution:
Write a proper tsconfig. By default with no target set it compiles to ES3 which doesn't support classes.

THREAD_CREATE event Listener run method arguments

What I want to do: I want to inspect the id of the parent channel where the thread was created. The code I tried: ```typescript...
Solution:
Any event emitted by the discordjs websocket, such as THREAD_CREATE, doesn't receive a discordjs class, such as ThreadChannel, as first parameter. It receives the raw discord API data. If you type it as the type from discord-api-types (dunno which) you'll get the right properties in your code. My guess is that it's an APIThreadChannel https://discord-api-types.dev/api/discord-api-types-v10/interface/APIThreadChannel The ws event also receives only ONE argument which is that APIThreadChannel, there is no second argument NewlyCreated. That gets inserted by DiscordJS....