# Modify Channel — Discord Bot

> Update a channel's settings. See the docs here

- Key: `discord_bot-modify-channel`
- Type: Action (Write)
- Version: 1.0.1
- App: Discord Bot (`discord_bot`) — https://pipedream.com/apps/discord-bot.md
- This page (HTML): https://pipedream.com/apps/discord-bot/actions/modify-channel
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/discord_bot/actions/modify-channel/modify-channel.mjs

## Description

Update a channel's settings. [See the docs here](https://discord.com/developers/docs/resources/channel#modify-channel)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `guildId` | `string` | Yes | Discord Guild where your channel lives Options are loaded from the connected account. |
| `channelId` | `string` | Yes | Please select the channel you'd like to change its name Options are loaded from the connected account. |
| `name` | `string` | Yes | There is a 1-100 character channel name restriction |
| `icon` | `string` | No | base64 encoded icon. |
| `type` | `string` | No | Only conversion between text and news is supported and only in guilds with the 'NEWS' feature. See the channel types here. Options are loaded from the connected account. |
| `position` | `integer` | No | The position of the channel in the left-hand listing |
| `topic` | `string` | No | 0-1024 character channel topic |
| `nsfw` | `boolean` | No | Not Safe For Wumpus |
| `bitrate` | `integer` | No | The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers). |
| `rateLimitPerUser` | `integer` | No | Amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages or manage_channel, are unaffected. |
| `userLimit` | `integer` | No | The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit. |
| `rtcRegion` | `string` | No | Channel voice region id, automatic when set to null. |
| `videoQualityMode` | `integer` | No | The camera video quality mode of the voice channel. Options are loaded from the connected account. |
| `defaultAutoArchiveDuration` | `integer` | No | The default duration for newly created threads in the channel, in minutes, to automatically archive the thread after recent activity. |
| `parentId` | `string` | No | Id of the new parent category for a channel Options are loaded from the connected account. |
| `rolePermissions` | `string[]` | No | Choose the roles you want to add to your channel Options are loaded from the connected account. |
| `memberPermissions` | `string[]` | No | Choose the members you want to add to your channel Options are loaded from the connected account. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "discord_bot",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "discord_bot-modify-channel",
  arguments: {
    guildId: "Guild",
    channelId: "Channel",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "discord_bot-modify-channel",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    discord_bot: { authProvisionId: "apn_xxxxxxx" },
    guildId: "Guild",
    channelId: "Channel",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "discord_bot-modify-channel",
    "configured_props": {
      "discord_bot": { "authProvisionId": "apn_xxxxxxx" },
      "guildId": "Guild",
      "channelId": "Channel"
    }
  }'
```

---

- App: https://pipedream.com/apps/discord-bot.md · All apps: https://pipedream.com/apps
