Edits history of script submission #23047 for ' Set Channel Topic (slack)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import { WebClient } from "@slack/web-api"
    
    /**
     * Set Channel Topic
     * Set the topic of a channel the token's user or app is in. Plain text, up to 250 characters; an empty string clears it. Requires channels:write.topic on the connection (or channels:manage for a bot token, channels:write for a user token); private channels need groups:write.topic.
     */
    export async function main(auth: RT.Slack, channel: string, topic: string) {
      const client = new WebClient(auth.token)
      return await client.conversations.setTopic({ channel, topic })
    }
    

    Submitted by hugo989 2 hours ago