{"id":13409230,"url":"https://github.com/ewohltman/ephemeral-roles","last_synced_at":"2025-07-30T07:31:37.775Z","repository":{"id":27649325,"uuid":"114780542","full_name":"ewohltman/ephemeral-roles","owner":"ewohltman","description":"A Discord bot for managing ephemeral roles based upon voice channel member presence.","archived":false,"fork":false,"pushed_at":"2024-05-10T10:05:49.000Z","size":12675,"stargazers_count":89,"open_issues_count":10,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-07-31T20:35:19.000Z","etag":null,"topics":["discord","discord-api","discord-go","discordgo","discordrus","go","golang","logrus"],"latest_commit_sha":null,"homepage":"","language":"Go","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/ewohltman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2017-12-19T15:20:30.000Z","updated_at":"2024-07-31T15:46:09.000Z","dependencies_parsed_at":"2024-06-18T22:50:59.654Z","dependency_job_id":"68ede50f-8f8f-4aa5-804a-7eb8dcc3d858","html_url":"https://github.com/ewohltman/ephemeral-roles","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewohltman%2Fephemeral-roles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewohltman%2Fephemeral-roles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewohltman%2Fephemeral-roles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ewohltman%2Fephemeral-roles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ewohltman","download_url":"https://codeload.github.com/ewohltman/ephemeral-roles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228106545,"owners_count":17870437,"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":["discord","discord-api","discord-go","discordgo","discordrus","go","golang","logrus"],"created_at":"2024-07-30T20:00:59.079Z","updated_at":"2024-12-04T12:12:20.545Z","avatar_url":"https://github.com/ewohltman.png","language":"Go","funding_links":[],"categories":["Bot Building","Bot建设","Go","Uncategorized","机器人相关` 构建和使用机器人的库`","机器人相关"],"sub_categories":["Contents","Free e-books"],"readme":"# ephemeral-roles\n\n| \u003ca href=\"https://discordapp.com/api/oauth2/authorize?client_id=392419127626694676\u0026permissions=268435456\u0026scope=bot\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ewohltman/ephemeral-roles/master/web/static/Testa_Anatomica-Filippo_Balbi.jpg\" width=\"100\"\u003e\u003c/a\u003e\u003cbr/\u003e [![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go) ![Build Status](https://github.com/ewohltman/ephemeral-roles/workflows/build/badge.svg?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/ewohltman/ephemeral-roles)](https://goreportcard.com/report/github.com/ewohltman/ephemeral-roles) [![Coverage Status](https://coveralls.io/repos/github/ewohltman/ephemeral-roles/badge.svg?branch=master)](https://coveralls.io/github/ewohltman/ephemeral-roles?branch=master) [![Dev Chat](https://img.shields.io/badge/discord-dev%20chat-blue)](https://discord.gg/yrxaJb5) |\n| :------: |\n\n### A Discord bot for managing ephemeral roles based upon voice channel member presence.\n\n----\n\n## Quickstart\n\n1. Click on the `Ephemeral Roles` logo head above or use [this link](https://discordapp.com/api/oauth2/authorize?client_id=392419127626694676\u0026permissions=268435456\u0026scope=bot)\nto invite `Ephemeral Roles` into your Discord server\n    1. The 'Manage Roles' permission is required.  The invite link above\n    provides that by automatically creating an appropriate role in your server\n    for `Ephemeral Roles` \n2. Ensure the new role for `Ephemeral Roles` is at the top (or as near as\npossible) to the server's list of roles\n    1. If you're not sure how or why to do that, take a quick read over\n    Discord's excellent [Role Management 101](https://support.discordapp.com/hc/en-us/articles/214836687-Role-Management-101) guide\n3. Enjoy!\n\n----\n\n## What does `Ephemeral Roles` do?\n\nAfter the `Ephemeral Roles` bot is invited to your Discord server, it\nimmediately starts to watch for changes to your voice channels.  When a member\njoins a channel, `Ephemeral Roles` automatically assigns that member an\n*ephemeral role* associated with the channel.  If the *ephemeral role* doesn't\nexist yet, `Ephemeral Roles` will create it.\n\nBy having your members auto-sorted into *ephemeral roles* in your member list,\nit's clear to see who are available for chatting and the channels they are in.\nThis is because `Ephemeral Roles` leverages the Discord feature that the member\nlist in servers will group together members by role right out of the box.\n\nWhen a member changes or disconnects from voice channels, even across Discord\nservers, `Ephemeral Roles` will account for the change and automatically\nrevoke/reissue *ephemeral roles* as appropriate.\n\n----\n\n## Example Usage\n\n| Orange roles below are automatically managed by `Ephemeral Roles` |\n| :------: |\n| ![Ephemeral Roles action example](https://raw.githubusercontent.com/ewohltman/ephemeral-roles/master/web/static/action.gif) |\n| ![Ephemeral Roles static example](https://raw.githubusercontent.com/ewohltman/ephemeral-roles/master/web/static/static.png) |\n| ![Ephemeral Roles example role list](https://raw.githubusercontent.com/ewohltman/ephemeral-roles/master/web/static/roles.png) |\n\n----\n\n## Monitoring\n\nA **[Prometheus](https://prometheus.io/)** and **[Grafana](https://grafana.com/)** instance have been set up to monitor `Ephemeral Roles` metrics.\n\n| [grafana.ephemeral-roles.net](http://grafana.ephemeral-roles.net/d/OqANQqtiz/ephemeral-roles-metrics?orgId=1\u0026refresh=5s) |\n| :------: |\n| \u003ca href=\"http://grafana.ephemeral-roles.net/d/OqANQqtiz/ephemeral-roles-metrics?orgId=1\u0026refresh=5s\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/ewohltman/ephemeral-roles/master/web/static/bot-metrics.png\"\u003e\u003c/a\u003e |\n\n----\n\n## Architecture\n\n| Architectural Diagram |\n| :------: |\n| ![Architecture](https://raw.githubusercontent.com/ewohltman/ephemeral-roles/master/web/static/architecture.png) |\n| Architectural diagram created with [draw.io](https://draw.io/) |\n\n* `ephemeral-roles`:\n  * Runs in a Kubernetes cluster as a StatefulSet of 10 Pods. Each Pod contains\n    a running instance of the bot\n  * A StatefulSet is used so that each Pod has a predictable name so that the\n    bot instance can inform the Discord API which of the 10 Pods it is\n  * The Discord API will assign a number of the total guilds (servers) to each\n    of the bot instances to balance the load of managing the guild events\n  * If any of the Pods stop running for whatever reason, the StatefulSet will\n    automatically restart them\n* `pod-bouncer` (https://github.com/ewohltman/pod-bouncer):\n  * Runs in a Pod and is responsible for receiving alerts from\n    `Prometheus`/`AlertManager` and to act upon them by automatically causing\n    unhealthy Pods for `ephemeral-roles` to restart\n* `ephemeral-roles-informer` (https://github.com/ewohltman/ephemeral-roles-informer):\n  * Runs in a Pod and is responsible for collecting metrics from the\n    `ephemeral-roles` instances to update search services such as\n    [discord.bots.gg](https://discord.bots.gg/) and [top.gg](https://top.gg/)\n\n----\n\n## Contributing to the project\n\nContributions are very welcome! Please follow the guidelines below:\n\n* Open an issue describing the bug or enhancement\n* Fork the `develop` branch and make your changes\n  * Try to match current naming conventions as closely as possible\n  * Try to keep changes small and incremental with appropriate new unit tests\n* Create a Pull Request with your changes against the `develop` branch\n\nThis project is equipped with a full\n[CI](https://en.wikipedia.org/wiki/Continuous_integration)\n/\n[CD](https://en.wikipedia.org/wiki/Continuous_deployment) pipeline:\n \n* Linting and unit tests will be automatically run with the PR, providing\nfeedback if any additional changes need to be made\n* Merge to `master` will automatically deploy the changes live\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewohltman%2Fephemeral-roles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fewohltman%2Fephemeral-roles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fewohltman%2Fephemeral-roles/lists"}