Skip to content

Repository files navigation

Project overview

Discord bot currently in use by the FreeBSD Discord server. The objective is to provide a bridge between the different FreeBSD services (Bugzilla, Phabricator, Git, etc) and the Discord platform itself while also introducing preventative measures to combat spam/malicious users.

So far implemented is a handful of commands, event handlers and a webhook that forwards commits of the FreeBSD GitHub repositories to Discord.

Command Description
!help Displays available commands
!status Shows bot status
!role Allows users the ability to assign themselves roles
!bug Sends a message embed detailing a problem report from Bugzilla. Additionally, messages matching the FreeBSD Bugzilla URL will trigger this event
!review Sends a message embed detailing a Differntial revision from Phabricator. Additionally, messages matching the FreeBSD Phabricator URL will trigger this event
!user Sends a message embed detailing a user

Key events on Discord including message updates, deletions, member removals and bans are logged in a public channel to ensure transparency within our community. Recently, we've seen users attempting to promote malicious advertisements or spam channels. To combat this, we have implemented an "antispam" measure to help identify and reduce these issues as they arise.

While it's not possible to create heuristics that cover every type of behavior, we make a basic attempt to identify the most significant offenders and take appropriate action. In this repository, you will find bot.antispam.rules in the default YAML file that outlines common patterns of spam along with associated timeout values. The goal is to expand this file over time to address more advanced cases effectively.

Building and deployment

Before proceeding to build anything ensure a valid configuration file exists in the root of the project. Example can be found here.

go and gmake must be installed to build the project. Optionally, golangci-lint for linting the code.

Container image (recommended)

Optionally, you can build OCI images and deploy through podman or docker.

# make container

Once successfully built run the images as follows, passing the config.yaml configuration file as a volume mount, replacing $HASH with the according git sha:

# podman run --rm -v ./config.yaml:/app/config.yaml:ro localhost/pulsar-bot:$HASH
# podman run --rm -v ./config.yaml:/app/config.yaml:ro localhost/pulsar-relay:$HASH

Container images are automatically published to GitHub on each commit passing the build pipeline. Like above, run the following:

# podman run --rm -v ./config.yaml:/app/config.yaml:ro ghcr.io/lcook/pulsar/bot:$HASH
# podman run --rm -v ./config.yaml:/app/config.yaml:ro ghcr.io/lcook/pulsar/relay:$HASH
Manually building Run:
# make build

This will build both the bot and relay Go binaries.

License

BSD 2-Clause

About

Pulsar Discord Bot

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Packages

Used by

Contributors

Languages