{"id":16015280,"url":"https://github.com/djdeveloperr/ban_appeal_plugin","last_synced_at":"2025-03-15T12:14:11.380Z","repository":{"id":135718757,"uuid":"432714801","full_name":"DjDeveloperr/ban_appeal_plugin","owner":"DjDeveloperr","description":"Ban Appeals plugin for Modmail bot, with a site to submit appeals.","archived":false,"fork":false,"pushed_at":"2022-01-06T10:36:06.000Z","size":99,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T02:35:27.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DjDeveloperr.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":"2021-11-28T13:06:28.000Z","updated_at":"2024-08-23T10:21:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"19d29b55-cd70-4eb1-93b9-93a1e35f1370","html_url":"https://github.com/DjDeveloperr/ban_appeal_plugin","commit_stats":{"total_commits":30,"total_committers":6,"mean_commits":5.0,"dds":0.5666666666666667,"last_synced_commit":"99384b75a451492b860718bbea9e55e704f5d0ae"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DjDeveloperr%2Fban_appeal_plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DjDeveloperr%2Fban_appeal_plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DjDeveloperr%2Fban_appeal_plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DjDeveloperr%2Fban_appeal_plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DjDeveloperr","download_url":"https://codeload.github.com/DjDeveloperr/ban_appeal_plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243725633,"owners_count":20337670,"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":[],"created_at":"2024-10-08T15:22:44.011Z","updated_at":"2025-03-15T12:14:11.347Z","avatar_url":"https://github.com/DjDeveloperr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ban Appeal Server \u0026 Plugin\n\nThis repo contains two things, a webserver for ban appeals and a python cog/plugin for [modmail](https://github.com/kyb3r/modmail) which is [here](ban_appeal/ban_appeal.py).\n\n## Setting up\n\nTo get started with it, first you need to have an active instance of both [modmail](https://github.com/kyb3r/modmail) and [logviewer](https://github.com/kyb3r/logviewer) otherwise it won't work.\n\n## Docker\n\nTo host with docker:\n\n* I'll assume you have docker installed since you're following docker steps.\n* Git clone this repo with `git clone https://github.com/DjDeveloperr/ban_appeal_plugin`.\n* Go into the directory where you cloned it and open a terminal session inside the `ban_appeal_plugin` directory.\n* Then, build the docker image by running this command `docker build . -t appeal-server --build-arg PORT=2012`, replace `PORT=2012` with whatever port you want the application to run on, it can **only** be set during build process.\n* Run `cp .env.example .env` if on linux/osx or `copy .env.example .env` for windows and fill the `.env` file with all the correct tokens and IDs .\n* After the image has been built, run it in a container with the command `docker run -d -p PORT:PORT --env-file .env --restart unless-stopped appeal-server`, the `PORT` has to be the same port you provided in the previous step while building the image. The command you run looks something like this `docker run -d -p 2012:2012 --env-file .env --restart unless-stopped appeal-server`.\n\nFollowing the above steps properly will have a fully functioning appeal server running on a docker container.\n\n## Selfhost\n\nTo host in your machine:\n\n* Assuming you have deno installed, run `cp .env.example .env` if on linux/osx or `copy .env.example .env` for windows.\n* Fill the `.env` file with all the correct tokens and IDs.\n* Start the app by running `deno run --no-check --allow-net --allow-read --allow-write --allow-env main.ts`.\n  \nIf you did everything correctly you should see `Listening to ...` in console which means it's running.\n\n## Adding the plugin and instructions to use it\n\n`[p]` is your prefix.\nTo get started with the plugin:\n\n* First add the plugin to your bot by running `[p]plugins add DjDeveloperr/ban_appeal_plugin/ban_appeal@main`.\n* You can configure the ban appeals category where channels will be made for appeals by running `[p]banappeal category category_id`, don't provide `category_id` to see the currently set category.\n* You can add a question for appeals by doing `[p]banappeal questions add your question` or you can add in bulk by doing `[p]banappeal questions setlist \"question1\" \"question2\"` questions with spaces must be wrapped in quotes `\"\"` like `\"this\"`.\n* To remove a question `[p]banappeal questions remove index-of-the-question`, you can find the list of questions and see their indexes by running `[p]banappeal questions list`\n* `[p]accept` to accept an appeal and `[p]deny` to reject it.\n\n## Commands\n\nThere's a few commands in the plugin. `[p]` is your prefix.\n\n* [p]accept\n* [p]deny\n* [p]banappeal\n\n## Environmental Variables\n\nYou need to obtain few env variables for this.\n\n* `MONGO` - It's your mongodb URI which you use for your [modmail](https://github.com/kyb3r/modmail) instance and add `/?authMechanism=SCRAM-SHA-1` to it if there's no query parameter already in the URI. It looks something like `mongodb+srv://Username:YourPassword@modmail-kjvn21.mongodb.net/?authMechanism=SCRAM-SHA-1` as I did have a query parameter already, I added `\u0026authMechanism=SCRAM-SHA-1`.\n* `PORT` - The port on which the server will run on.\n* `GUILD_ID` - The modmail guild ID used in your [modmail](https://github.com/kyb3r/modmail) instance.\n* `CLIENT_ID` - The client ID of your modmail bot, it can be obtained [here](https://discord.com/developers/applications) in the `OAuth2` section.\n* `CLIENT_SECRET` - The client secret of your modmail bot, it can also be obtained in the `OAuth2` section of your bot in [discord.dev](https://discord.com/developers/applications).\n* `TOKEN` - The token of your modmail bot, you can find it in the `Bot` section in [discord.dev](https://discord.com/developers/applications).\n* `REDIRECT_URI` - The domain/ip of your server where everyone can access your ban appeals server, if you use a domain you're on your own to setup a reverse proxy like nginx. Your domain/ip should also contain `/discord` with it like: `http://localhost:6969/discord`. Note you also have to add this in the `Redirects` section in the `OAuth2` menu of your bot in [discord.dev](https://discord.com/developers/applications), otherwise it won't work.\n\n## License\n\nCheck [here](LICENSE) for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjdeveloperr%2Fban_appeal_plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjdeveloperr%2Fban_appeal_plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjdeveloperr%2Fban_appeal_plugin/lists"}