GithubHelp home page GithubHelp logo

haikubot's People

Contributors

bumblepie avatar

Stargazers

 avatar

Forkers

sarencurrie

haikubot's Issues

Haiku Culling

Once #57 is complete, add a command to cull haiku which no longer conform to the new syllable counting

Better error handling

Ensure the use of graphql best practices when handling errors in requests to the api. This is also an opportunity to reflect on other graphql best practices and ensure they are being followed, and proper http responses.

Haiku debug mode

Add a command that will return the number of sylables in a certain line for testing/debugging purposes.

Timestamp is incorrect in embed

Currently the timestamp in the embed is the current time, not the time that the haiku was created. The data is currently being saved to the database, it's just not part of the graphQL type, so it should be fairly simple to update.

Overall project readme

Add a readme file for the overall project.
Should have:

  • overall goal of project, what subprojects do
  • instructions on what tech is needed (ie node, any dbs etc)
  • instructions on how to run whole thing

Search command

Allow users to search for haikus based on various criteria

For example:

  • Keyword search
  • Creation date
  • Author

Center-alignment for haiku text

This would be really nice for making the haiku look artistic:

Example:

     breakfast burrito
big ol' breakfast burrito
    in my tummy tum

                - R. Authorson

Split messages by newlines, punctuation

Currently, a message such as "Blah blah. Blah blah? Blah." will be considered a single message with 5 syllables. I think it would be better to split up sentences and multi-line messages (ie newline characters acting as fullstops) for better recognition of haikus. Once complete, a single message consisting of three sentences with the right number of syllables would be considered a haiku, and messages consisting of multiple sentences per haiku-line would not be considered haikus.

Force the prefix to be a mention of the bot

Prefixes such as "!" or "?" are kinda messy - there's the potential for overlap with other bots and it's unintuitive when a new user joins a server - use mentions as the prefix for consistency and simplicity.

Find random haiku command

To allow users to browse haikus at random, a new command which fetches a random haiku from the server they are in would be useful

Convert mentions to display names for the purposes of counting syllables

Mentions currently look like this: <@1243141> to the bot, but like this @username to the users. This creates a disconnect when a haiku containing a mention is made and the mention counts as zero syllables. Additionally, we want to just save the in time display names (within the haiku lines) if we do this, as nicknames change over time, so things might make less sense and the syllable count might be off. It also means people don't get mentioned if they're mentioned in a haiku and it gets looked up.

Better commands

  • Make prefix 'haikubot' by default
  • Allow changing of prefix via [oldprefix] changeprefix [newprefix] cmd
  • Make commands case insensitive

Add message processing logic

Add logic for processing sequences of messages (corresponding to a channel in discord) to the discord client project. It should be able to process multiple channels at the same time (ie if messages are sent to different channels, it should be able to track both of them, it doesn't have to be performant yet).

Get Haiku by Id in discord client

The discord client should be able to respond to a trigger such as !haiku {id} and respond with the correspinding haiku, or an appropriate message if the haiku cannot be found.

SQL injection vulnerabilities

Currently the SQL queries for the SQlite and MySQL backed repositories are created via formatting strings, which leads to SQL injection vulnerabilities. As much as I would like to see a DROP TABLES haiku, changing these to prepared statements would make the system safer.

Integrate with discord bot api

Integrate the discord bot with the api - it should:

  • process messages in channels the bot is in
  • correctly respond when a haiku is detected

Actual persistence of data

Currently the api "cheats" - it simply stores the haikus in memory. Look at something like Amazon Dynamo DB (with a view to move towards serverless infrastructure) to properly persist data.

Add server id to haiku fields

You should only be able to reference a haiku from within the same server it was recognised for safety, thus ids should only be unique per server. Each haiku needs the server id as well as its existing fields.

Infinite haikus

The bot currently recognises its own messages as haikus, causing it to enter an infinite loop where it will keep recognising its own haikus over and over.

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.