j
j
DIAdiscord.js - Imagine an app
Created by j on 12/1/2023 in #djs-questions
issue with finding a role
/**
* The guild's ticket category and support role
* @typedef {Object} BaseObjects
* @property {CategoryChannel} ticketCategory
* @property {Role} supportRole
* @property {Role} botRole The role managed by the bot
*/
/**
* Gets the guild's ticketing system categories and roles
* @param {boolean} [force] Whether the channel and role managers should be force fetched. Defaults to true.
* @returns {Promise<BaseObjects>}
*/

const supportRole = this.guild.roles.cache.find(r => r.name === "Ticket Support");

await channel.send({
content: `${supportRole}`,
embeds: [embed],
components: [actionRow],
});
/**
* The guild's ticket category and support role
* @typedef {Object} BaseObjects
* @property {CategoryChannel} ticketCategory
* @property {Role} supportRole
* @property {Role} botRole The role managed by the bot
*/
/**
* Gets the guild's ticketing system categories and roles
* @param {boolean} [force] Whether the channel and role managers should be force fetched. Defaults to true.
* @returns {Promise<BaseObjects>}
*/

const supportRole = this.guild.roles.cache.find(r => r.name === "Ticket Support");

await channel.send({
content: `${supportRole}`,
embeds: [embed],
components: [actionRow],
});
7 replies
DIAdiscord.js - Imagine an app
Created by j on 12/1/2023 in #djs-questions
issue with finding a role
its basically defining the guild without its id
7 replies