Ferklen
Ferklen
DIAdiscord.js - Imagine an app
Created by Ishh on 10/8/2023 in #djs-questions
member.bannable shows false even everything is alright
does the 'flare' role has the admin permissions or the permissions come from another role
8 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/10/2023 in #djs-questions
add role
!
17 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/10/2023 in #djs-questions
add role
thanks
17 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/10/2023 in #djs-questions
add role
wdym change it? let member = message.mentions.users.first() what else could it be? and it gives me a member objet on the console
17 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/10/2023 in #djs-questions
add role
if (command === "addrole") {
if (!message.member.permissions.has(PermissionsBitField.Flags.ManageRoles)) {
return message.channel.send('r')
}
if (!message.guild.members.me.permissionsIn(message.channel).has(PermissionsBitField.Flags.ManageRoles)) {
return message.channel.send('r')
}
if (!args[0]) return message.channel.send("r")
let nombrea = args[0]
let member = message.mentions.users.first()
let role = message.mentions.roles.first()
if (!member) return message.channel.send("r")
if (!args[1]) return message.channel.send("r")
if (!role) return message.channel.send("r")
if (!role.editable) return message.channel.send("r")
if (role.comparePositionTo(message.member.roles.highest) >= 0) return message.channel.send("r")
try {
member.roles.add(role)
} catch (error){
console.log(error)
console.log(member)
console.log(role)
return message.channel.send('r')
}
return message.channel.send(`r`)
}
if (command === "addrole") {
if (!message.member.permissions.has(PermissionsBitField.Flags.ManageRoles)) {
return message.channel.send('r')
}
if (!message.guild.members.me.permissionsIn(message.channel).has(PermissionsBitField.Flags.ManageRoles)) {
return message.channel.send('r')
}
if (!args[0]) return message.channel.send("r")
let nombrea = args[0]
let member = message.mentions.users.first()
let role = message.mentions.roles.first()
if (!member) return message.channel.send("r")
if (!args[1]) return message.channel.send("r")
if (!role) return message.channel.send("r")
if (!role.editable) return message.channel.send("r")
if (role.comparePositionTo(message.member.roles.highest) >= 0) return message.channel.send("r")
try {
member.roles.add(role)
} catch (error){
console.log(error)
console.log(member)
console.log(role)
return message.channel.send('r')
}
return message.channel.send(`r`)
}
i simplified the code by not using the cache and switched user to member and still got the same errors errors here // if (user.roles.cache.has(role.id)) return message.channel.send("reply") // if (message.member.roles.highest.comparePositionTo(user.roles.highest) <= 0) return message.channel.send("reply") and if i delete them there is still the error cannot read properties of add and it seemed weird to just switch user to member as in console.log(user/member) is the same thing
17 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/10/2023 in #djs-questions
add role
let user = message.mentions.users.first() client.users.cache.get(args[0]) client.users.cache.find(user => user.username === nombrea) should i just change that to member?
17 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/7/2023 in #djs-questions
bot perms
any1 knows how to do that???
12 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/7/2023 in #djs-questions
bot perms
im trying to check if the bot has embed perms
12 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/7/2023 in #djs-questions
bot perms
or message.channel.members
12 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/7/2023 in #djs-questions
bot perms
like in general, to prevent the errors while sending embeds should i put like message.guild.members.me.message.channel.permissionsFor() ?
12 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/7/2023 in #djs-questions
bot perms
if(!message.guild.members.me.permissions.has(PermissionsBitField.Flags.EmbedLinks)) return message.channel.send("reply")
if(!message.guild.members.me.permissions.has(PermissionsBitField.Flags.EmbedLinks)) return message.channel.send("reply")
so i switched it to this, now there is not an error message but the bot continues working even if it doesn't have the perms, and i confirm it by trying to use an embed it just shows an error in the console, commands with no embed work and it doesn't send the reply it should send
12 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/3/2023 in #djs-questions
channel filter
ty
6 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 9/3/2023 in #djs-questions
channel filter
i also tried
const categories = server.channels.cache.filter(x => x.type === "GUILD_CATEGORY").size;
const text = server.channels.cache.filter(x => x.type === "GUILD_TEXT").size;
const voice = server.channels.cache.filter(x => x.type === "GUILD_VOICE").size;
console.log(categories, text, voice)
const categories = server.channels.cache.filter(x => x.type === "GUILD_CATEGORY").size;
const text = server.channels.cache.filter(x => x.type === "GUILD_TEXT").size;
const voice = server.channels.cache.filter(x => x.type === "GUILD_VOICE").size;
console.log(categories, text, voice)
and its still '0' i have this above
var server = message.guild;
const channels = await server.channels.fetch();
await server.channels.fetch();
var server = message.guild;
const channels = await server.channels.fetch();
await server.channels.fetch();
6 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 8/29/2023 in #djs-questions
timeout perms
i have v14
8 replies
DIAdiscord.js - Imagine an app
Created by Ferklen on 8/29/2023 in #djs-questions
timeout perms
if(!message.member.hasPermission('ModerateMembers')) return message.channel.send('asd')
if(!message.member.hasPermission('ModerateMembers')) return message.channel.send('asd')
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.
8 replies