Code Monkey home page Code Monkey logo

p6-psbot's People

Contributors

kaiepi avatar

Watchers

 avatar

p6-psbot's Issues

PSBot::Database needs a rewrite

The current schema sucks ass. There should be a users table containing user IDs and a rooms table containing room IDs, and the rest of the tables should use their row IDs as foreign keys.

Unit tests should actually pass

The code's not completely screwed, there have just been some refactors that broke tests. They need to be updated accordingly

A persistent notification plugin is needed

Mail and the future friends list features both require being able to notify users when the bot first becomes aware that they're online. Rather than duplicating code when friends lists get implementation, a notification plugin should be added that would be used by both features.

Better user group support is needed

Some servers have custom groups, which are sent through the |customgroups| message currently. There are problems with using this that cannot be solved without changes to Pokémon Showdown itself though.

A friends list plugin is needed

Since PS isn't getting them any time soon, PSBot should have friends lists. Users who are friends with each other would be notified whenever either of them log in. Its API should look something like this:

  • $friend request <username>

Send a friend request to the given user. They will be notified of the request the next time they're online or when they do $friend requests

  • $friend requests

View your list of friend requests.

  • $friend accept <username>

Accept a friend request from the given user.

  • $friend decline <username>

Decline a friend request from the given user.

  • $friend remove <username>

Remove the given user from your friends list.

  • $friend list

View your list of friends.

Make rules more advanced

  • Some types of rules never use the includes/excludes attributes, so some more abstraction is needed
  • Chat rules should be able to include/exclude users on top of rooms
  • Rules should be possible to add dynamically through a command so they're not all hardcoded. This would be dependent on #12 and #13

A lot of code needs to be migrated to plugins

Anything dealing with making HTTP requests or the database needs to be moved to a plugin so more of PSBot's routines can be marked pure and so PSBot::Commands can have a lower line count

Implement mailbox

PSBot needs a $mail command to allow sending mail to users while they're offline.

Parsing, rules, and state management need a redesign

PSBot::Parser and PSBot::StateManager handle state that PSBot itself should be handling, since that's the part of PSBot that actually cares about it most. Moving it to PSBot would allow people to extend parsing and state management, but this should never be needed the way I plan on designing it.

PSBot::Parser should be a grammar. Its actions class would need access to PSBot itself, but this can be accomplished by binding self to a dynamic variable before parsing.

At the moment, rules are limited to certain types of protocol messages. They shouldn't be, as what rules really are are templates for grammars used when parsing.

PSBot needs a better way of sending responses to messages

Lately, I've been implementing stuff that needs to send replies to messages received, such as rules, games, and commands, by returning captures of arguments to pass to PSBot::Connection.send. This is too dependent on what its arguments look like and will be a huge pain in the ass to change if I ever change them again.

I'm thinking of using a PSBot::Response class containing a message and either a user ID or a room ID, along with a Reply subset of PSBot::Response or a List of PSBot::Response. This would never be directly used when writing rules, games, or commands; they'd implement a method that deals with creating the instance for you. The parser would handle the actual sending of the responses.

Implement settings command

The settings command should return a list of the commands and whether or not they're administrative, what rank they require, and whether or not they're enabled.

Make commands more advanced

  • There should be a PSBot::Command class with attributes containing metadata and a CALL-ME method to run it instead of using our method and keeping metadata in constants in PSBot::Commands
  • PSBot::CommandContext methods should be moved to PSBot::Command and the module removed
  • Boilerplate at the beginning of commands should be handled from CALL-ME so they can be removed from the commands themselves
  • Commands should allow an arbitrary amount of subcommands to exist
  • Command names should allow any unicode, not just what's allowed in variable names

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.