Helix
Helix
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Helix on 9/28/2023 in #djs-questions
ChannelType.GuildCategory
Category channels can hold up to 50 channels; but what happens when you try to add an additional? I'm working on a discord bot for that creates a text channel under a parent category channel whenever someone submits a recruitment form. I'm just curious what happens if the category hits that 50 entity cap.
16 replies
DIAdiscord.js - Imagine an app
Created by Helix on 9/5/2023 in #djs-questions
embed limits - what happens when they're reached/exceeded?
What happens when the embed limits are exceeded? Will the embed be truncated, or will it just throw an error message when you try to send it?
3 replies
DIAdiscord.js - Imagine an app
Created by Helix on 7/28/2023 in #djs-questions
Rest returns 404 error
This might be because I'm doing something wrong, but when I try to use the rest api option I get a 404 error (this happens with every route). However if I use fetch I get back the actual result. I'm setting a token (I assume setToken sets the token on the Authorization header, other wise I would get an 401 error instead).
import { REST, Routes } from "discord.js"

const rest = new REST({ version: "10" }).setToken(process.env.DISCORD_TOKEN);

try {
const result = await rest.get(Routes.guildRoles(<Insert Guild Id>)); <-- returns a 404 error.

const result2 = await fetch(Routes.guildRoles(<Insert Guild Id>), {
method: "get",
headers: {
Authorization: `Bot ${process.env.DISCORD_TOKEN}`
}
}) <-- this works and returns the roles for the guild.
catch (err: any) {
/** DO STUFF
}
import { REST, Routes } from "discord.js"

const rest = new REST({ version: "10" }).setToken(process.env.DISCORD_TOKEN);

try {
const result = await rest.get(Routes.guildRoles(<Insert Guild Id>)); <-- returns a 404 error.

const result2 = await fetch(Routes.guildRoles(<Insert Guild Id>), {
method: "get",
headers: {
Authorization: `Bot ${process.env.DISCORD_TOKEN}`
}
}) <-- this works and returns the roles for the guild.
catch (err: any) {
/** DO STUFF
}
2 replies
DIAdiscord.js - Imagine an app
Created by Helix on 7/27/2023 in #djs-questions
Which version of discord.js?
Should I use the @discordjs/core repo or the 14.11.x version?
5 replies
DIAdiscord.js - Imagine an app
Created by Helix on 11/20/2022 in #djs-questions
When getting a list of roles for guild; is there a way to filter out roles with admin permissions?
Maybe a silly question. I have a component that pulls the list of roles from my discord server, and let's the user assign discord roles to users based on a specific action. However, I don't want to list the admin role (or any roles with admin permissions). Obviously I can filter this once the request is complete, but I'm wondering if there's a way to do it on the request layer.
3 replies
DIAdiscord.js - Imagine an app
Created by Helix on 10/17/2022 in #djs-questions
Sending files from vue front end to custom discord bot through express backend.
I'm wondering what the best process to doing this is. Currently I have a vue frontend component which lets me custom build a message, this could include attaching images and/or other files up to a maximum amount of MB. I have to send these to my backend which handles sending messages to my discord bot. My question is how should I go by doing this? Should I temporary upload the files using multer to my s3 bucket (My backend will be containerized; I'm using s3 to host my static assets), and then grab them from the bucket and send them through a message to discord?
6 replies
DIAdiscord.js - Imagine an app
Created by Helix on 10/7/2022 in #djs-questions
Create button dynamically?
I have some data I need to fetch from my database, and then iterate over that data and want to create buttons for each row of data. Is this possible? The documentation is a little hazy and I haven't seen any examples of a similar case.
5 replies
DIAdiscord.js - Imagine an app
Created by Helix on 8/1/2022 in #djs-questions
bulkDelete doesn't delete messages 2 weeks old?
Is this true? Does bulkDelete not delete messages two weeks old? If this is the case, and I want to delete a batch of specific messages that are older than 2 weeks old, is the best way to fetch each message and execute a delete on them individually?
33 replies
DIAdiscord.js - Imagine an app
Created by Helix on 7/27/2022 in #djs-questions
Create & Deleting multiple embeds
I have a case where I need to fetch multiple (specific) messages by id, and move them from one channel to another (they're all embeds). What's the best way to do this? From what I read you can't move a message from one channel to another, you have to delete and create a new message. Also I guess there's a limited to how many messages can be sent and deleted on one go.
16 replies