Zue
Zue
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
I'll see what I can do on my end
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
hm
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
I want to handle those situations for future cases
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
what I need is for suboptions
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
but frankly I think that what I'm ab to do is bad practice
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
with my method I can register up to 1 options, I could spam this to check for more suboptions, choices or menus
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
as u can see
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
const { Command } = require('@sapphire/framework');

const { cyan } = require('colors');
const { time, logs } = require('../utils/Common.js');

class SlashCommand extends Command {
constructor(context, options) {
super(context, {
...options
});
this.opts = options.options;
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand(builder => {
logs.slash
? console.log(time(), cyan('SLASH_COMMAND'), this.name)
: null;

builder
.setName(this.name)
.setDescription(this.description);

const args = field => (option) => {
return option
.setName(field.name)
.setDescription(field.description);
};

if(this.opts) this.opts.forEach(field => {
if(field.type === 'STRING') builder.addStringOption(args(field));
if(field.type === 'INTEGER') builder.addIntegerOption(args(field));
if(field.type === 'BOOLEAN') builder.addBooleanOption(args(field));
if(field.type === 'USER') builder.addUserOption(args(field));
if(field.type === 'ROLE') builder.addRoleOption(args(field));
if(field.type === 'MENTIONABLE') builder.addMentionableOption(args(field));
if(field.type === 'CHANNEL') builder.addChannelOption(args(field));
})

return builder;
});
}
}

module.exports = SlashCommand;
const { Command } = require('@sapphire/framework');

const { cyan } = require('colors');
const { time, logs } = require('../utils/Common.js');

class SlashCommand extends Command {
constructor(context, options) {
super(context, {
...options
});
this.opts = options.options;
}

registerApplicationCommands(registry) {
registry.registerChatInputCommand(builder => {
logs.slash
? console.log(time(), cyan('SLASH_COMMAND'), this.name)
: null;

builder
.setName(this.name)
.setDescription(this.description);

const args = field => (option) => {
return option
.setName(field.name)
.setDescription(field.description);
};

if(this.opts) this.opts.forEach(field => {
if(field.type === 'STRING') builder.addStringOption(args(field));
if(field.type === 'INTEGER') builder.addIntegerOption(args(field));
if(field.type === 'BOOLEAN') builder.addBooleanOption(args(field));
if(field.type === 'USER') builder.addUserOption(args(field));
if(field.type === 'ROLE') builder.addRoleOption(args(field));
if(field.type === 'MENTIONABLE') builder.addMentionableOption(args(field));
if(field.type === 'CHANNEL') builder.addChannelOption(args(field));
})

return builder;
});
}
}

module.exports = SlashCommand;
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
does sapphire provide a way to handle options, suboptions, choices & rest?
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
yo sorry to bother again
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
Ig u might not check ur dms often
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
btw I dm'd u earlier
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
before slash command exist
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
god if I remember it's years ago
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
😭
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
I come from a version of sapphire where I had to write allat
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
I removed it entirely
350 replies
RNARuby - Not A Framework
Created by Zue on 2/22/2025 in #ruby-not-support
Is there a way to make an Event (registerApplicationCommands) 'wait' before triggering?
this was the cause
350 replies