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

Duplicate Tasks

Hello, I'm using @sapphire/plugin-scheduled-tasks on my bot and have configured a paterne to run the task every 10 seconds When the task reaches 0 seconds, the run() function is called 2 times Here's my code and a screen to help you understand:...
No description

Listener with `once: true` appears to be triggering multiple times

```ts import { ApplyOptions } from '@sapphire/decorators'; import { Events, Listener } from '@sapphire/framework'; import { ChannelType } from 'discord.js'; import { DBMessageLogs } from '../lib/database/DBMessageLogs';...

remove command from command registry after renaming a command file

How do I do this? Initially I had this command called ping, but renamed it to latency. I want to remove the 3 ping commands from the registry.
No description

Build sapphirejs typescript project?

I'm new to sapphire and I am following the official guide on the website. However it only shows a file structure of JavaScript files. How can I set up the project to build using tsc?

Modal Validation String Primitive

I'm receiving an error when trying to display my modal. I've tried following the docs but may be missing something. I tried using this answer because it looks like the exact same issue but my modal does have a title. https://discord.com/channels/737141877803057244/1122637599933223002/1122759262716842006 Error: https://pastebin.com/vF6YKkMv...

Advanced Help Command

So i'm trying to make a help command where it will only show in an embed the commands that the user that ran the command can ran, so for example, a staff member will see all staff commands + all public commands, the bot owner will be able to see dev commands + all commands, and a normal member will only be able to see public commands, etc, how would I do something like this?

TypeError: Cannot read properties of undefined (reading 'client')

Full Error:
TypeError: Cannot read properties of undefined (reading 'client')
at Object.handleError (C:\Users\cmart\Desktop\Discord Bots\Sapphire\src\utils.js:129:36)
at WarningsCommand.messageRun (C:\Users\cmart\Desktop\Discord Bots\Sapphire\src\commands\Moderation\warnings.js:96:27)
TypeError: Cannot read properties of undefined (reading 'client')
at Object.handleError (C:\Users\cmart\Desktop\Discord Bots\Sapphire\src\utils.js:129:36)
at WarningsCommand.messageRun (C:\Users\cmart\Desktop\Discord Bots\Sapphire\src\commands\Moderation\warnings.js:96:27)
...

messageCommandDenied

is it ok to delete this file, would something happend? I don't use it in any of my commands, most of my preconditions use: ```js } else { message.delete().catch((err) => console.log(err));...

i18n not part of sapphire container

Hello guys, I just updated my i18n plugin to the latest version (5.1.0) and noticed that since version 5.0.5 i18n seems to not be a piece of the container anymore. I try to access the piece with...

Command.ChatInputCommandInteraction GuildMember.voice not updating

```ts public async play(interaction : Command.ChatInputCommandInteraction) { const interactionGuildId = interaction.guildId; const member = interaction.member as GuildMember;...

Unsync slash commands

Is there a way to delete previously synced commands. I have some slash commands created in the past with this bot, I have now deleted those commands (their files), but on the discord server, they are still there, and I can still call them, they don't work i get Invalid interaction application command which is fine, but I dont want them there.

Error [EMPTY_MODULE]: A compatible class export was not found.

Not sure what's causing this error Here is my code and file tree ```bash └───src ├───apis...

Sync Slash Commands with one Guild

Hello, I have a test server which i use to test my bots, I am new to sapphire, and by reading the docs, I couldn't find a way to make the app sync the commands to a single guild/server. I do not want to sync with all servers as I noticed that is slow and takes a few minutes, whereas when i sync with one server (my server) it's almost immediate. Can you do that in sapphire? Please help

GuildMemberRemove not running

I just think I'm overlooking something but... I'm trying to do something if a member leaves the guild, but the event is not running. I have the following intends:...

Retrieve which subcommand was ran from message and interaction

Ive been wondering if it is possible to retrieve which subcommand was ran or to get only the arg without the command/subcommand from the message? I could manually have it set to a value for each subcommand but i wanted to know if i can already retrieve that from a preexisting sapphire object

error TS5109: Option 'moduleResolution' must be set to 'Node16'

I come accross this framework and wanted to try out, found out i cant :D Thats aside, here are some info: After i added that to tsconfig.json, it cant compile with error: error TS1287: A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled....

Broken TypeScript command (from lack of knowledge of TS)

I'm attempting to create a command following the Sapphire wiki, but it seems that I can't get the command to work at all. Note: I am very new to Typescript, I am not familiar with the syntax or the proper form to do stuff, please be gentle ```ts...
Solution:
My advice Baylem, use @sapphire/cli to generate a bot

@sapphire/discord.js-utilities - isPrivateThreadChannel

Could I query about the return type from the isPrivateThreadChannel. Shouldn't that type-guard instead of being ThreadChannel be PrivateThreadChannel ```typescript import { container } from '@sapphire/framework' import type { PrivateThreadChannel, Snowflake } from 'discord.js'...

Custom Error Event

So I know, I can use UserError to throw an error if the user did something wrong. But what to throw if something unexpected happend, like a 500 to my own api. I thought maybe the normal Error but it isn't handled by the ChatInputCommandError Event. I want the user to get a error message in chat, so I need to use the interaction....

"There are no more arguments." using args.pick('integer')

In this particular case I am trying to check if there is any argument after the command (while my method does work) I get an error saying "there are no more arguments" on value ```js let value = await args.pick('integer').catch((err) => console.log('Volume ::', err.message)); ...