shinpuru

module
v0.0.0-...-553821e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2024 License: MIT

README


~ シンプル ~

A simple multi purpose discord bot written in Go (discord.go)
with focus on stability and reliability


    Docker Cloud Automated build 

Branch Tests CI Docker CD Releases CD
master (stable)
dev (canary)

Invite

Here you can choose between the stable or canary version of shinpuru:

Intro

シンプル (shinpuru), a simple (as the name says), multi-purpose Discord Bot written in Go, using bwmarrin's package discord.go as API and gateway wrapper and ken as slash command and interaction framework. The focus on this bot is to provide general purpose, administration and security tools while keeping stability, reliability and maintainability in focus.

shinpuru is mainly used as administration and security tool on my development discord. Feel free to drop by to see shinpuru in action! 😉


Features

Slash Commands

shinpuru mainly uses slash commands to interact with the bot. In the wiki, you can find an automatically generated list of commands, their descriptions and how to use them (or here you can find a more interactive list in the web interface).

You can also find a searchable list in the web interface of shinpuru.

https://user-images.githubusercontent.com/16734205/138589141-1cc18316-0d07-4526-b86a-be5aa91bbc5a.mp4

Web Interface

If you are sick of using commands, you can also use the web interface of shinpuru. Simply log in with your Discord Account (alternatively, you can also use the /login command).

Most features of shinpuru available via slash commands are also accessible in the web interface with additional visualization and information provided.

https://user-images.githubusercontent.com/16734205/225418408-beecb181-5dbe-4c0b-9110-94b8e715f308.mp4

REST API

The web interface simply connects to the REST API exposed by the web server of shinpuru. You can also acquire an API token linked to your account to access the REST API directly, if you want.

Here you can read more about how to connect to shinpuru's REST API and which endpoints are available.

Chat Features

Code Execution

When someone posts code inside a code block, shinpuru can extract the code and language and execute it outputting the result into chat.

The code is picked up and sent to a code execution engine, which safely executes the code and sends back the result via a REST API. Therefore, you can chose between ranna or JDoodle in the config.

Karma

shinpuru features a Karma system which is inspired by Reddit. You can define specific emotes which, when attached to a message, increase or reduce the karma points of a member. You can also specify the amount of "tokens" which can be spent each hour as well as a penalty for giving negative karma, which also takes karma from the executor to prevent downvote spam.

It is also possible to execute actions when passing specific amounts of karma. For example, you can add or remove roles, send messages or even kick/ban members depending on their karma points.

Color Reactions

Another unique feature of shinpuru are color reactions. When enabled (see /colorreaction), shinpuru can fetch colors from chat messages and display them into a reaction. When clicked on the reaction, more information about the color is then posted into chat.

Votes

You can simply create votes using the /vote slash command where users can pseudo anonymously vote using reactions.

Twitch Notifications

You can add names of twitch streamers to a watchlist (see /twitchnotify) and when they go live, a notification message in sent into the specified channel.

Quote Messages

You can use the /quote command to quote messages by ID or link (even cross-channel).

image

Starboard

As literally any other bot, shinpuru also features a starboard! You can even specify an amount of karma members get when their message get into the starboard.

Channel Statistics

You can use the /channelstats command to analyze contribution statistics for specific text channels.

Guild Security & Moderation

Report System

shinpuru features a deeply integrated reporting and moderation system. You can create reports for members who violate guild rules which then are posted into a modlog channel (if specified). Also, all reports of a member can be viewed on their user profiles as well as in the web interface.

Of course, you can also kick and ban members with shinpuru, which also creates a report record in the modlog. It is even possible to create so called "ghost reports". It allows to report or ban members by ID which are no more part of the server.

When a member wants to request an unban, this can be done via the web interface when navigating to <webAddress>/unbanme.

https://user-images.githubusercontent.com/16734205/140642193-a89e90c5-f38d-40cd-82bb-d25b65aa3dc7.mp4

Guild Backups

When enabled, shinpuru will create a backup of your guild's infrastructure every 12 hours. This includes guild settings, channels (names, positions and groups), roles (names, positions and permissions) and members (nicknames and applied roles).

When your guild gets raided or an admin goes rouge, you can simply choose one of the created backups and reset the guilds state.

The last 10 backups are stored and can be reviewed in the web interface.

Raid Alerting

This system allows you to set a threshold of new user ingress rate. When this rate exceeds, for example when a lot of (bot) accounts flush in to your guild (aka raiding), all admins of the guild will be alerted via DM. Also, the guilds moderation setting will be raised to Highest so that only users with roles or a valid phone number can chat.

image

Additionally, all joined users after the event triggered are logged in a list which can be viewed in the web interface. You can also use this list to bulk kick or ban users captured in the antiraid join list.


Docker

Read about how to host shinpuru using the provided Docker image in the wiki article.


Compiling

Read about self-compiling in the wiki article.


Public Packages


Third party dependencies

Back End
Web Front End
Assets

The mascot artwork is created by the wonderful artist Kuglu. Please feel free to give them a visit. 💖


Copyright © 2018-present zekro Development (Ringo Hoffmann).
Covered by the MIT License.

Directories

Path Synopsis
cmd
internal
pkg
acceptmsg
Package acceptmsg provides a message model for discordgo which can be accepted or declined via message reactions.
Package acceptmsg provides a message model for discordgo which can be accepted or declined via message reactions.
acceptmsg/v2
Package acceptmsg provides a message model for discordgo which can be accepted or declined via message reactions.
Package acceptmsg provides a message model for discordgo which can be accepted or declined via message reactions.
angularservice
Package angularservice provides bindings to start an Angular development server via the Angular CLI.
Package angularservice provides bindings to start an Angular development server via the Angular CLI.
argp
Package argp is a stupid simple flag (argument) parser which allows to parse flags without panicing when non-registered flags are passed.
Package argp is a stupid simple flag (argument) parser which allows to parse flags without panicing when non-registered flags are passed.
boolutil
Package boolutil provides simple utility functions around booleans.
Package boolutil provides simple utility functions around booleans.
bytecount
Package bytecount provides functionalities to format byte counts.
Package bytecount provides functionalities to format byte counts.
checksum
Package checksum provides functions to generate a hash sum from any given object.
Package checksum provides functions to generate a hash sum from any given object.
colors
Package color provides general utilities for image/color objects and color codes.
Package color provides general utilities for image/color objects and color codes.
ctypes
Package ctype provides some custom types with useful function extensions.
Package ctype provides some custom types with useful function extensions.
discordoauth
package discordoauth provides fasthttp handlers to authenticate with via the Discord OAuth2 endpoint.
package discordoauth provides fasthttp handlers to authenticate with via the Discord OAuth2 endpoint.
discordoauth/v2
package discordoauth provides fasthttp handlers to authenticate with via the Discord OAuth2 endpoint.
package discordoauth provides fasthttp handlers to authenticate with via the Discord OAuth2 endpoint.
discordutil
Package discordutil provides general purpose extensuion functionalities for discordgo.
Package discordutil provides general purpose extensuion functionalities for discordgo.
embedbuilder
Package embedbuilder provides a builder pattern to create discordgo message embeds.
Package embedbuilder provides a builder pattern to create discordgo message embeds.
etag
Package etag implements generation functionalities for the ETag specification of RFC7273 2.3.
Package etag implements generation functionalities for the ETag specification of RFC7273 2.3.
fetch
Package fetch provides functionalities to fetch roles, channels, members and users by so called resolavbles.
Package fetch provides functionalities to fetch roles, channels, members and users by so called resolavbles.
giphy
Package giphy provides a crappy and inclomplete - but at least bloat free - Giphy API client.
Package giphy provides a crappy and inclomplete - but at least bloat free - Giphy API client.
hammertime
Package hammertime provides functionailities to format a time.Time into a Discord timestamp mention.
Package hammertime provides functionailities to format a time.Time into a Discord timestamp mention.
hashutil
Package hashutil provides general utility functionalities to generate simple and fast hashes with salt and pepper.
Package hashutil provides general utility functionalities to generate simple and fast hashes with salt and pepper.
httpreq
Package httpreq provides general utilities for around net/http requests for a simpler API and extra utilities for parsing JSON request and response boddies.
Package httpreq provides general utilities for around net/http requests for a simpler API and extra utilities for parsing JSON request and response boddies.
inline
Package inline provides general inline operation functions like inline if or null coalescence.
Package inline provides general inline operation functions like inline if or null coalescence.
intutil
Package intutil provides some utility functionalities for integers.
Package intutil provides some utility functionalities for integers.
jdoodle
Package jdoodle provides an API wrapper for the jdoodle execute and credit-spent REST API.
Package jdoodle provides an API wrapper for the jdoodle execute and credit-spent REST API.
lctimer
Package lctimer provides a life cycle timer which calls registered callback handlers on timer elapse.
Package lctimer provides a life cycle timer which calls registered callback handlers on timer elapse.
limiter
Package limiter provides a fiber middleware for a bucket based request rate limiter.
Package limiter provides a fiber middleware for a bucket based request rate limiter.
lokiwriter
Package lokiwriter implements rogu.Writer to push logs to a Grafana Loki instance.
Package lokiwriter implements rogu.Writer to push logs to a Grafana Loki instance.
md
Package md provides some simple markdown fowmatting utilities.
Package md provides some simple markdown fowmatting utilities.
mimefix
Package mimefix provides functionalities to bypass this issue with fasthttp on windows hosts*: https://github.com/golang/go/issues/32350
Package mimefix provides functionalities to bypass this issue with fasthttp on windows hosts*: https://github.com/golang/go/issues/32350
mody
Package mody allows to modify fields in an object.
Package mody allows to modify fields in an object.
msgcollector
Package msgcollector provides functionalities to collect messages in a channel in conect of a single command request.
Package msgcollector provides functionalities to collect messages in a channel in conect of a single command request.
multierror
Package multierror impements handling multiple errors as one error object.
Package multierror impements handling multiple errors as one error object.
onetimeauth
Package onetimeout provides short duration valid JWT tokens which are only valid exactly once.
Package onetimeout provides short duration valid JWT tokens which are only valid exactly once.
onetimeauth/v2
Package onetimeout provides short duration valid JWT tokens which are only valid exactly once.
Package onetimeout provides short duration valid JWT tokens which are only valid exactly once.
permissions
Package permissions provides functionalities to calculate, update and merge arrays of permission domain rules.
Package permissions provides functionalities to calculate, update and merge arrays of permission domain rules.
random
Package random provides some general purpose cryptographically pseudo-random utilities.
Package random provides some general purpose cryptographically pseudo-random utilities.
rediscmdstore
Package rediscmdstore provides an implementation of github.com/zekrotja/ken/store.CommandStore using a redis client to store the command cache.
Package rediscmdstore provides an implementation of github.com/zekrotja/ken/store.CommandStore using a redis client to store the command cache.
regexputil
Package regexutil provides additional utility functions used with regular expressions.
Package regexutil provides additional utility functions used with regular expressions.
roleutil
Package roleutil provides general purpose utilities for discordgo.Role objects and arrays.
Package roleutil provides general purpose utilities for discordgo.Role objects and arrays.
slices
Package slices adds generic utility functionalities for slices.
Package slices adds generic utility functionalities for slices.
startuptime
Package startuptime provides simple functionalities to measure the startup time of an application.
Package startuptime provides simple functionalities to measure the startup time of an application.
stringutil
Package stringutil provides generl string utility functions.
Package stringutil provides generl string utility functions.
thumbnail
Package thumbnail provides simple functionalities to generate thumbnails from images with a max witdh or height.
Package thumbnail provides simple functionalities to generate thumbnails from images with a max witdh or height.
timerstack
Package timerstack provides a timer which can execute multiple delayed functions one after one.
Package timerstack provides a timer which can execute multiple delayed functions one after one.
timeutil
Package timeutil provides some general purpose functionalities around the time package.
Package timeutil provides some general purpose functionalities around the time package.
twitchnotify
Package twitchnotify provides functionalities to watch the state of twitch streams and notifying changes by polling the twitch REST API.
Package twitchnotify provides functionalities to watch the state of twitch streams and notifying changes by polling the twitch REST API.
validators
Package validators provides some (more or less) general purpose validator functions for user inputs.
Package validators provides some (more or less) general purpose validator functions for user inputs.
versioncheck
Package versioncheck provides endpoints to retrieve version information via different providers and utilities to compare versions.
Package versioncheck provides endpoints to retrieve version information via different providers and utilities to compare versions.
voidbuffer
Package voidbuffer provides a simple, concurrency proof push buffer with a fixed size which "removes" firstly pushed values when fully filled.
Package voidbuffer provides a simple, concurrency proof push buffer with a fixed size which "removes" firstly pushed values when fully filled.
voidbuffer/v2
Package voidbuffer provides a simple, concurrency proof push buffer with a fixed size which "removes" firstly pushed values when fully filled.
Package voidbuffer provides a simple, concurrency proof push buffer with a fixed size which "removes" firstly pushed values when fully filled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL