TehPig
TehPig
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
alright, is there any way i can simplify that bitfield into permission names, for better understanding on my end?
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
PermissionsBitField { bitfield: 1808015873800951n }
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
the parent seems to be the issue
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
i take that back, it succeeds
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
it creates the channel, but it does not set the permissions
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
No description
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
yes
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
?
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
PermissionsBitField { bitfield: 1808015873801975n }
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
No description
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
sending messages in other channels with embeds works fine
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
it has all 3
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
the error stops there
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
which is this part
} catch (e) {
>>> channel = await inter.guild.channels.create({
} catch (e) {
>>> channel = await inter.guild.channels.create({
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
the last line just shows the line of the code
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
No description
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 8/9/2024 in #djs-questions
missing permissions / permissions are already granted
if (
!inter.guild.members.me.permissions.has(
PermissionsBitField.Flags.ManageChannels
)
) {
return inter.reply({
content: 'missing manage channels',
ephemeral: true,
});
}
if (
!inter.guild.members.me.permissions.has(
PermissionsBitField.Flags.ManageRoles
)
) {
return inter.reply({
content: 'missing manage roles',
ephemeral: true,
});
}

try {
channel = await inter.guild.channels.create({
name: "test",
type: 0,
parent: inter.channel.parent.id,
permissionOverwrites: [
{
id: bot.user.id,
allow: [
PermissionsBitField.Flags.ViewChannel,
PermissionsBitField.Flags.SendMessages,
PermissionsBitField.Flags.EmbedLinks,
],
},
{
id: inter.guild.id,
allow: [PermissionsBitField.Flags.ViewChannel],
},
],
});
} catch (e) {
channel = await inter.guild.channels.create({
name: "test",
type: 0,
permissionOverwrites: [
{
id: bot.user.id,
allow: [
PermissionsBitField.Flags.ViewChannel,
PermissionsBitField.Flags.SendMessages,
PermissionsBitField.Flags.EmbedLinks,
],
},
{
id: inter.guild.id,
allow: [PermissionsBitField.Flags.ViewChannel],
},
],
});

return inter.reply({
content: 'unable to set parent',
ephemeral: true,
});
}
if (
!inter.guild.members.me.permissions.has(
PermissionsBitField.Flags.ManageChannels
)
) {
return inter.reply({
content: 'missing manage channels',
ephemeral: true,
});
}
if (
!inter.guild.members.me.permissions.has(
PermissionsBitField.Flags.ManageRoles
)
) {
return inter.reply({
content: 'missing manage roles',
ephemeral: true,
});
}

try {
channel = await inter.guild.channels.create({
name: "test",
type: 0,
parent: inter.channel.parent.id,
permissionOverwrites: [
{
id: bot.user.id,
allow: [
PermissionsBitField.Flags.ViewChannel,
PermissionsBitField.Flags.SendMessages,
PermissionsBitField.Flags.EmbedLinks,
],
},
{
id: inter.guild.id,
allow: [PermissionsBitField.Flags.ViewChannel],
},
],
});
} catch (e) {
channel = await inter.guild.channels.create({
name: "test",
type: 0,
permissionOverwrites: [
{
id: bot.user.id,
allow: [
PermissionsBitField.Flags.ViewChannel,
PermissionsBitField.Flags.SendMessages,
PermissionsBitField.Flags.EmbedLinks,
],
},
{
id: inter.guild.id,
allow: [PermissionsBitField.Flags.ViewChannel],
},
],
});

return inter.reply({
content: 'unable to set parent',
ephemeral: true,
});
}
22 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 7/23/2024 in #djs-questions
premiumSubscriptionCount is NaN
the bot is for a single server which I own which should be fine
15 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 7/23/2024 in #djs-questions
premiumSubscriptionCount is NaN
would be nice for it to work for every boost message but if it's not possible i suppose having one is better than nothing
15 replies
DIAdiscord.js - Imagine an app
Created by TehPig on 7/23/2024 in #djs-questions
premiumSubscriptionCount is NaN
just sending a cusstom message basically, nothing too fancy
15 replies