Chessie
SIASapphire - Imagine a framework
•Created by Chessie on 7/22/2023 in #sapphire-support
pollSync error
I just started the bot and I get this error by default
C:\Users\Charl\OneDrive\Escritorio\Rox\node_modules\@sapphire\utilities\dist\lib\pollSync.js:10
AbortSignal.abort().reason.constructor
^
TypeError: Cannot read properties of undefined (reading 'constructor')
at Object.<anonymous> (C:\Users\Charl\OneDrive\Escritorio\Rox\node_modules\@sapphire\utilities\dist\lib\pollSync.js:10:29)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Charl\OneDrive\Escritorio\Rox\node_modules\@sapphire\utilities\dist\index.js:38:19)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
C:\Users\Charl\OneDrive\Escritorio\Rox\node_modules\@sapphire\utilities\dist\lib\pollSync.js:10
AbortSignal.abort().reason.constructor
^
TypeError: Cannot read properties of undefined (reading 'constructor')
at Object.<anonymous> (C:\Users\Charl\OneDrive\Escritorio\Rox\node_modules\@sapphire\utilities\dist\lib\pollSync.js:10:29)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\Charl\OneDrive\Escritorio\Rox\node_modules\@sapphire\utilities\dist\index.js:38:19)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
14 replies
SIASapphire - Imagine a framework
•Created by Chessie on 6/30/2023 in #sapphire-support
Cooldown
Is there a way to make the command run once a day at a fixed time? How can it be used again after 12am?
4 replies
SIASapphire - Imagine a framework
•Created by Chessie on 5/21/2023 in #sapphire-support
How can i use the ephemeral to PaginatedMessage?
Example code typescript:
const myPaginatedMessage = new PaginatedMessage();
// Once you have an instance of PaginatedMessage you can call various methods on it to add pages to it.
// For more details see each method's documentation.
myPaginatedMessage.addPageEmbed((embed) => {
embed
.setColor('#FF0000')
.setDescription('example description');
return embed;
});
myPaginatedMessage.run(interaction, interaction.user)
const myPaginatedMessage = new PaginatedMessage();
// Once you have an instance of PaginatedMessage you can call various methods on it to add pages to it.
// For more details see each method's documentation.
myPaginatedMessage.addPageEmbed((embed) => {
embed
.setColor('#FF0000')
.setDescription('example description');
return embed;
});
myPaginatedMessage.run(interaction, interaction.user)
5 replies
SIASapphire - Imagine a framework
•Created by Chessie on 1/23/2023 in #sapphire-support
"dm_permissions: false" dont work
I was trying to make the slash commands not visible in the md but it doesn't work for me, can you tell me why
export class Channel extends Command {
public registerApplicationCommands(registry: ApplicationCommandRegistry){
registry.registerChatInputCommand({
name: 'channel',
description: 'Un apartado para guardar los canales',
dm_permission: false,
defaultMemberPermissions: PermissionsBitField.Flags.ManageChannels | PermissionsBitField.Flags.EmbedLinks | PermissionsBitField.Flags.ManageGuild,
options: [{
type: ApplicationCommandOptionType.Channel,
channel_types: [ChannelType.GuildText],
name: 'channel',
description: 'Ingrese un canal',
required: true
}]
});
}
public async chatInputRun(interaction: Command.ChatInputCommandInteraction){
try{
const channel = interaction.options.getChannel('channel');
await this.container.SQL.query(`
UPDATE Guilds
SET channelID=$1
WHERE guildID=$2
`, [channel.id, interaction.guildId]);
await interaction.reply({
embeds: [
new EmbedBuilder()
.setTitle('Completado ✅')
.setDescription(`${channel.toString()} establecido como un canal de formularios`)
.setColor(Colors.Green)
],
ephemeral: true
});
}catch(e){
console.log(e)
}
}
}
export class Channel extends Command {
public registerApplicationCommands(registry: ApplicationCommandRegistry){
registry.registerChatInputCommand({
name: 'channel',
description: 'Un apartado para guardar los canales',
dm_permission: false,
defaultMemberPermissions: PermissionsBitField.Flags.ManageChannels | PermissionsBitField.Flags.EmbedLinks | PermissionsBitField.Flags.ManageGuild,
options: [{
type: ApplicationCommandOptionType.Channel,
channel_types: [ChannelType.GuildText],
name: 'channel',
description: 'Ingrese un canal',
required: true
}]
});
}
public async chatInputRun(interaction: Command.ChatInputCommandInteraction){
try{
const channel = interaction.options.getChannel('channel');
await this.container.SQL.query(`
UPDATE Guilds
SET channelID=$1
WHERE guildID=$2
`, [channel.id, interaction.guildId]);
await interaction.reply({
embeds: [
new EmbedBuilder()
.setTitle('Completado ✅')
.setDescription(`${channel.toString()} establecido como un canal de formularios`)
.setColor(Colors.Green)
],
ephemeral: true
});
}catch(e){
console.log(e)
}
}
}
2 replies