Giter VIP home page Giter VIP logo

haikubot's Introduction

haikubot's People

Contributors

adrianojs avatar karl-run avatar sindrebilden avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

haikubot's Issues

Add "recognition game"

Scenario

  1. I write the following command: @haikubot guess author
  2. A random haiku from the DB gets posted to the channel. The author's name is not mentioned.
  3. haikubot asks the channel who we think the author is
  4. For an arbitrary length of time the channel members can direct message haikubot with their answers
  5. After this, haikubot will announce the results from the guessing game
  6. ???
  7. :-)

Group up several haikus into one network request

Currently, if you ask for the bot to show you 1+n haiku it will do 1+n network requests. Instead it should to something similar to whet it shows the top list, just have several attachments in one call. This should probably be limited to some max value.

Automatically reconnect when RTM websocket fails

When on a unstable connection the websocket will fail and produce a websocket._exceptions.WebSocketConnectionClosedException:, it should try and reconnect when this happens.

This does not affect Stash polling and posting new haikus, only commands.

Add pretty print option

Export to haikus.txt with the contents looking like this:

Haiku haiku hai
ku haiku haiku haiku
Haiku haiku hai

One Two Three Four Five
Six Seven Eight Nine Ten El
even Twelve Thirteen

...

Synchronize timestamp from slack with database

A lot of fun things can be created by a good integration with the reactions in slack.
Slack does not provide an id to messages i the event-api when given reactions but the timestamp ts of the message.

The posted haiku:

{'bot_id': 'XXXXXXXXX', 'suppress_notification': False, 'type': 'message', 'text': '', 'user': 'XXXXXXXXX', 'team': 'XXXXXXXXX', 'bot_profile': {'id': 'XXXXXXXXX', 'deleted': False, 'name': 'bot', 'updated': 1476284487, 'app_id': 'XXXXXXXXX', 'icons': {'image_36': 'https://url.com/image', 'image_48': 'https://url.com/image', 'image_72': 'https://url.com/image'}, 'team_id': 'XXXXXXXXX'}, 'attachments': [{'fallback': 'Haiku #3331 av Sindre Bilden', 'text': 'this is just a test\nthere is nothing to see here\nplease move along now', 'title': 'Haiku #3331', 'footer': '- Sindre Bilden', 'id': 1, 'color': '5d799e'}], 'source_team': 'XXXXXXXXX', 'user_team': 'XXXXXXXXX', 'channel': 'XXXXXXXXX', 'event_ts': '1594409951.033600', 'ts': '1594409951.033600'}

Reaction to the posted haiku:

{'type': 'reaction_added', 'user': 'XXXXXXXXX', 'item': {'type': 'message', 'channel': 'XXXXXXXXX', 'ts': '1594409951.033600'}, 'reaction': '+1:', 'item_user': 'XXXXXXXXX', 'event_ts': '1594410088.033800', 'ts': '1594410088.033800'}

The timestamp ts: '1594409951.033600' acts as an identifier in the channel.
If haikubot listens for its own post of haikus, the timestamp in the database can be updated to match the timestamp from slack, thus indirectly provide an id.

Output stash errors as a WARNING log ouput instead of DEBUG

If you're running the bot with log.INFO logging level you're probably still interested if Stash is down or not authenticating you.

Example:
bot_1 | 2017-02-14 08:02:04,450 root DEBUG: Parsing stash response: {'errors': [{'context': None, 'message': 'You are not permitted to access this resource', 'exceptionName': 'com.atlassian.bitbucket.AuthorisationException'}]}

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.