{"id":16851727,"url":"https://github.com/they4kman/slack-channeler","last_synced_at":"2026-05-18T22:06:57.053Z","repository":{"id":66552667,"uuid":"183367354","full_name":"theY4Kman/slack-channeler","owner":"theY4Kman","description":"Power a Slack bot with Django Channels v2","archived":false,"fork":false,"pushed_at":"2020-10-07T08:37:21.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-24T16:09:39.581Z","etag":null,"topics":["django-channels","python","slack"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/slack-channeler/","language":"Python","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/theY4Kman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-25T06:07:01.000Z","updated_at":"2020-08-25T19:15:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2ba1a7e-e381-4fff-a9d9-08c6b89ef4bf","html_url":"https://github.com/theY4Kman/slack-channeler","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Fslack-channeler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Fslack-channeler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Fslack-channeler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Fslack-channeler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theY4Kman","download_url":"https://codeload.github.com/theY4Kman/slack-channeler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244191439,"owners_count":20413296,"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":["django-channels","python","slack"],"created_at":"2024-10-13T13:30:09.776Z","updated_at":"2026-05-18T22:06:57.026Z","avatar_url":"https://github.com/theY4Kman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slack-channeler\nPower a Slack bot with Django Channels v2\n\n\n# Installation\n```bash\npip install slack-channeler\n```\n\n\n# Usage\nslack-channeler relies on the channel layer. First, ensure it's setup. [channels-redis](https://github.com/django/channels_redis) is recommended.\n```python\n# settings.py\n\nCHANNEL_LAYERS = {\n    'default': {\n        'BACKEND': 'channels_redis.core.RedisChannelLayer',\n        'CONFIG': {\n            \"hosts\": [('localhost', 6379)],\n        },\n    },\n}\n```\n\nCreate a consumer to handle Slack events\n```python\n# consumers.py\n\nfrom channels.consumer import AsyncConsumer, get_handler_name\n\nclass SlackConsumer(AsyncConsumer):\n    async def dispatch(self, message):\n        handler = getattr(self, get_handler_name(message), None)\n        if handler:\n            await handler(**message['data'])\n\n    async def slack_message(self, channel, text, **kwargs):\n        # Simply echo back message\n        await self.channel_layer.send('slack', {\n            'type': 'message',\n            'channel': channel,\n            'text': text,\n        })\n```\n\nRoute Slack events to the consumer\n```python\n# routing.py\n\nfrom channels.routing import ProtocolTypeRouter, ChannelNameRouter\n\nfrom .consumers import SlackConsumer\n\napplication = ProtocolTypeRouter({\n    'channel': ChannelNameRouter({\n        'slack': SlackConsumer,\n    }),\n})\n```\n\nStart a Channels worker to handle Slack events from the channel layer\n```bash\npython manage.py runworker slack\n```\n\nLastly, run slack-channeler\n```bash\nSLACK_CHANNELER_TOKEN=xoxb-12345678900-098765432100-DeadBeefFeed90iIJjYsf3ay slack_channeler\n```\n\n\n# Building package\nCurrently, poetry does not support dynamic generation of version files, nor custom hooks to do so. To keep `pyproject.toml` the source of authority for version numbers, a custom `build.py` script is used to dynamically generate `version.py`.\n\nTo build slack-channeler, run `python build.py`. This has the same semantics as `poetry build`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthey4kman%2Fslack-channeler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthey4kman%2Fslack-channeler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthey4kman%2Fslack-channeler/lists"}