GithubHelp home page GithubHelp logo

luni3359 / koa-bot Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 1.4 MB

Discord bot

License: MIT License

Python 96.19% Shell 3.18% Batchfile 0.08% Dockerfile 0.55%
discord discord-bot discord-py python python3

koa-bot's People

Contributors

luni3359 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

koa-bot's Issues

Rework systems

Currently there's many instances of repeating code across the project, it'd be great if there was a system built for every of these to avoid repetition.

  • Make a cog for networking
  • Make a cog for handling OAuth2 (caching appropriate tokens accordingly)

More ideas to come later.

Searching on safebooru doesn't return safe results 100% of the time

The results may be status:safe, but they can include tags that aren't sfw. The post themselves aren't displayed on safebooru, and are marked with a warning that they're not safe.

There ought to be a way to search exclusively for posts meant to appear only in safebooru.

Rework configuration file

As per issue #30 I've come to realize the whole way the configuration file works is flawed. All of it is squashed within the bot variable. It's also not user-friendly.

Proposed changes:

  • Put domains in their own file, and commit it (whether or not it should include data like favicons is to be discussed)
  • Remove dependency on the bot variable to retrieve data from the configuration.
  • Put quotes into their own file
    • ...with multi-lingual support!

Fix behavior of the channel media-only warnings

The current warning system serves the purpose of keeping media-based text channels from getting flooded with conversations that should go in different text channels (which are not entirely disallowed, but are discouraged).

How it currently behaves:

  1. Counter keeps track of how many messages have been sent in any given text channel.
    • The counter resets when a message is sent in a different text channel.
    • Sending urls resets the counter.
  2. If the counter surpasses the defined maximum, a warning is issued.

Current issues:

  • Sending messages across multiple servers resets the counter, making the counter more useless the more channels the bot is in due to message frequency.
  • Media-based commands don't reset the counter.

Implement live reloading

Now that the project has been cogyfied it'll be extremely satisfying to have the cogs automatically reload on save.

Urls containing accidental valid units get converted

Links such as:
https://www.website.com/directory/%3Bword%27s%20sand%20n%27%20fiction/a%20dog%20in%20the%20cm.jpg

...get converted as if they had a unit in them.
Possible fixes? Scratch out the dedicated unit parser, write a parser that checks for more things other than just units.

Implement interactive board search

In other words, make it so that only 1 picture is shown, but the user(s) can switch between pictures, and it updates in real time.

Issues I know we'll have firsthand:

  • Uploaded pictures to embeds cannot be changed, nor you can upload a picture to an existing embed.

Implement a proper cache system

Right now files have no limit as to how much space they can take up, and how it's handled is all separate from each other. Some central class should be in charge of doing this.

Rework link detection

Right now it doesn't really work optimally, and it's kind of impossible to make multiple of the same domains get detected. I suggest:

  • Wildcard domain support
  • Capable to map multiple domains together to some extent
  • No longer require the domains to be inside the configuration file

Debugging doesn't stop live bot from acting

Previously if you ran the bot in debug mode alongside the live one, the live bot would ignore all requests. Now the live bot keeps working for all intents and purposes, aside from ignoring the on_message tasks, because that has an explicit check preventing it.

Add unit testing

I don't know how good this will be or whether or not we need this, but it'll be included, whatever it is.

Properly implement global check

As per issue #25:

  1. A lot of errors show up on the terminal each time the check doesn't pass, which is every time a command is used while the beta bot is running (it's annoying).
  2. Because it only applies to commands, the old check on the on_message event was unaffected. It would be a good idea to "modernize" it by using actual discord.py checks.

Embeds hidden with <> are still replied to

On the Twitter embeds there's an edge-case scenario, if you post two links (or more) that are valid galleries but one is blocked from embedding but the other isn't then both will be shown anyway.

Problems with two or more galleries

A couple issues to be noted:

  1. Both galleries are shown as fast as possible and it's not very API-friendly. Maybe there's a way to make things more efficient.
  2. Now the galleries are both showing out of order. Some action should occur, like removing the original post and replacing it with a special case message to show them in order.

Improve bash script

Currently the bash script works, but it just barely does so. It's also not intuitive and pretty much only I know how to use it. Here's a list of things pending to do on this:

  • Add documentation on the script usage.
  • Fix the hit-or-miss remote python dependencies updater.
  • Add "update" and "update locally" options.
    • The current implementation updates locally. It breaks when the user isn't in the same network. It should be capable to scan across the network and find the host by its host name.
    • The new update option simply pulls from the GitHub repository.

Users can access commands that should be inaccessible.

Cogs are a real mess right now. Not only do they not communicate to each other properly, but the gallery command shouldn't be allowed to be called manually unless it was done by itself.

We probably have to make some commands only work if the invoker is the bot itself but the question is... how?

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.