declaration for DetailedDescriptionCommand not working

so i declared DetailedDescriptionCommand in my index.d.ts and it's not working
Solution:
also rename it from index.d.ts to type-augments.ts
Jump to solution
41 Replies
čamdžić
čamdžićOP4mo ago
import {
CardRarity,
CardService,
EmbedBuilder,
LeaderboardService,
LevelingService,
UserService
} from './src/structures';

declare module '@sapphire/framework' {
export interface DetailedDescriptionCommand {
usage: string;
examples?: string[];
}

interface ArgType {
rarity: CardRarity;
}

interface Preconditions {
OwnerOnly: never;
}
}

declare module '@sapphire/pieces' {
interface Container {
cardService: CardService;
levelingService: LevelingService;
userService: UserService;
leaderboardService: LeaderboardService;
embedBuilder: EmbedBuilder;
}
}

export default undefined;
import {
CardRarity,
CardService,
EmbedBuilder,
LeaderboardService,
LevelingService,
UserService
} from './src/structures';

declare module '@sapphire/framework' {
export interface DetailedDescriptionCommand {
usage: string;
examples?: string[];
}

interface ArgType {
rarity: CardRarity;
}

interface Preconditions {
OwnerOnly: never;
}
}

declare module '@sapphire/pieces' {
interface Container {
cardService: CardService;
levelingService: LevelingService;
userService: UserService;
leaderboardService: LeaderboardService;
embedBuilder: EmbedBuilder;
}
}

export default undefined;
čamdžić
čamdžićOP4mo ago
No description
čamdžić
čamdžićOP4mo ago
everything else that I declared is working btw i tried restarting vsc etc but still nothing i did exactly as this guy https://discord.com/channels/737141877803057244/1104400245774884884 and not working !!!!!!!
Favna
Favna4mo ago
1. what is the location of your index.d.ts 2. What is your tsconfig.json 3. what is the rest of your file/folder structure
čamdžić
čamdžićOP4mo ago
No description
čamdžić
čamdžićOP4mo ago
pastes | mNCHhnflXJ
A paste containing 111 lines of typescript.
čamdžić
čamdžićOP4mo ago
tsconfig ^^ if I put index.d.ts in src then the rest of what I declare doesn't work for some reason this is how everything works except DetailedDescriptionCommand
Favna
Favna4mo ago
can you change your tsconfig to this and add @sapphire/ts-config to your dev dependencies?
{
"extends": [
"@sapphire/ts-config",
"@sapphire/ts-config/extra-strict"
],
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/.tsbuildinfo"
},
"include": ["src"]
}
{
"extends": [
"@sapphire/ts-config",
"@sapphire/ts-config/extra-strict"
],
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/.tsbuildinfo"
},
"include": ["src"]
}
then move index.d.ts to src
čamdžić
čamdžićOP4mo ago
um did u change anything ... is it still esnext
Solution
Favna
Favna4mo ago
also rename it from index.d.ts to type-augments.ts
Favna
Favna4mo ago
so drop the .d part actually try just that first yes I nuked your whole config and added the extends
čamdžić
čamdžićOP4mo ago
um i can't rn but will send you results in few hours thanks r u sure? can i put it anywhere in src like src/structures/types
Favna
Favna4mo ago
yes
No description
No description
čamdžić
čamdžićOP4mo ago
which font is that
Favna
Favna4mo ago
node16, but esnext and node16 are the same for now. esnext is an identifier for potentially breaking. It's lke beta. https://github.com/sapphiredev/utilities/blob/main/packages/ts-config/src/tsconfig.json
GitHub
utilities/packages/ts-config/src/tsconfig.json at main · sapphirede...
Common JavaScript utilities for Sapphire Projects. Contribute to sapphiredev/utilities development by creating an account on GitHub.
Spinel
Spinel4mo ago
Here are some of the fonts we believe are the best when coding, in no specific order: - https://github.com/tonsky/FiraCode - https://github.com/JetBrains/JetBrainsMono - https://github.com/microsoft/cascadia-code - https://github.com/adobe-fonts/source-code-pro - https://github.com/source-foundry/Hack
Have a font you think would be a good addition to this list? Submit a Pull Request to Spinel's tags and we'll review it!
Favna
Favna4mo ago
fira code ^
čamdžić
čamdžićOP4mo ago
which font weight xd
Favna
Favna4mo ago
idk normal font size 14 tho
"editor.fontFamily": "\"Fira Code\", \"FiraCode NF\", \"FiraCode Nerd Font\"",
"editor.fontLigatures": true,
"editor.fontSize": 14,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": ["entity.name.function", "support.function"],
"settings": {
"fontStyle": "italic"
}
}
]
},
"editor.fontFamily": "\"Fira Code\", \"FiraCode NF\", \"FiraCode Nerd Font\"",
"editor.fontLigatures": true,
"editor.fontSize": 14,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": ["entity.name.function", "support.function"],
"settings": {
"fontStyle": "italic"
}
}
]
},
čamdžić
čamdžićOP4mo ago
which theme xddd
Favna
Favna4mo ago
GitHub Theme - Visual Studio Marketplace
Extension for Visual Studio Code - GitHub theme for VS Code
čamdžić
čamdžićOP4mo ago
xD
No description
čamdžić
čamdžićOP4mo ago
even here
No description
čamdžić
čamdžićOP4mo ago
5.5.4 ts version btw
Favna
Favna4mo ago
Downgrade to ~5.4.5.
Favna
Favna4mo ago
GitHub
[node] Add generics to static members of EventEmitter by ckohen ·...
While I originally set out to just add generics to static members of EventEmitter, I discovered a few quirks and bugs in the existing generic code that made it very hard to do well. In order to mak...
čamdžić
čamdžićOP4mo ago
thats the most stable one? also i need to put override on every method, how to disable that
čamdžić
čamdžićOP4mo ago
@Boomeravna still 5.4.5 i get node_modules errors
No description
Favna
Favna4mo ago
Did you put ^5.4.5 or ~5.4.5
čamdžić
čamdžićOP4mo ago
No description
čamdžić
čamdžićOP4mo ago
~5.4.5 like you said
Favna
Favna4mo ago
And did you run pnpm install afterwards
čamdžić
čamdžićOP4mo ago
i deleted node_moduels & lock everything from scratch
čamdžić
čamdžićOP4mo ago
No description
Favna
Favna4mo ago
¯\_(ツ)_/¯ idk then bro. Issue on your system. Can't tell much more without a full repo dump.
čamdžić
čamdžićOP4mo ago
thats only when i use your tsconfig xd
Favna
Favna4mo ago
Well yeah because you have skipLibCheck enabled but that's a bad option that you should only enable if all else fails. You should make sure your environment works properly instead. You should also learn what each config key does and be able to analyze these kinds of things yourself in due time
čamdžić
čamdžićOP4mo ago
@Boomeravna can i put that cooldowns don't affect people with some permission like administrator
Favna
Favna4mo ago
not with the built in one.
čamdžić
čamdžićOP4mo ago
how to extend?
Favna
Favna4mo ago
Sapphire Framework
Creating your own preconditions | Sapphire
Just as we did in Creating Commands, we will start by creating a preconditions subdirectory in
GitHub
framework/src/preconditions/Cooldown.ts at main · sapphiredev/frame...
Discord bot framework built on top of discord.js for advanced and amazing bots. - sapphiredev/framework
Want results from more Discord servers?
Add your server