This project aims to provide various metrics from inside a Discord server to create insight and alerting on actions and messages.
Discord Communities like most active communications channels online have been subject to trolls, spam and misbehaving people since the day of their birth. While active moderation and a well minded community can actively engage such bad behavior, this project is part of a chain of projects to allow data driven moderation as well as proactive reactions.
Based on the generated insights by projects like promcord
we aim to allow admins making quicker decisions based on community requests (users reporting other user) founded by real data insights.
This service should connect to a server and listen to every message in all channels on it. For starters, we process every message by it's channel, sender and length and hand it over to Prometheus for storing it as time series.
We then build queries showing insight on every users behavior based on time and channel.
Further on we are able to create alerts on thing like highly increased amount of messages by a single user in a channel
.
When a user then gets in touch with the admin (probably through a report-user bot), the admin can quickly gain insight if the reported user might be of harm based on the insights provided by promcord
and make a quick but informed decision prone to later review.
This project is built using Bazel.
To build and run the code directly, install Bazel and run make run CMD=//cmd/promcord
.
We build directly into a docker image and deploy it to Kubernetes.
The image step can be triggered manually by running make docker CMD=//cmd/promcord
.
To deploy directly to Kubernetes, run make kube CMD=//cmd/promcord:dev
which we use internally as dev deployment target.
There will be a :prod
target in the future.
To run the dev build locally simply execute make run CMD=//cmd/promcord
.
The application requires certain environment variables to be set (instead of command line arguments).
If required ones are missing you will see an error like the following:
ERROR: METRICS missing value: missing required key
HELP: METRICS: metrics port
Just set the required values inside your .env file or add them before your run command:
METRICS=:8080 make run CMD=//cmd/promcord
Our code is always checked by Travis using make test check
therefor all Golang rules on syntax and formating have to be met for pull requests to be merged.
While this might incur more work for possible contributors, we see the code produced here as production critical once finished and therefor strive for high code quality.
We are developing this mostly using TDD and BDD. If you don't know what this is, we recommend this video for starters.
Please do reasonable commit sizes.
All dependencies inside this project are being managed by dep and are checked in.
After pulling the repository, it should not be required to do any further preparations aside from make deps
to prepare the dev tools (once).
If new dependencies get added while coding, make sure to add them using dep ensure --add "importpath"
and to check them into git.
We recommend adding your vendor changes in a separate commit to make reviewing your changes easier and faster.
To run tests you can use:
make test
Feedback and contributions are highly welcome. Feel free to file issues, feature or pull requests. If you are interested in using this project now or in a later stage, feel free to get in touch. If you are developing or already finished solutions that rely on rcon in any way, we would be happy to talk to you for both gaining insights as well as looking for options to collaborate and involve your project into other endeavors.
We are always looking for active contributors, team members and partner projects sharing our vision. Easiest way of reaching us is via Discord.
See you soon, the PlayNet Team
This project's license is located in the LICENSE file.