chillihero
chillihero
Explore posts from servers
SIASapphire - Imagine a framework
Created by chillihero on 5/13/2024 in #sapphire-support
i18n only translate command description
public override async registerApplicationCommands(registry: ApplicationCommandRegistry) {
registry.registerChatInputCommand((builder) =>
applyLocalizedBuilder(builder, 'commands/mycommand:name', 'commands/mycommand:description').setDMPermission(true)
);
}
public override async registerApplicationCommands(registry: ApplicationCommandRegistry) {
registry.registerChatInputCommand((builder) =>
applyLocalizedBuilder(builder, 'commands/mycommand:name', 'commands/mycommand:description').setDMPermission(true)
);
}
How would I hardcode the command name but localise the description? Just using applyLocalizedBuilder(builder, 'mycommand', 'commands/mycommand:description')? or setting the name afterwards with .setName('mycommand')
5 replies
SIASapphire - Imagine a framework
Created by chillihero on 1/9/2024 in #sapphire-support
How to use "and" & "or" with preconditions?
The Guide does not have any examples of this, so Im wondering how I can achive this. Having one of multiple preconditions needing to match Having multiple preconditions needing to match
14 replies
SIASapphire - Imagine a framework
Created by chillihero on 7/15/2023 in #sapphire-support
How to check if a number (the permission integer) has the manage server permission?
I need to check this, without using discordjs, only the sapphire/bitfield package I didnt understand the readme good enough, thats why im asking here.
8 replies
SIASapphire - Imagine a framework
Created by chillihero on 7/15/2023 in #discordjs-support
Cant resolve zlib-sync
No description
53 replies
SIASapphire - Imagine a framework
Created by chillihero on 7/13/2023 in #sapphire-support
Issue when running mutiple bot instances on the same redis db with the scheduler plugin
5 replies
SIASapphire - Imagine a framework
Created by chillihero on 7/10/2023 in #discordjs-support
"Failed to find guild, or unknown type for channel" even when not using channel.add()
No description
10 replies
SIASapphire - Imagine a framework
Created by chillihero on 6/30/2023 in #sapphire-support
When do I need the runIn Option?
Do I also need it when creating only slash commands?
5 replies
SIASapphire - Imagine a framework
Created by chillihero on 5/26/2023 in #sapphire-support
Property 'run' in type 'ScheduledTaskErrorEvent' is not assignable to the same property in base type
#16 [builder 5/5] RUN npx tsc
#16 9.480 src/listeners/tasks/scheduledTaskError.ts:10:9 - error TS2416: Property 'run' in type 'ScheduledTaskErrorEvent' is not assignable to the same property in base type 'Listener<"scheduledTaskError", ListenerOptions>'.
#16 9.480 Type '(error: Error, task: string, _duration: number, _payload: any) => void' is not assignable to type '(error: unknown, task: string, payload: unknown) => unknown'.
#16 9.480
#16 9.480 10 public run(error: Error, task: string, _duration: number, _payload: any) {
#16 9.480 ~~~
#16 9.480
#16 9.482
#16 9.482 Found 1 error in src/listeners/tasks/scheduledTaskError.ts:10
#16 9.482
#16 ERROR: process "/bin/sh -c npx tsc" did not complete successfully: exit code: 2
#16 [builder 5/5] RUN npx tsc
#16 9.480 src/listeners/tasks/scheduledTaskError.ts:10:9 - error TS2416: Property 'run' in type 'ScheduledTaskErrorEvent' is not assignable to the same property in base type 'Listener<"scheduledTaskError", ListenerOptions>'.
#16 9.480 Type '(error: Error, task: string, _duration: number, _payload: any) => void' is not assignable to type '(error: unknown, task: string, payload: unknown) => unknown'.
#16 9.480
#16 9.480 10 public run(error: Error, task: string, _duration: number, _payload: any) {
#16 9.480 ~~~
#16 9.480
#16 9.482
#16 9.482 Found 1 error in src/listeners/tasks/scheduledTaskError.ts:10
#16 9.482
#16 ERROR: process "/bin/sh -c npx tsc" did not complete successfully: exit code: 2
The Logs I get from this error. Any idea how I can solve this? The code:
export class ScheduledTaskErrorEvent extends Listener<typeof ScheduledTaskEvents.ScheduledTaskError> {
public run(error: Error, task: string, _duration: number, _payload: any) {
if (envIsDefined('SENTRY_DSN')) {
Sentry.withScope((scope) => {
scope.setLevel('error');
scope.setTags({ task });
scope.setFingerprint([error.name]);
scope.setTransactionName('ScheduledTaskErrorEvent');
Sentry.captureException(error);
});
}

return logErrorToContainer({ error, loggerSeverityLevel: 'error' });
}
}
export class ScheduledTaskErrorEvent extends Listener<typeof ScheduledTaskEvents.ScheduledTaskError> {
public run(error: Error, task: string, _duration: number, _payload: any) {
if (envIsDefined('SENTRY_DSN')) {
Sentry.withScope((scope) => {
scope.setLevel('error');
scope.setTags({ task });
scope.setFingerprint([error.name]);
scope.setTransactionName('ScheduledTaskErrorEvent');
Sentry.captureException(error);
});
}

return logErrorToContainer({ error, loggerSeverityLevel: 'error' });
}
}
5 replies
SIASapphire - Imagine a framework
Created by chillihero on 4/6/2023 in #sapphire-support
Whats the difference between the different imports?
12 replies
SIASapphire - Imagine a framework
Created by chillihero on 3/31/2023 in #sapphire-support
How to get infos about the current task?
I want to log things like taskid etc. what infos are there to work with and how do I get them inside of my task?
4 replies
SIASapphire - Imagine a framework
Created by chillihero on 3/17/2023 in #discordjs-support
How big is the difference between xyz.cache.get() and await xzy.fetch()?
fetch returns the cached thing aswell if it exists, so except the Promise difference i see not really a problem with using await fetch all the time. Is this consider bad practise? & How big is the difference time & performancewise?
11 replies
SIASapphire - Imagine a framework
Created by chillihero on 3/11/2023 in #sapphire-support
What is the difference between response.status and response.statusCode ?
6 replies
SIASapphire - Imagine a framework
Created by chillihero on 3/9/2023 in #sapphire-support
BotList Autopost of stats is not working
4 replies
SIASapphire - Imagine a framework
Created by chillihero on 3/6/2023 in #sapphire-support
GuildDelete Event somehow gets triggered when I restart my Bot
11 replies
SIASapphire - Imagine a framework
Created by chillihero on 3/1/2023 in #sapphire-support
How can I turn a joinedTimestamp into this Discord Timestamp
The one that automatically shows you like how long ago this timestamp was
20 replies
SIASapphire - Imagine a framework
Created by chillihero on 2/27/2023 in #sapphire-support
Whats the syntax to require Permission X AND Y OR Z when using requiredUserPermissions
when using requiredUserPermissions. Its an array so Im not sure
17 replies
SIASapphire - Imagine a framework
Created by chillihero on 2/24/2023 in #sapphire-support
How to check if the bot has Permission X inside of the server? For example VIEW_AUDIT_LOG
In a listener
10 replies
SIASapphire - Imagine a framework
Created by chillihero on 2/24/2023 in #sapphire-support
What parameter do I pass to the run method in my GuildCreate listener?
4 replies
SIASapphire - Imagine a framework
Created by chillihero on 2/18/2023 in #sapphire-support
Schdeduler SQS Options in index.ts
Where can I find what options I have to pass for the SQS Version of the Scheduled Task? I cant seem to find it in the guide
25 replies