Helix
Helix
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Helix on 9/28/2023 in #djs-questions
ChannelType.GuildCategory
gotcha, thank you.
16 replies
DIAdiscord.js - Imagine an app
Created by Helix on 9/28/2023 in #djs-questions
ChannelType.GuildCategory
ah, okay. I'm reading the docs and it seems like I;d ahve to add each member individually if the thread is private
16 replies
DIAdiscord.js - Imagine an app
Created by Helix on 9/28/2023 in #djs-questions
ChannelType.GuildCategory
with the text channel I'm just doing this:
let permissionOverwrites = [
{
id: everyoneRole.id,
type: OverwriteType.Role,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: account.providerAccountId,
type: OverwriteType.Member,
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.SendMessages,
],
},
];

if (guildRoles?.length) {
const gr = guildRoles.map((role) => {
return {
id: role.roleId,
type: OverwriteType.Role,
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.ManageChannels,
PermissionFlagsBits.SendMessages,
],
};
});
permissionOverwrites = [...permissionOverwrites, ...gr];
}

const textChannel = <TextChannel>await guild.channels.create({
type: ChannelType.GuildText,
name: title,
parent: channel.id,
permissionOverwrites,
});
let permissionOverwrites = [
{
id: everyoneRole.id,
type: OverwriteType.Role,
deny: [PermissionFlagsBits.ViewChannel],
},
{
id: account.providerAccountId,
type: OverwriteType.Member,
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.SendMessages,
],
},
];

if (guildRoles?.length) {
const gr = guildRoles.map((role) => {
return {
id: role.roleId,
type: OverwriteType.Role,
allow: [
PermissionFlagsBits.ViewChannel,
PermissionFlagsBits.ManageChannels,
PermissionFlagsBits.SendMessages,
],
};
});
permissionOverwrites = [...permissionOverwrites, ...gr];
}

const textChannel = <TextChannel>await guild.channels.create({
type: ChannelType.GuildText,
name: title,
parent: channel.id,
permissionOverwrites,
});
16 replies
DIAdiscord.js - Imagine an app
Created by Helix on 9/28/2023 in #djs-questions
ChannelType.GuildCategory
I guess one additional question, can you add permissions per thread for user/roles like any other channel
16 replies
DIAdiscord.js - Imagine an app
Created by Helix on 9/28/2023 in #djs-questions
ChannelType.GuildCategory
ah okay, yea that's definitely a better choice then
16 replies
DIAdiscord.js - Imagine an app
Created by Helix on 9/28/2023 in #djs-questions
ChannelType.GuildCategory
embeds is how I'm showing the form output
16 replies
DIAdiscord.js - Imagine an app
Created by Helix on 9/28/2023 in #djs-questions
ChannelType.GuildCategory
does threads support embeds? I know stupid question, but I don't remember seeing an embed inside a thread
16 replies
DIAdiscord.js - Imagine an app
Created by Helix on 9/28/2023 in #djs-questions
ChannelType.GuildCategory
so it's probably a good choice to check if it's full first, and maybe archive older text channels under the category
16 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.
probably a better question for stackoverflow when I think about it.
6 replies
DIAdiscord.js - Imagine an app
Created by Helix on 10/7/2022 in #djs-questions
Create button dynamically?
I guess what I'm saying, is would something like this actually work?
const rosters = await Roster.query().select(["id", "name", "url"]);



const row = new ActionRowBuilder().addComponents(
...rosters.map((roster) =>
new ButtonBuilder()
.setCustomId(roster.id)
.setLabel(roster.name)
.setStyle(ButtonStyle.Success)
)
);
const rosters = await Roster.query().select(["id", "name", "url"]);



const row = new ActionRowBuilder().addComponents(
...rosters.map((roster) =>
new ButtonBuilder()
.setCustomId(roster.id)
.setLabel(roster.name)
.setStyle(ButtonStyle.Success)
)
);
I do I need to pass it as an array of plain objects to the addComponents function?
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?
I looked for the documentation on the different rate limits, but maybe I'm blind, can't seem to find it other than the global rate limit is 50 per second
33 replies
DIAdiscord.js - Imagine an app
Created by Helix on 8/1/2022 in #djs-questions
bulkDelete doesn't delete messages 2 weeks old?
ahh, okay
33 replies
DIAdiscord.js - Imagine an app
Created by Helix on 8/1/2022 in #djs-questions
bulkDelete doesn't delete messages 2 weeks old?
basically I have it set up where an application is filled and sent to my web site, I create an entry in the db and I also create a copy to be posted onto discord
33 replies
DIAdiscord.js - Imagine an app
Created by Helix on 8/1/2022 in #djs-questions
bulkDelete doesn't delete messages 2 weeks old?
I only ask because there might be situations where I'm batch creating messages and/or updating
33 replies
DIAdiscord.js - Imagine an app
Created by Helix on 8/1/2022 in #djs-questions
bulkDelete doesn't delete messages 2 weeks old?
does updating and creating messages also have the same rate limitations?
33 replies
DIAdiscord.js - Imagine an app
Created by Helix on 8/1/2022 in #djs-questions
bulkDelete doesn't delete messages 2 weeks old?
implementing some type of exponential backoff
33 replies
DIAdiscord.js - Imagine an app
Created by Helix on 8/1/2022 in #djs-questions
bulkDelete doesn't delete messages 2 weeks old?
I was thinking of that
33 replies
DIAdiscord.js - Imagine an app
Created by Helix on 8/1/2022 in #djs-questions
bulkDelete doesn't delete messages 2 weeks old?
minus the console logs obviously lol
33 replies
DIAdiscord.js - Imagine an app
Created by Helix on 8/1/2022 in #djs-questions
bulkDelete doesn't delete messages 2 weeks old?
I'm doing something like this atm:
try {
const toBeDeleted = await BotApplicantForm.query()
.whereIn("applicant_id", ids)
.select(["channel_id", "message_id"]);

console.log("toBeDeleted", toBeDeleted);

const messages = await Promise.all(
toBeDeleted.map(async (d) => {
return client.channels.cache
.get(d.channel_id)
.messages.fetch(d.message_id);
})
);

console.log(`messages`, messages);

await Promise.all(messages.map((message) => message.delete()));
try {
const toBeDeleted = await BotApplicantForm.query()
.whereIn("applicant_id", ids)
.select(["channel_id", "message_id"]);

console.log("toBeDeleted", toBeDeleted);

const messages = await Promise.all(
toBeDeleted.map(async (d) => {
return client.channels.cache
.get(d.channel_id)
.messages.fetch(d.message_id);
})
);

console.log(`messages`, messages);

await Promise.all(messages.map((message) => message.delete()));
33 replies
DIAdiscord.js - Imagine an app
Created by Helix on 8/1/2022 in #djs-questions
bulkDelete doesn't delete messages 2 weeks old?
what's the best way, for say I have 50 messages that need to be deleted (they're specified by ids)
33 replies