Giter Club home page Giter Club logo

mcodingbot's People

Contributors

circuitsacul avatar dependabot[bot] avatar enderchief avatar fuexfollets avatar isfakeaccount avatar lunarmagpie avatar mithicspirit avatar qexat avatar sigmanificient avatar soupless avatar trag1c avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

mcodingbot's Issues

Move custom Plugin, use it consistently, custom context

I just realized that some plugins are using crescent.Plugin, while others are using the one located in utils/. That should be fixed, and while we're at it, I think it should be moved.

These are the tasks I have in mind, idk if we want to do all of them or not.

  • Move utils.plugin:Plugin to plugins._plugin:Plugin
  • Always use the subclassed version of the plugin
  • Add a custom context that also casts the type of bot

Embed reply for PEP detection

  • Add an option to allow the default link embed in the /pep command
  • During detection for a message with pep in it, instead of sending links, send one embed listing all PEPs that were mentioned and their respective links.

nah, but I was thinking about making the entire reply an embed so you can have hyperlinks when multiple PEPs are mentioned maybe

Originally posted by @trag1c in #39 (comment)

Retroactively add Donor role to every user that has the Patron role

Everyone with the Patron role should receive the Donor role, and the bot does somehow do that, but it seems like the bot needs to be online when the user gets the Patron role, so if the bot is offline and a user gets Patron, the user will not get Donor, like, ever.

My suggestion is for the bot to, on a programmed schedule (every day should be more than enough), look at everyone on Patron and make sure they're also on Donor.

/video command

Using fuzzy search, allow searching for mCoding videos by their title and/or description.

Add search query to /pep command

The /pep command can have two optional arguments:

  • number
  • query

You must specify exactly one option. Number just returns that pep, whereas query will use fuzzy searching to search the peps by their titles. This is also the easiest way to introduce fuzzy searching to the codebase.

Autopublish plugin

We should re-implement the autopublisher. Should listen for messages in #announcements. If they match a youtube video regex, it should automatically publish them.

RTM command

It would be cool to have a slash command for searching sphinx documentation. All sphinx docs generate an object.inv file, which can be downloaded, parsed, and cached.

For example, the python docs: https://docs.python.org/3/
The objects.inv file is: https://docs.python.org/3/objects.inv

I found some great documentation on how to parse this https://sphobjinv.readthedocs.io/en/latest/syntax.html. Once parsed, it can be cached, and then we can probably use some sort of fuzzy search. The cached version of documentation can be set to expire after 24 hours.

For the slash command, I was thinking something like this:

/rtm query: <query> [docs-url: <docs-url="https://docs.python.org/3/">]

The docs-url can have autocomplete (and we can list more common projects), but will let you specify any valid sphinx url. If the url hasn't been used yet, it'll download/parse/cache it first.

pep lookup using fuzzy search

  • /lookup-pep command

This command will take an option witch has a fuzzy search autocomplete to find a pep by name.

An issue with highlight relevance

An issue with highlight relevance

Glossary

  • notification: private message from the bot about the highlighted word.
  • TM: triggering message, i.e. that contains an highlighted word.

Synopsis

Let's say user A has cat in their highlighted words list.

If user B sends a message containing cat, user A will receive a notification about the TM.

However, if user B edits their message, it could happen not to contain the word anymore, making the notification irrelevant. This also means that the user A has access to the previous version of the message[1], which can have serious implications, that will be discussed further.

Concerns

If cat is a pretty innocent substantive, an edge case subsists where the user B sends a rule-breaking TM. The message would have been deleted, but the user A will still be exposed to its contents through the notification.

For instance, the current rules prohibit hate speech[2]. This means that one having a highlighted list is potentially exposing themselves to content they might did not want in the first place.

Proposal

TM tracking

TMs could be tracked for a given period of time -- if they get deleted, or edited, the bot can behave accordingly, removing the notification if needed.

One limitation of this proposal I can think of is that the ping of this notification is likely to stay (ghost ping).

An alternative could be that instead of deleting the notification, it would edit into saying something like: "This message has been edited/deleted".

To go further

While writing this, other ideas of features emerge in my mind. This is the part where I list them.

Word matching rather than character sequence

Currently, if one have java as a highlighted word, a message containing "javascript" is a TM.

It should preferably use pattern matching rather than a simple word in message[3].

Channel-dependent highlights

I think it would be a very nice feature if we could add/remove specific channels for a given highlight -- although, the highlight create command should by default set up the highlight for every channel.

Allow close-enough to trigger

User B could mistype a word, but user A would still want to get a notification for it.

This idea is kind of mutually exclusive with this one, because I am not sure how to mix pattern matching and levenshtein distance thresholding.

Inhibitors

Inhibitors would be words that prevent a message from being TM even if they contained a highlight.

For example, if you have rust as a highlight and javascript has an inhibitor:

  • "I like Rust" => TM
  • "I like Rust and JavaScript" => not TM
  • "I like JavaScript" => not TM

To go further, make inhibitors highlight-dependent -- one inhibitor would have an effect on a specific highlight but not on any other.

Highlight temporary deactivation

One could want not to get notifications for a word for a certain time frame.
This idea is at the very bottom because it might have a real-world purpose.

Notes

Note 1

That also implies that the user A would have access to contents that the user B deliberately decided to modify. Does this have legal implications? [โ†‘]

Note 2

Rule 9 links the Discord guidelines: https://discord.com/guidelines. [โ†‘]

Note 3

https://github.com/mcb-dev/mCodingBot/blob/main/mcodingbot/plugins/highlights.py#L201. [โ†‘]

Merge plugins and tasks

Tasks are just another kind of plugin. Since we already have some tasks inside the plugins folder, I think it would be best to put the stats "task" plugin under plugins.

cc @trag1c @Lunarmagpie

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.