Devvvvvv
Devvvvvv
Explore posts from servers
DIdiscord.js - Imagine ❄
Created by Devvvvvv on 5/22/2024 in #djs-questions
Is this how I check if a user has boosted?
https://old.discordjs.dev/#/docs/discord.js/main/class/GuildMemberRoleManager?scrollTo=premiumSubscriberRole https://old.discordjs.dev/#/docs/discord.js/main/class/RoleManager?scrollTo=premiumSubscriberRole These two links are from the docs. Im not sure which one I should use to check if a member has boosted. My objective is to remove a role from ALL members in a server other than premium subs. Is there a better way to do this other than just looping through all members to check and remove?? (or perhaps just to even remove without checking?) Currently using [email protected] and node version v20.8.0
12 replies
DIdiscord.js - Imagine ❄
Created by Devvvvvv on 5/21/2024 in #djs-questions
Error says that it doesn't recognize the interaction 💀
node:events:492
throw er; // Unhandled 'error' event
^
DiscordAPIError[10062]: Unknown interaction
at handleErrors (D:\Discord\EroBot\node_modules\@discordjs\rest\dist\index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (D:\Discord\EroBot\node_modules\@discordjs\rest\dist\index.js:835:23)
at async _REST.request (D:\Discord\EroBot\node_modules\@discordjs\rest\dist\index.js:1278:22)
at async ModalSubmitInteraction.reply (D:\Discord\EroBot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:114:5)
at async Object.execute (D:\Discord\EroBot\src\events\Tier 2 Verification\Tier2VerifyModalListener.js:99:6)
Emitted 'error' event on SapphireClient instance at:
at emitUnhandledRejectionOrErr (node:events:397:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: {
files: [],
json: {
type: 4,
data: {
content: '**VERIFIED ✅ -** <@883283797968318496> you have been verified as a <@&1241916986087309372> member for 1 Hour',
tts: false,
nonce: undefined,
enforce_nonce: false,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: 64,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined,
applied_tags: undefined,
poll: undefined
}
}
},
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',

}
node:events:492
throw er; // Unhandled 'error' event
^
DiscordAPIError[10062]: Unknown interaction
at handleErrors (D:\Discord\EroBot\node_modules\@discordjs\rest\dist\index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (D:\Discord\EroBot\node_modules\@discordjs\rest\dist\index.js:835:23)
at async _REST.request (D:\Discord\EroBot\node_modules\@discordjs\rest\dist\index.js:1278:22)
at async ModalSubmitInteraction.reply (D:\Discord\EroBot\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:114:5)
at async Object.execute (D:\Discord\EroBot\src\events\Tier 2 Verification\Tier2VerifyModalListener.js:99:6)
Emitted 'error' event on SapphireClient instance at:
at emitUnhandledRejectionOrErr (node:events:397:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: {
files: [],
json: {
type: 4,
data: {
content: '**VERIFIED ✅ -** <@883283797968318496> you have been verified as a <@&1241916986087309372> member for 1 Hour',
tts: false,
nonce: undefined,
enforce_nonce: false,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: 64,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined,
applied_tags: undefined,
poll: undefined
}
}
},
rawError: { message: 'Unknown interaction', code: 10062 },
code: 10062,
status: 404,
method: 'POST',

}
line 99 would be here (image 2 attached) what I dont understand is why the interaction object is unknown im sure more information is needed and I am okay to provide it
3 replies
DIdiscord.js - Imagine ❄
Created by Devvvvvv on 5/21/2024 in #djs-questions
How do I add temprole to any user in an automated way using djs14??
I know I can use dyno bot or carl bot for it but I want to automate it. Writing my own temprole feature feels like peeling off skin from the side of my fingernails. I tried to do this but it wont work for obvious reasons because carl bot ignores my bot.I know I can use dyno bot or carl bot for it but I want to automate it. Writing my own temprole feature feels like peeling off skin from the side of my fingernails. I tried to do this but it wont work for obvious reasons because carl bot ignores my bot.
71 replies
SIASapphire - Imagine a framework
Created by Devvvvvv on 5/20/2024 in #sapphire-support
Cannot find how I can use buttons
I want to create a message with some buttons for people to click on and recieve some messages something like what it is in the attached image. What I cannot figure out is how do I use it. I tried to read the documentation and I'm pretty sure im missing a big gotcha https://sapphirejs.dev/docs/Guide/interaction-handlers/buttons
29 replies
SIASapphire - Imagine a framework
Created by Devvvvvv on 5/19/2024 in #sapphire-support
slashcommand wont appear
Tried to implement slash command but it wont show up. The bot is invited with the bot and application.commands scope and it still wont work. ping.js
const { Command } = require('@sapphire/framework');

class PingCommand extends Command {
constructor(context, options) {
super(context, {
...options,
name: 'ping',
aliases: ['pong'],
description: 'ping pong',
});
}

async messageRun(message) {
const msg = await message.channel.send('Ping?');

const content = `Pong from JavaScript! Bot Latency ${Math.round(
this.container.client.ws.ping
)}ms. API Latency ${
msg.createdTimestamp - message.createdTimestamp
}ms.`;

return msg.edit(content);
}
}
module.exports = {
PingCommand,
};
const { Command } = require('@sapphire/framework');

class PingCommand extends Command {
constructor(context, options) {
super(context, {
...options,
name: 'ping',
aliases: ['pong'],
description: 'ping pong',
});
}

async messageRun(message) {
const msg = await message.channel.send('Ping?');

const content = `Pong from JavaScript! Bot Latency ${Math.round(
this.container.client.ws.ping
)}ms. API Latency ${
msg.createdTimestamp - message.createdTimestamp
}ms.`;

return msg.edit(content);
}
}
module.exports = {
PingCommand,
};
index.js
const { SapphireClient } = require('@sapphire/framework');
const { GatewayIntentBits } = require('discord.js');
require('dotenv').config();

const client = new SapphireClient({
intents: [
GatewayIntentBits.MessageContent,
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
],
loadMessageCommandListeners: true,
});

client.login(process.env.TOKEN);
const { SapphireClient } = require('@sapphire/framework');
const { GatewayIntentBits } = require('discord.js');
require('dotenv').config();

const client = new SapphireClient({
intents: [
GatewayIntentBits.MessageContent,
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
],
loadMessageCommandListeners: true,
});

client.login(process.env.TOKEN);
43 replies
SIASapphire - Imagine a framework
Created by Devvvvvv on 5/19/2024 in #sapphire-support
Can I create a simple get endpoint along with my sapphire app that's hosted wherever?
If yes, how can I do so?
4 replies