Coder Social home page Coder Social logo

veganhacktivists / arabot Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 6.0 1.6 MB

A Discord bot written in TypeScript using Sapphire, specifically designed for the Animal Rights Advocates Discord server.

Home Page: https://www.aramovement.org/

License: GNU General Public License v3.0

TypeScript 99.88% Dockerfile 0.12%
discord typescript vegan discord-bot sapphire bot

arabot's Introduction

ARA Bot

ARA Bot is a free, open source Discord bot written in TypeScript using Sapphire, designed specifically for the Animal Rights Advocates Discord server.

This is designed to replace the old ARABot, which was not open source. This new bot uses slash commands and is overhauling a lot of the old systems.

Learn more about Animal Rights Advocates here.

Usage

Make sure to create the .env file, which you can use the .env.example.

There are 2 options for running this bot, one using docker-compose and the other, less desirable npm.

Docker

Running the bot Dockerised makes everything easier. To run the bot, run:

docker-compose up -d

Without Docker

Make sure to run npm install if you just cloned the repo.

Then make sure to compile the TypeScript files using

npm run build

If you are running the code for the first time with a new database, make sure to run npm run start:migrate, otherwise run:

npm start

Requirements

Docker

Docker and Docker-Compose are the only tools required for running the docker containers.

npm

  • Node v18.6.0 (older versions may work, only tested on v18.6.0)
  • Postgres server

Contributing

If you want to contribute, make sure to read the Contributing Guidelines, we appreciate any help offered! :)

You can also contact Anthony in the ARA Discord Server if you would want directions on what to develop or help when contributing to the bot.

Support

For support, feel free to send an email to [email protected] or reach out to Anthony or send a ModMail on the ARA Discord Server.

Authors

License

This bot is free and open source. It licensed using GPL v3.

Well done on making it to the bottom of the README file :)

arabot's People

Contributors

mercstef avatar renovate[bot] avatar smyalygames avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

arabot's Issues

Create an automute command

This command will change the settings in a VC so that the "Speak" permission is disabled for 30/60 minutes.

This command can be run in the specific VC text channel or by copying the VC ID and pasting it in as a parameter.

Sus Command: Purged notes persist in database

Describe the bug
Sus command does not remove entries from database when removed from a user.

To Reproduce
Steps to reproduce the behavior:

  1. type /sus add @name test
  2. type /sus purge @name
  3. The entries are still located in the database

Expected behavior
Purged notes should be removed from the database

Add a captcha for new users

Is your feature request related to a problem? Please describe.
To prevent bots from flooding the server

Describe the solution you'd like
When a user joins and agrees to the rules, they should be prompted to complete a captcha

Describe alternatives you've considered
Only requiring the user to agree to the rules, which would most likely need manual input from a user

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update dependency redis to v4.6.14
  • fix(deps): update dependency @sapphire/utilities to v3.16.2
  • fix(deps): update dependency discord.js to v14.15.3
  • chore(deps): update dependency eslint to v9
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

docker-compose
docker-compose.yml
  • postgres 16
  • redis 7
dockerfile
Dockerfile
  • node 20
github-actions
.github/workflows/codeql-analysis.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
.github/workflows/eslint.yml
  • actions/checkout v4
  • github/codeql-action v3
.github/workflows/prettier.yml
  • actions/checkout v4
npm
package.json
  • @prisma/client ^5.11.0
  • @sapphire/discord.js-utilities ^7.1.6
  • @sapphire/framework ^5.0.7
  • @sapphire/plugin-logger ^4.0.2
  • @sapphire/plugin-scheduled-tasks ^10.0.1
  • @sapphire/plugin-subcommands ^6.0.3
  • @sapphire/stopwatch ^1.5.2
  • @sapphire/time-utilities ^1.7.12
  • @sapphire/ts-config ^5.0.1
  • @sapphire/utilities ^3.15.3
  • @types/node ^20.11.26
  • bullmq ^5.4.2
  • discord.js ^14.14.1
  • redis ^4.6.13
  • ts-node ^10.9.2
  • typescript ^5.4.2
  • @typescript-eslint/eslint-plugin ^6.21.0
  • @typescript-eslint/parser ^6.21.0
  • eslint 8.56.0
  • eslint-config-prettier ^9.1.0
  • ioredis ^5.3.2
  • prettier 3.2.4
  • prisma ^5.11.0
  • node >=20
  • pnpm >=8

  • Check this box to trigger a request for Renovate to run again on this repository

Add information commands

Is your feature request related to a problem? Please describe.
This is where people need to copy and paste certain information or type out a lot of information.

Describe the solution you'd like
Have certain messages that can be brought up about

  • nutrients
  • circle of life
  • plants feel pain
  • etc.

This could all be stored onto a json or onto the command file itself, just depends how this would be done.

This could be done in a way where you'd type /information and Discord comes with options of what information could be shown.

Thanks Reeve for the suggestion :)

Upgarde sus command

Most of the features have been added to the sus commands, but there are a few features that should be added:

  • Add the classic ?sus command to just add sus notes (for leah ๐Ÿ™„)
  • Make reply ephemeral false in staff chats
  • Add multiple pages when viewing sus notes
  • Ordering of the sus notes are a bit strange

Add a leaderboard for XP

The XP and system is just bare-bones, and there aren't really that many features with it.

What should be added is a leaderboard.

Requirements:

  • Command that sends embed that shows the top 5-10 people on the leaderboard
    • This requires creating a function for the database to get the people with the most amount of XP/Levels

Nice to have features

  • The ability to go through multiple pages in the embed with buttons to see further in the leaderboard

Add a reward for a streak for running the /daily command

There seems to be little reward for running the /daily command so far, so adding a streak bonus should hopefully get more people to run the command.

Requirements

  • Use the logs in the database for the daily command runs to calculate how long the streak is.
  • Also create some form of method to reward the user with streaks that haven't been claimed prior as it would be unfair if certain people have a massive streak which causes them to get a massive bonus.

Proposed bonus

  • Day 0 Streak: 0
  • Day 1 Streak: 1
  • Day 2 Streak: 3
  • Day 3 Streak: 5
  • Day 4 Streak: 9
  • Day 5 Streak: 12
  • Day 6 Streak: 16
  • Day 7+ Streak: 20

Send a message in a channel for every Tweet

Is your feature request related to a problem? Please describe.
This would send a message in #twitter on Discord every time a tweet is sent. This currently is for every retweet from 5m5v on Twitter

Describe the solution you'd like
Send a message of the Tweet every time 5m5v retweets on Twitter

Describe alternatives you've considered
Using webhooks, but it seems a bit broken and does not seem to work with embeds on Twitter

Additional context
This lets activists do other forms of activism on Twitter, as 5m5v uses AI to try to figure out who may be considering to go vegan. More information can be looked at here from 5m5v: https://5minutes5vegans.org/

Add a custom automoderation for restriction

Is your feature request related to a problem? Please describe.
Having to manually moderate people who are bigoted takes time and resources.

Describe the solution you'd like
A way to auto-restrict or whatever for a user if they use bigoted language. This could be done by:

  • Just using a strong profanity filter
  • Using some logic with a potential point based system to calculate how likely it is that they are bigoted

Describe alternatives you've considered
Potentially using Discord's automod timeout to time out users for x amount of time for strong profanity or if they do enable a feature to give a role if they do add that feature.

Create new verification system

Create a new verification to the spec that Stove made.

Features to add:

  • Join a VC to create a VC.
  • Joining a VC removes all roles (that give access, don't worry about ping/pronoun roles).
  • Joining a VC adds a role to the user that won't allow them to access the verification VC again.
  • Add a scheduler with the database that tracks when to remove that role that blocks the user from accessing verification vcs again.
  • Add an automatic message pinging verifiers with the details (including sus notes) of the user that joined the server and that they want to verify.
  • Joining a VC creates a text channel about that user that only verifiers can access.
  • Add a timeout if verifier does not join within 15 minutes.
  • Send DMs for each timeout explaining when their timeout is over.
  • Add welcome messages for after verification has been complete.
  • Add a check if a vc is empty on bot start.
  • Add the walk through for the bot.
  • Add a check when the user joins the server if they have been verified before, give respective roles and even verify block.

Features to keep in mind:

  • Have a maximum of 10 verification VCs.

Improve counting functionalities

The bot currently has a counting channel where people can count.

There are some improvements that are required.

These are:

  • Deleted counts makes the bot send a message with the previous count (and the person that deleted it)
  • Edited messages makes the bot send a message with the previous count

Quality of life upgrades:

  • Allow usage of maths to count
  • Potentially add a leaderboard of some sorts

Add a quiz system

Is your feature request related to a problem? Please describe.
This is where staff members can create a multiple choice question for their own section and they will be posted in their respective parts of the server.

Describe the solution you'd like
Create a command that adds a question with multiple choice options of up to 4. Store this in a database and make it so that these questions randomly pop up in the respective chats for the section that created those questions.

For the quiz popping up, it will create an embed with the question and Discord buttons with the multiple choice answers.

Describe alternatives you've considered
Could create a spreadsheet with the questions and answers and that could pull the data instead of using the database. This may be more annoying than using a slash command though.

Activist Notes

Is your feature request related to a problem? Please describe.
There is a difficult way for our activists to know if someone is difficult to do activism with and what has already been tried on them.

Describe the solution you'd like
A way to keep notes on a user like the sus notes system we already have but it would be open to activists on the server and there may be a way to make a hierarchy of notes, lets say there is also mod notes involved there or whatever

Describe alternatives you've considered
None really...

ARA Bot migration essentials

These are all the commands that are required to be migrated to the new ARA Bot:

Normal roles:

  • Vegan
  • Activist
  • Trusted
  • Veg Curious
  • Plus
  • Book Club
  • Debate
  • Game Night
  • Guest

Staff roles:

  • Mod
  • Restricted Access
  • Verifier
  • Trial Verifier
  • Mentor
  • Diversity Team

General Commands:

  • Apply
  • Count (displays how many vegans and non vegans on the server)

Moderation Tools:

  • Restrict (restricted/tolerance)
  • Restrict Vegan (can potentially be made into the command above)
  • Rename User
  • Soft Mute (prevents users from reacting - it's already a role)
  • Unrestrict
  • VC Mute

Verification Tools

  • Verify command
  • Vegan
  • Activist
  • Trusted
  • Veg Curious
  • Convinced

Coordinator Tools:

  • mvall (move all users in a vc to another one)
  • Access
  • Anon (send a message via the bot)
  • Clear (clears certain messages up to 100)
  • Private channels

Economy will most likely be implemented at a later date with the gamification of ARA Bot

Create a command to purge verify-as-vegan

Create a command that gives anyone that has the 'verify-as-vegan' (Discord Snowflake: 854725899576279060) role or doesn't have any role at all the 'Not vegan' role (Discord Snowflake: 774763753308815400).

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.