Anarchy
Anarchy
DIAdiscord.js - Imagine an app
Created by Anarchy on 8/19/2024 in #djs-questions
Steps I should take to avoid rate limits?
I haven't had any issues with rate limits, but I am just curious if discord.js handles rate limits for me or if I need to manually stagger requests?
6 replies
DIAdiscord.js - Imagine an app
Created by Anarchy on 8/19/2024 in #djs-questions
Questions about what is "spam" when it comes to messaging users with a bot
This post relates to an earlier post I made (that I can't access) where I was informed that mass messaging wasn't allowed and I was linked to the TOS. I read through it and the official discord community guideline: https://discord.com/guidelines It seems I cannot give unsolicited messages, but if I inform users beforehand and have them opt in, then from my reading it seems like I can message however many people I want. This is important because I am trying to make a sample bot, that messages users with a question. So I just want to clarify and make sure I won't get banned as long as I have consent before hand and the users can opt in/out?
14 replies
DIAdiscord.js - Imagine an app
Created by Anarchy on 8/18/2024 in #djs-questions
How many people can my discord bot DM message before it's limited?
I have a sample system that I am thinking of making it DM people to request an answer. Is this possible to do if I want to sample 24 people from my server?
4 replies
DIAdiscord.js - Imagine an app
Created by Anarchy on 8/3/2024 in #djs-questions
Discord.JS IntelliSense isn't working for my slash command. Any advice?
Everything works, I simply just don't get the IntelliSense, my imports seem correct, but I can't seem to figure out what is going on. Here is my code. Specifically I am trying to get the IntelliSense for interaction:
import { SlashCommandBuilder } from '@discordjs/builders';

export default {
data: new SlashCommandBuilder()
.setName('report')
.setDescription(
'Report user (WARNING: False reports will be treated as an offense)'
)
.addUserOption((option) =>
option
.setName('user')
.setDescription('Server users')
.setRequired(true)
),
async execute(interaction) {
// interaction.reply('Pong!');÷

const guild = interaction.guild;
try {
console.log('test');

const members = await guild.members.fetch();

// interaction.reply(members.s)
} catch (error) {
console.error(error);
}
},
};
import { SlashCommandBuilder } from '@discordjs/builders';

export default {
data: new SlashCommandBuilder()
.setName('report')
.setDescription(
'Report user (WARNING: False reports will be treated as an offense)'
)
.addUserOption((option) =>
option
.setName('user')
.setDescription('Server users')
.setRequired(true)
),
async execute(interaction) {
// interaction.reply('Pong!');÷

const guild = interaction.guild;
try {
console.log('test');

const members = await guild.members.fetch();

// interaction.reply(members.s)
} catch (error) {
console.error(error);
}
},
};
5 replies
DIAdiscord.js - Imagine an app
Created by Anarchy on 7/26/2024 in #djs-questions
My slash commands aren't registering in my discord server. Client.on() doesn't seem to run.
Github: https://github.com/Niimaii/Harmony I am putting the repo here to make things easier. I put several console.log() to check how things are. The bot does login, it seems to register all the commands. However it doesn't show up when I try to use the slash command in the server. I am at a loss and spent wayyyyy too much time trying to figure this out, there is probably a simple explanation, I just can't figure it out. The only hint I have is that the only console.log() that doesn't show up are the one in this section:
client.on(Events.InteractionCreate, (interaction) => {
console.log('Client.on ran');

if (!interaction.isChatInputCommand()) return;

console.log(`Command received: ${interaction.commandName}`);

let command = client.commands.get(interaction.commandName);

try {
if (interaction.replied) return;
command.execute(interaction);
} catch (error) {
console.error(error);
}
});
client.on(Events.InteractionCreate, (interaction) => {
console.log('Client.on ran');

if (!interaction.isChatInputCommand()) return;

console.log(`Command received: ${interaction.commandName}`);

let command = client.commands.get(interaction.commandName);

try {
if (interaction.replied) return;
command.execute(interaction);
} catch (error) {
console.error(error);
}
});
So it seems that client.on() isn't running at all, I am not sure. Please help! ahahahaha
16 replies