oenieke
oenieke
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
Thanks for the info !
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
I also gave View Channels to @ everyone
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
OK, so it works once I clicked the sync permission thingy on the category
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
Thanks @clownidze to check with me.
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
Yeah, ok so definitely something fishy with the permissions on some level. Just added a new. pristine channel, and I could just change its name
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
anyway, i'll do some more testing, see if I can find anything wrong. Just weird that its acting this way
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
and that gave the same permissions as on the channel itself
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
I did this:
// Fetch the guild
const guild = await client.guilds.fetch(guildId);

// Fetch the bot's member object in the guild
const botMember = await guild.members.fetch(client.user.id);

// Check the bot's permissions in the guild
const botPermissions = botMember.permissions;
// Fetch the guild
const guild = await client.guilds.fetch(guildId);

// Fetch the bot's member object in the guild
const botMember = await guild.members.fetch(client.user.id);

// Check the bot's permissions in the guild
const botPermissions = botMember.permissions;
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
Both on the server as for the specific channel
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
well if i ask for the permissions, it says
'ManageChannels',
'ManageGuild',
'AddReactions',
'ViewAuditLog',
'Stream',
'ViewChannel',
'ManageChannels',
'ManageGuild',
'AddReactions',
'ViewAuditLog',
'Stream',
'ViewChannel',
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
thanks for that
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
weird
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
hmmm
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
I'll look into what permissions it detects with discordjs for said bot. The config looks allright, so i must be doing something wrong that I think I'm doing right 😄 After 20+ years of dev work that still happens on a weekly basis 😄
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
I suppose you're right
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
But i suppose there must be some kind of strange setting there that still disallows it somehow
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
But if you look at the screenshots higher up, it seems like it has all permissions on all levels
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
No description
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
It works fine when the bot has administrator permissions
47 replies
DIAdiscord.js - Imagine an app
Created by oenieke on 1/23/2025 in #djs-questions
Trying to change a channel name only works when my bot gets the admin role.
const {Client, Events, GatewayIntentBits} = require('discord.js');
var http = require('http');
var agent = new http.Agent({ family: 4 });
const axios = require('axios');
var instance = axios.create({ httpAgent: agent });

require('dotenv').config();

const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages] });
const testChannelID = process.env.TEST_CHANNEL_ID;


client.on('ready', async () => {
console.log(`Logged in as ${client.user.tag}`);
await updateChannelName(testChannelID);
});

async function updateChannelName(channelID) {
let floorChannel = client.channels.cache.get(channelID);

if (floorChannel) {
try {
let updatedChannel = await floorChannel.setName('New channel name');
} catch(error) {
console.error(`Error renaming channel: ${error}`);
}
}
}


client.login(process.env.DISCORD_TOKEN);
const {Client, Events, GatewayIntentBits} = require('discord.js');
var http = require('http');
var agent = new http.Agent({ family: 4 });
const axios = require('axios');
var instance = axios.create({ httpAgent: agent });

require('dotenv').config();

const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages] });
const testChannelID = process.env.TEST_CHANNEL_ID;


client.on('ready', async () => {
console.log(`Logged in as ${client.user.tag}`);
await updateChannelName(testChannelID);
});

async function updateChannelName(channelID) {
let floorChannel = client.channels.cache.get(channelID);

if (floorChannel) {
try {
let updatedChannel = await floorChannel.setName('New channel name');
} catch(error) {
console.error(`Error renaming channel: ${error}`);
}
}
}


client.login(process.env.DISCORD_TOKEN);
47 replies