{"id":15011266,"url":"https://github.com/tdmalone/slack-topic-updater","last_synced_at":"2025-10-03T20:31:59.716Z","repository":{"id":33064021,"uuid":"150831133","full_name":"tdmalone/slack-topic-updater","owner":"tdmalone","description":"Updates a Slack channel's topic, hiding the 'topic update' notice.","archived":true,"fork":false,"pushed_at":"2022-12-08T14:27:20.000Z","size":607,"stargazers_count":3,"open_issues_count":10,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-10T19:14:51.143Z","etag":null,"topics":["node-js","nodejs","slack"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tdmalone.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-29T06:11:36.000Z","updated_at":"2022-12-10T06:35:57.000Z","dependencies_parsed_at":"2023-01-14T23:14:21.546Z","dependency_job_id":null,"html_url":"https://github.com/tdmalone/slack-topic-updater","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdmalone%2Fslack-topic-updater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdmalone%2Fslack-topic-updater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdmalone%2Fslack-topic-updater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdmalone%2Fslack-topic-updater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdmalone","download_url":"https://codeload.github.com/tdmalone/slack-topic-updater/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235184529,"owners_count":18949258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["node-js","nodejs","slack"],"created_at":"2024-09-24T19:40:04.252Z","updated_at":"2025-10-03T20:31:54.352Z","avatar_url":"https://github.com/tdmalone.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack Topic Updater\n\nUpdates a Slack channel's topic, then 'hides' the topic update notice by deleting it afterwards. Useful for regular scripted updates of a channel's topic.\n\n## Why?\n\nUpdating a Slack channel topic is pretty simple. But, it leaves a message behind saying the topic has been updated. If you want to automate topic updates - for example, to use them as a 'ticker' of sorts - this can result in a lot of useless noise.\n\nSo, this module abstracts into one line the process of checking the current topic, querying the latest channel messages, and then deleting the topic update message. All this happens quite quickly, so no-one will notice the topic update message appearing unless they're watching quite intently!\n\nAs a bonus, the same topic text can be sent to multiple channels at the same time.\n\n## Usage\n\nAdd to your project:\n\n    npm install --save slack-topic-updater\n\nOr if you use [Yarn](https://yarnpkg.com/):\n\n    yarn add slack-topic-updater\n\nThen, call like this:\n\n    const slackTopicUpdater = require('slack-topic-updater');\n\n    const response = await slackTopicUpdater.update({\n      token: 'xoxp-0000000000-000000000000-000000000000-00000000000000000000000000000000',\n      channel: 'C12345678',\n      topic: 'This topic was last updated at ' + Date.now()\n    });\n\nThe response from Slack will be passed straight back through to you. In practice, this means that if `response.ok` is `true`, the actions have successfully completed.\n\nAlternatively, you can instead pass an array of channel IDs as `channels`. If you do this, you'll also receive an array of Slack responses back - one for each channel.\n\n    const response = await slackTopicUpdater.update({\n      token: 'xoxp-0000000000-000000000000-000000000000-00000000000000000000000000000000',\n      channels: [\n        'C12345678',\n        'C98765432'\n      ],\n      topic: 'This topic was last updated at ' + Date.now()\n    });\n\n## Authorisation\n\nTo get your Slack token, create an app from [api.slack.com/apps](https://api.slack.com/apps). After making it to the app management screen, from _Features: OAuth \u0026 Permissions_, and then under _Scopes_, you'll need to select:\n\n* `channels:write` (to set the topic);\n* `channels:history` (to search for the topic update message);\n* `groups:write` (to set the topic in **private channels**);\n* `groups:history` (to search for the topic update message in **private channels**); and\n* `chat:write:user` (to delete the topic update message).\n\nNOTE: The private channel scopes are only required if you want to update the topic in private channels. If you'll only be using public channels, you should leave these scopes out. Also note that the app will only be able to access channels that you are in (this applies to *both* public and private channels).\n\nOnce you've added the scopes, follow the instructions under _Settings: Install App_. You should be provided with an _OAuth Access Token_, which is what you'll need to send through to this module. Bot user tokens are not supported by the [`channels.setTopic`](https://api.slack.com/methods/channels.setTopic) endpoint, so they can't be used here - you must use a user token instead.\n\n## Running Tests\n\n    npm test\n\nor\n\n    yarn test\n\n## Problems?\n\nPlease feel free to [log an issue](https://github.com/tdmalone/slack-topic-updater/issues/new), or - if you can solve a problem yourself - pull requests will be gladly accepted. If you add new functionality, please add tests to cover it.\n\nIf you are receiving errors from the Slack API, depending on the error ensure you have set up the correct scopes (documented under *Authorisation* above); provided the correct token; and are in the channel you are trying to update. API errors that indicate something is amiss here can include `missing_scope`, `invalid_auth`, `not_in_channel`, and `channel_not_found`.\n\n## License\n\n[MIT](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdmalone%2Fslack-topic-updater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdmalone%2Fslack-topic-updater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdmalone%2Fslack-topic-updater/lists"}