Coder Social home page Coder Social logo

woojiahao / taiga Goto Github PK

View Code? Open in Web Editor NEW
20.0 5.0 12.0 9.46 MB

Discord administration bot

Home Page: https://woojiahao.github.io/Taiga

License: MIT License

Kotlin 96.67% Python 3.33%
kotlin discord-bot jda-discord-bot heroku docsify discord python-script python documentation cross-server

taiga's Introduction

Taiga

alt text

Prefix: ? Creator: @Chill#4048 Language: Kotlin Library: JDA Invite Link Development Server Website

Features

  • Raid Control

    Taiga offers a built in raid control system system that is able to catch, track and record raiders and allow you to properly and easily manage them.

  • User Management

    Taiga has a simple to use user management system, allowing you to mute, warn, strike users as well as view their history and various information such as the number of unwanted invites they have sent before etc.

  • Invite Handling

    Taiga's watchful eye also catches unwanted Discord invites and deals with these ruffians accordingly.

  • Suggestions System

    Taiga has a built in suggestion system that allows your members to provide feedback to you.

  • Customization

    Taiga comes with an open and easy to customize preference system, giving you minute control over the different aspects of her.

  • Fun

    Taiga has fun commands for you to mess around with!

Commands Overview

More information about commands can be found on the website

  1. Administration
  2. Moderation
  3. Permission
  4. Utility
  5. Role
  6. Raid
  7. Suggestion
  8. Macro
  9. Fun
  10. Invite
  11. Embed

Administration

Name Description
setchannel Sets the channel to a specific channel type
setup Sets up the bot for moderation like adding the muted roles and overriding channel permissions
preferences Displays all the properties set for the server
set Sets the value for a preference
get Displays the details of a specific preference set
disable Disables a specific channel type
enable Enables a specific channel type

Moderation

Name Description
echo Echos a message into another channel, the message to echo cannot contain mentions
nuke Nukes a certain number of messages, from 0 up to 99, you can alternatively pass a valid Regex expression such that only messages that contain the matching regex will be deleted
mute Mutes a user for a specified period of time, defaulted to minutes
history Displays the history of a specific member, if no arguments are given, the invoker's history is retrieved
strike Infracts a user
warn Infracts a user with a 0 weight strike
wiperecord Wipes the user's record from the database
ban Bans a user/list of users (up to 30) from the server at once
unban Unbans a user and leaves a mark on their history
gag Temporarily mutes a user for 5 minutes to allow moderators to handle an ongoing situation
clearstrike Removes a strike from a user

Permission

Name Description
setpermission Sets the permission of a command/category to be available to a role and higher
viewpermissions Views all the permissions set in the server
setglobal Sets a single command or category of commands to be available to everyone
viewbotpermissions Displays the permissions that the bot has on the server

Utility

Name Description
help Displays a help card for the user to learn more about a specific command or category, pass no arguments and it will display all commands available to you
invite Displays all invite links related to me such as my development server and to invite me to your server
source Displays all links related to my source code
ping Displays the ping for me
serverinfo Displays information about the server
botinfo Displays information about the bot
changelog Displays the latest changelog if no argument is given, displays a specific changelog if one can be found
google Performs and displays a google search of a query
pin Pins some text to the channel

Role

Name Description
assign Assigns a role to the specified user, the role must not be higher than my role
roles Displays all roles and their IDs in the server
clearjoinrole Clears the join role
unassign Removes a role from the user, the role must not be higher than my role

Raid

Name Description
viewraiders Displays all the raiders in the server
freeraider Removes a user from the raid list and unmutes them
freeallraiders Removes all users from the raid list and unmutes them

Suggestion

Name Description
poolinfo Displays information about the suggestion pool
pooltop Displays the latest suggestion in the pool
poolaccept Accepts the latest suggestion in the pool
pooldeny Denies the latest suggestion in the pool
suggest Adds a suggestion to the suggestion pool
respond Responds to a suggestion

Macro

Name Description
listmacros Displays all the macros on the server
addmacro Adds a macro to the server
editmacro Edits an existing macro on the server
removemacro Removes an existing macro from the server

Fun

Name Description
clapify Clapifies a sentence
flip Flips a coin
cookie Give someone a cookie, if you don't pass any arguments, a cookie is given to a random stranger
meme Displays a random popular meme from Imgflip
joke Tells a joke
emote Displays an emote based on the name if it can be found in any of the servers Taiga is in
cat Displays a cat picture/GIF
dog Displays a dog picture/GIF
bird Displays a bird picture/GIF
anime Searches for animes based on a search term
lyrics Searches for the lyrics of a song based on the song name

Invite

Name Description
addinvite Adds an invite to the whitelist, only the owner can add invites
removeinvite Removes an invite from the whitelist, only the owner can remove invites
whitelist Displays all the whitelisted invites for the server

Embed

Name Description
postembed Posts the current embed to a channel
getembed Displays the currently built embed
clearembed Clears the currently built embed
setembedcolor Sets the color of the embed
setembedtitle Sets the title of the embed, title is limited to only 1024 characters long
setembeddescription Sets the description of the embed, description is limited to only 1024 characters long
setembedthumbnail Sets the thumbnail of the embed, the description must be an image url
addfield Adds an empty field to the embed
setfieldtitle Sets the title of a field, the title is limited to 1024 characters
setfielddescription Sets the description of a field, the description is limited to 1024 characters
removefield Removes a field from the embed
clearembeddescription Clears the description of an embed
clearembedthumbnail Clears the thumbnail of an embed

Credits

Taiga's command framework is heavily inspired by @Fox#0001 HotBot.

taiga's People

Contributors

ianagbip1oti avatar woojiahao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

taiga's Issues

Bot Message Duration

Allow users to toggle whether they want the bot messages to be deleted after a while or not.

This can be stored as a Preference and subsequently checked per command invoke in the server.

set duration { duration (in s) } to set it
remove duration to remove it

Moderation System Customization

Allow users to customize the moderation system:

  1. Expiration of strikes
  2. Weight of each strike
  3. Action taken per weight
  4. Max strike limit

Backup System

Create a backup system for Heroku since it does not store persistent data between iterations of the bot.

Requirements

  1. Back up at a certain time every week
  2. Transfer all the data from the database to a persistent data store like S3 (there's a plugin for Heroku for that)

Additional Bonuses

  1. If the data store provides a CDN for users, move the GIF store into the CDN

Pre command actions

Add a method to command sets to allow pre-checking actions to be performed before each command in the category is executed, this can be useful for Embed creation and suggestion system

Regex Argument Type

Create a regex argument type to read and parse regex expressions.

This has to be an end argument since regex has spaces and it should thus be treated as such

DateTime for logging embeds

Currently, the date time will display the date time of the region in which the bot is being hosted in, this is not ideal, thus, find a way to set the date time to be the date time of the user?

Planned Command List

This list contains all the planned commands. If you wish to take up a certain command and finish it, please, make a new issue and began discussion on that one instead. If you have a suggestion for a command, discuss it here.

  1. eval that uses Kotlin to JS to evaluate JS expressions typed in chat
  2. latex to display LaTeX expressions
  3. plot that uses a plotting API to display simple plots
  4. raid strictens the raid elements for that server to stop raiders, this can include disabling welcomes
  5. reset resets a preference to the default that it would have had

Reworking Command Framework

Current command framework might bug if the command is overloaded with a sentence at the end:

Simulation

  1. Overload strike command to not receive the Integer() input
  2. This should default the strike to 1 with the reason
  3. Call the strike command
  4. With the current strike system, it should throw an exception that the first word in the sentence is not a valid input, this is not meant to happen

Fix

  • Parsing of arguments should be done for each set of potential argument to command. The latest that matches will be returned
  • Commands should be sorted by number of argument types

Raid Control Improvements

There are lots that can be done to enhance the raid control of the bot:

  1. Check/log the type of message and frequency of the same message before muting the raider (This should be toggled on/off since in a big raid, there's no time to do these minute checks)
  2. Checking the length of a message will also help as short spammy messages should be caught whereas a long message just because the user can type fast should not be caught
  3. Track user join rates for each server. If the join rate within X seconds increases suddenly, then the bot should be able to increase the security of the server automatically (This should be toggled on/off)
  4. Command to stricten the raid requirements when needed

Potential Bug With setGlobal()

There's a potential bug for the global flag as it gets overwritten by the CommandContainer.

Simulation

  1. Set a category to global
  2. Set a specific command in that category to not be global
  3. Run the bot and view the permissions
  4. Permission even for that specific command will be global

Suggestion Pools

Allow the accepting and declining of suggestions within the pool, not just the latest

Wiki

To-Do for the Wiki:

  • Basic usage guide
  • Information guide for commands
  • Document what all argument types do
  • Setting up preferences in Taiga
  • How to contribute
  • How to add a changelog

Python Script Bug

In command_overview_main.py, the script fails because there are emojis in the actual README.md.

Fixes:

  1. Change the raw emoji into unicode so it can be read like normal
  2. Introduce some emoji library to help with parsing the data

Dynamic commands info updater

Create a listener for whenever the help.json gets updated, and when it gets updated, create and post the update to the respective wiki page

Developer Command Category

Since an issue command is planned to be made, it would be a lot easier to create a suite of commands that are targeted at the bot developers.

The category could be named Developer and it should be made global to every user by default.

New Commands

  1. issues - display all issues on the repo
  2. file - opens an issue on this repo
  3. star - to star the repo
  4. viewbotpermissions - displays the permissions a bot has in the server

Moving Existing Commands

Existing commands wiki and source can be moved to this category then.

Enhancing help.json

Include an optional array for argumentList for each command which will display the list of allowed inputs for words:

{
    "name": "blah",
    "description": "blah",
    "syntax": "blah { Test }",
    "example": "blah",
    "argumentList": [
        {
            "name": "Test",
            "args": ["ok", "no", "yes"]
        }
    ]
}

Each argument in that list will follow the name in the syntax and match it up.

This will be displayed in help and in the documentation in a separate section.

Ratelimit Command Invokes

Command invokes, and by extension of that, macro calls should be rate limited so that the bot doesn't become spammy

Add the position of the selected item from a interactive embed

The position of the selected item should be given to each interactive embed:

Formula:

[(page # - 1) * 10] + (selected index (number displayed) + 1)

Example:
The user has selected 5 on the 2nd page, they have effectively selected the 16th item in the data array.

[(2 - 1) * 10] + (5 + 1) = 16

Note: The 16th selected item will be index 15 of the array. So you can remove the +1 when passing it through the lambda.

Database Edits

  1. Introduce CASCADE ON DELETE for the Strike table

    When a strike is removed, the user record for it is automatically removed as well

Global annotation

Global commands should be set using an annotation.

Example:

@CommandSet
@Global
fun animalCommands() = commands("Animal") {}

Unify ban and banall

There is no need for both, since a single ban command could be setup to take 1 or more user ids.

Unit Testing

Mock discord bot connections and test the various commands to ensure they are working.

Once unit tests are introduced, bring in continuous integration.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.