GithubHelp home page GithubHelp logo

arch-community / qbot Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 10.0 9.71 MB

a general purpose utility Discord bot, originally created for the Arch Linux community

Home Page: https://discord.gg/yfvZ73DDUb

License: GNU Affero General Public License v3.0

Ruby 94.00% Shell 0.10% Nix 5.89%
discord-bot discordrb discord archlinux community moderation bot nix

qbot's People

Contributors

anna328p avatar dependabot[bot] avatar electron271 avatar fjorge0 avatar gregdan3 avatar kilipan avatar ofthegoats avatar sophon96 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

qbot's Issues

Queries can break .oq

Queries can be too long or contain invalid characters that make .oq return Bad Request errors internally

Role assignments and rolegroups

  • Rolegroups have the following attributes:

    • Name
    • Description
    • Maximum roles
    • Selfrole toggle - can anyone get roles from this group, or is it restricted to admins giving roles?
  • Roles can be added to a rolegroup (stored as a GroupedRole)

    • Can have a linked emoji for reaction actions
  • Color roles are also exposed as a rolegroup

  • Users can get a role from the group if it has selfroles enabled

  • Create quick reaction message from a rolegroup

    • Updated automatically - ID is stored
    • Uses trigger system internally

Blocking `qbot` allows user to send blacklisted text

Explanation and cause:
This is because qbot sends the direct message to the user before deleting the message (here on line 44 of the blacklist module), if the user blocks qbot, it will cause an exception preventing the deletion of the message.

Steps to reproduce:

  1. Block qbot on discord
  2. Send a message with blacklisted text in it

Expected result:
qbot deletes the message

Actual result:
Nothing happens (presumably, qbot raises an exception)

Proposed fix:
Have qbot delete the message prior to sending the direct message

CCR duplicates colour roles in list

I was using Qbot to generate some colors and I wanted some new ones so I ran .ccr after already generating some color roles, and the bot sent

Deleting existing color role color31 [c].
Deleting existing color role color31 [c].

then stopped, so I ran it again and the bot sent

Deleting existing color role color30 [c].
Deleting existing color role color30 [c].

and stopped again.

Long figlets will overload bot

When entering abnormally long strings into figlet (tested with a string of 1992 Ws), under unknown circumstances the bot will shut down

This will also generate large walls of spam

Bot does not work in direct messages

So far, I have found two causes for this:

  1. find_prefix in lib/helpers.rb fails since event.server is nil and therefore doesn't have an id attribute
  2. can_run in lib/patches.rb fails due to the same reason.

Blacklist entry scope

Ability for blacklist entries to apply to servers or channels. Would require a new scope column in the blacklist entry table.

Job schedule and delay system

Jobs using Active Job with Delayed Job backend

Schedule jobs with a delay (they execute at a certain time roughly, useful for timed role assignments) or regularly (clear out old oneshot triggers or queries)

Trigger, condition and action system

  • Triggers can be created per-message, per-channel, or per-server.
  • Triggers can be of different types:
    • Message text
    • Reaction
    • Custom bot command
  • Conditions can test if the invoking user has certain roles or other attributes.
  • Actions can do one of the following:
    • Send a message
    • Assign a role arbitrarily
    • Assign a role from a rolegroup

Reaction roles will use this system internally.

Make "…" trigger a note

Some keyboards like to do this symbol instead of ....

After looking in the code this may be a bit harder to implement

ⓘ Jump to line

  command :note, {
    aliases: %i[n ..],

The aliases part relies on there already being a period at the beginning, but since this is a unicode character this is not the case. The only way it seems would be to rewrite the aliases bit to not always expect there to be a period at the beginning, which would also mean rewriting many commands.

I have no idea how the command system works internally and I cannot find much information about it, however it is possible that it is baked into discordrb which would be a bit more annoying.

Closest I could find is this, however as I do not know ruby I am unsure.
ⓘ Jump to line

  # A command that references another command
  class CommandAlias
    # @return [Symbol] the name of this alias
    attr_reader :name

    # @return [Command] the command this alias points to
    attr_reader :aliased_command

    def initialize(name, aliased_command)
      @name = name
      @aliased_command = aliased_command
    end
  end

I cannot help with actually developing this much as ruby does not want to work for me, however I can still write (some) code.

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.