Sapphire - Imagine a framework

SIA

Sapphire - Imagine a framework

Welcome to the Sapphire Discord server! The next-gen object-oriented Discord.js bot framework can be found here.

Join

sapphire-support

discordjs-support

old-sapphire-support

old-discordjs-support

old-application-commands-and-interactions

i18n options are not considered

Hi, While I try to refactor my code I want to implement the i18n plugin the way it is intended. When I call the resolveKey() method i18n wont consider my passed options....

i18n format issue

Hello guys, I just updated to the newest version of i18n plugin. My format function is now throwing an error I cannot get much context out of:...

Issue with pnpm (A type annotation is necessary)

The inferred type of 'parse' cannot be named without a reference to '.pnpm/@[email protected]/node_modules/@sapphire/result'. This is likely not portable.A type annotation is necessary.ts(2742) I saw this error before but how can I fix it. I don't want to switch to Yarn. I have set this line, but this is not helping ...
No description

fetchPrefix method on SapphireClient class

This method doesn't support an array of prefixes, right?

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....