modify_channel
Update Discord channel settings including name, topic, permissions, position, and slowmode to manage server organization and content.
Instructions
Modify channel settings (name, topic, permissions, position, etc.)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guildId | Yes | The ID of the server (guild) | |
| channelId | Yes | The ID of the channel to modify | |
| name | No | New channel name | |
| topic | No | New channel topic | |
| nsfw | No | Whether the channel is NSFW | |
| parentId | No | New parent category ID | |
| position | No | New channel position | |
| rateLimitPerUser | No | New slowmode in seconds | |
| bitrate | No | New bitrate (voice channels) | |
| userLimit | No | New user limit (voice channels) | |
| reason | No | Reason for the modification |
Implementation Reference
- src/tools/channel-tools.ts:203-252 (handler)The handler function for the 'modify_channel' tool. It fetches the Discord guild and channel, constructs an updateData object from optional parameters (name, topic, nsfw, parentId, position, rateLimitPerUser, bitrate, userLimit, reason), edits the channel using channel.edit(updateData), and returns the updated channel info or error.server.tool( 'modify_channel', 'Modify channel settings (name, topic, permissions, position, etc.)', { guildId: z.string().describe('The ID of the server (guild)'), channelId: z.string().describe('The ID of the channel to modify'), name: z.string().optional().describe('New channel name'), topic: z.string().optional().describe('New channel topic'), nsfw: z.boolean().optional().describe('Whether the channel is NSFW'), parentId: z.string().optional().describe('New parent category ID'), position: z.number().optional().describe('New channel position'), rateLimitPerUser: z.number().optional().describe('New slowmode in seconds'), bitrate: z.number().optional().describe('New bitrate (voice channels)'), userLimit: z.number().optional().describe('New user limit (voice channels)'), reason: z.string().optional().describe('Reason for the modification'), }, async ({ guildId, channelId, name, topic, nsfw, parentId, position, rateLimitPerUser, bitrate, userLimit, reason }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const guild = await client.guilds.fetch(guildId); const channel = await guild.channels.fetch(channelId); if (!channel) throw new Error('Channel not found'); const updateData: Record<string, unknown> = {}; if (name !== undefined) updateData.name = name; if (topic !== undefined) updateData.topic = topic; if (nsfw !== undefined) updateData.nsfw = nsfw; if (parentId !== undefined) updateData.parent = parentId; if (position !== undefined) updateData.position = position; if (rateLimitPerUser !== undefined) updateData.rateLimitPerUser = rateLimitPerUser; if (bitrate !== undefined) updateData.bitrate = bitrate; if (userLimit !== undefined) updateData.userLimit = userLimit; if (reason !== undefined) updateData.reason = reason; const updatedChannel = await channel.edit(updateData); return { id: updatedChannel.id, name: updatedChannel.name, type: ChannelType[updatedChannel.type], message: 'Channel updated successfully', }; }); if (!result.success) { return { content: [{ type: 'text', text: result.error }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] }; } );
- src/tools/channel-tools.ts:206-218 (schema)Zod schema defining the input parameters for the modify_channel tool.{ guildId: z.string().describe('The ID of the server (guild)'), channelId: z.string().describe('The ID of the channel to modify'), name: z.string().optional().describe('New channel name'), topic: z.string().optional().describe('New channel topic'), nsfw: z.boolean().optional().describe('Whether the channel is NSFW'), parentId: z.string().optional().describe('New parent category ID'), position: z.number().optional().describe('New channel position'), rateLimitPerUser: z.number().optional().describe('New slowmode in seconds'), bitrate: z.number().optional().describe('New bitrate (voice channels)'), userLimit: z.number().optional().describe('New user limit (voice channels)'), reason: z.string().optional().describe('Reason for the modification'), },
- src/index.ts:55-55 (registration)Call to registerChannelTools which includes the registration of the modify_channel tool.registerChannelTools(server);