Giter VIP home page Giter VIP logo

euircbot's People

Contributors

brhoades avatar drusepth avatar euank avatar gmackie avatar hfukada avatar ichivack avatar iliana avatar jbury avatar linuxmercedes avatar sudonatalie avatar wangusaurus avatar

Stargazers

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

Watchers

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

euircbot's Issues

Update modules to use logger

#143 introduces a proper logger, rather than just using console.log everywhere. Modules need to be updated to use it.

This is a list of modules containing the string "console.log" that probably need to be converted to use a logger instead:

  • blerg
  • dota2
  • dumbCommandModule
  • github
  • google
  • join
  • newegg
  • nickserv
  • nicovideo
  • ping
  • qdb
  • que
  • quo
  • schedule
  • scrollback
  • title
  • tumblr-insult
  • twitter
  • vimeo
  • weather
  • wolf
  • wotd
  • youtube

quo bug with regexes

No clue what triggers it!

Doing a quote of nick /regex/ nick2 /regex2/ in some situation produces instead the most recent comment by nick rather than the most recent fulfilling that regex.

Still needs proper triaging

Module to handle github urls

Watch for github urls. For repos, give the one-line description. User profiles, give the name and self-description. commits, give the commit message. Etc.

Github Module: More info on push notification

Specifically, I think a git.io link + the commit message would be great. Example: from the official github irc service thing:

<git-notification> [ponscripter-fork] euank pushed 1 new commit to master: http://git.io/N-WAkA
<git-notification> ponscripter-fork/master f1c2ad5 Euank: Backport SDL2 fix from upstream...

You could likely compact it into one line or tweak it in other ways, but I think it's important to get most of the information there. Specifically, commit link, commit message, repository info, and committer.

bandcamp plugin

Linking an album or artist or whatever should show some metatadata. Not sure how able we are to actually pull this off, as I don't know if this is normalized across bandcamp pages.

Let modules formally register/request certain events

E.g., the onUrl module calls the url handlers of other modules directly. It would be neater if modules register with the modulehandler (and, through it, the MQ which doesn't exist yet). Any module (e.g. the youtube one) can then indicate it depends on that event to be registered and fail with a nice error message if it's not there. Might have to handle circular dependencies here if it's too complex.

Identify users. Optional auth

Users should be identified by their nickserv login probably. possibly optional auth to allow a user to login to the bot directly without any regard to nickserv.

The identify module should allow a way to look up a "canonical" id for a user.

Add MQ support

Probably rabbitmq. The idea would be that there is one central hub which takes events off irc and propagates them as messages. It's responsible for handling some initial parsing, but not too much. The current modules would then have a modulehandler which doesn't connect to irc, but rather listens to the MQ server. The benefit would be that other modulehandlers in other languages (anything supporting the MQ) could then be written.

spotify module

When I post spotify album or playlist URIs I want metadata.

Scrollback module can violate causality

<ek> 2010-2016
<^> -6

Scrollback module sees:

<^> -6
<ek> 2010-2016

This is obviously a violation of the space-time continuum and should be fixed quickly

Nickserv module is too async

It's possible for nickserv auth to not complete before the bot tries to join channels. I'm not sure why I didn't forsee this.

I guess that means that part of nickserv needs to come out of a module and into the main bot itself.

Module granularity for loglevel config

#143 gives each module its own named configurable logger, but there's no way to configure the level for a module's logger, just the global.

There should be such configuration.

OnMath scrollback ordering problem?

The following commands in IRC:

<`lm`> 5*90
<^> 450 
<`lm`> !quo 2,1

produce the following quote:

<^> 450 
<`lm`> 5*90

which is not as it ought to be.

--EDIT--
However, something similar:

<`lm`> !hb 
<^> HAPPY BIRTHDAY SHEPARD
<`lm`> !quo 2,1

produces output as expected:

<`lm`> !hb 
<^> HAPPY BIRTHDAY SHEPARD

---EDIT---

Perhaps there is an issue with how OnMath responses are placed into scrollback?

Add Reconnect

Currently if network connectivity is lost and the bot misses a ping it will disconnect and, from what I've seen, never reconnect. The bot still remains running and doesn't print any error messages.

Travis CI Module

Would be cool to get updates in IRC if a build is passing/failing

Weather forecasting broken

Weather forecasts seem to report both Lo and Hi as current temperature. I have checked three locations (dong, ann arbor, rolla mo) and all have the same behavior.

Datastore

Each module handler should provide an easy way for a module to sore data. It should make it easy to store key-value data or just plain blobs of raw data. The datastore itself should all exist in a canonical location which can be backed up easily. Each module gets its own area of course.

Log module

Other modules could have use for accessing scrollback (e.g. a search module or !seen command). A single module should keep track of who said what and when.

Add !topic command

Allow euircbot to prepend to the topic. Would obviously require -t on the channel or +h/+o on the bot.

scrollback module bug - racyness

You can end up in a race between viewing and adding an item to scrollback.

Ultimately, this can't be resolved correctly-for-all-cases IMO without adding a sequence number to all message/command events, and using that sequence number as a way to request scrollback prior to it.

An example of triggering this bug:

<ek> !quo "/this doesnt exist anywhere above/"
<bot> Cannot find line matching regex /this doesnt exist anywhere above/
<bot> https://twitter.com/xxxxxxx/xxxxx

The calls that are racing are scrollback.getFormattedScrollbackLinesFromRanges and scrollback.chansay. Racing isn't totally the correct word because it's actually deterministic (thanks event loops!) but it gets the point across well.
The first call to get scrollback works correctly, but issues a new message to the channel. This new message is added to scrollback prior to the second get scrollback call.

There might be other ways to fix this than sequence numbers (e.g. improving the way a command can hit multiple modules and gather output prior to acting in a way which hits scrollback), but I think a sequence number is the cleanest and best solution.

!quo?: Staged quo's

There ought to be a command that allows you to 'stage' a quote and later commit or reject it. This would allow people to check that their command is correct without having to adjust indices if the channel conversation keeps moving.

This would require a more centralized architecture for handling quotes. This would make it easier to implement additional quote databases and centralize filtering of noquo'd stuff.

(See #108 for slightly more discussion.)

Url shorten module

Should allow you to shorten a url (e.g. !shorten url google.com), show what a given short url leads to (!unshorten url bit.ly/dong ... just follows redirects).... For each of those, there should be a corresponding !shorten last 1 (maybe seen 1) that shortens the last url said.

Module scrollback: Bot hearing itself

The bot does not record what it says or react to it in any way right now.

This is generally what is wanted, but there are exceptions. The scrollback module is the big one.

In general, all events should have a counterpart event that includes self messages.

For example, "botcommand" or "onboturl" and so on. You absolutely should have to opt in to hear the bot speak as it's kinda assumed anything another module says is complete and it will explicitly call your module if it wants it.

i'm of course open to discussion, but I think avoiding breaking backwards compatibility (as discussed above it doesn't) should be easy here.

More convenient module configuration system

A config system should exist such that modules which require configuration can automatically be passed a config object at init-time.

Perhaps if a module wishes to use this system, it could include a file in its root directory, sirc-config.default.[extension] If this file exists, the bot automatically places [extension-name].config.[extension] into the conf dir, this file is an exact copy of the default given by the module.

The module then must provide a configuration parsing mechanism. Perhaps

module.exports.parseConfig = function(configString, configFileName, callback)

If no such method is provided, but a default config is presented, the module manager simply tries to parse it as JSON. If it fails, it ignores errors and proceeds as normal (perhaps passing an empty config into the module init function)

Improve reddit module to handle more than comments

Useful features:
Titles for short-links
Descriptions for subreddits
Karma amounts, shadowban status, etc, for user account links
Url that a regular link is linked to if link, first hunk of text if textpost I guess.

Group pings

Might looks something like:
!group create test
!group test describe A group for testing
!group test add bob, jim
!group test add will
!group test # => The group test is A group for test
!group test ping # => bob jim will: ping
!group test ping Hey guys, you should see this: http://url.tld # => bob jim will: Hey guys, you should see this: http://url.tld
!group test rm will

Other features might be nice to have, but the original intention is just to ping multiple people.

failure to build/run on a fresh system

/EuIrcBot/node_modules/irc/lib/irc.js:753
                        throw err;
                        ^

TypeError: Cannot read property 'trim' of undefined
    at Client.<anonymous> (/EuIrcBot/node_modules/irc/lib/irc.js:387:80)
    at emitOne (events.js:77:13)
    at Client.emit (events.js:169:7)
    at iterator (/EuIrcBot/node_modules/irc/lib/irc.js:750:26)
    at Array.forEach (native)
    at TLSSocket.<anonymous> (/EuIrcBot/node_modules/irc/lib/irc.js:745:15)
    at emitOne (events.js:77:13)
    at TLSSocket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at TLSSocket.Readable.push (_stream_readable.js:110:10)
    at TLSWrap.onread (net.js:523:20)

Construct a system for inter-bot-module dependencies

It was discussed that it would be neat if a module could expose an API to other modules.

For instance, say one module exposes link shortening capabilities to IRC users. It would be cool if it could expose a shortenLink() function to other modules, so they they could make their own messages more succinct.

Of course the bot would have to make sure that dependencies get resolved, and that modules are loaded in such a way that dependencies are available to eachother when needed. This is hard because currently moduleMan doesn't actually know when modules have finished loading. In addition, Dependency circles should probably be noticed.

Discussion of design and implementation of such a system should occur here.

Module hacker news: crash on dead link

Linking a "dead" comment crashes the bot.

SyntaxError: Unexpected token G
    at Object.parse (native)
    at Request._callback (/home/ircbot/EuIrcBot/modules/hn/node_modules/hacker-news-api/index.js:24:21)
    at Request.self.callback (/home/ircbot/EuIrcBot/modules/hn/node_modules/hacker-news-api/node_modules/request/request.js:121:22)
    at Request.EventEmitter.emit (events.js:98:17)
    at Request.<anonymous> (/home/ircbot/EuIrcBot/modules/hn/node_modules/hacker-news-api/node_modules/request/request.js:978:14)
    at Request.EventEmitter.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/home/ircbot/EuIrcBot/modules/hn/node_modules/hacker-news-api/node_modules/request/request.js:929:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:919:16
    at process._tickCallback (node.js:419:13)

Github module is broken for org repos

I am not sure if this is a problem with the github module itself or with node-github or with github's API, and I am not smart enough to figure it out.

Testing

Each module should be able to provide unit tests built in with it. The framework should hook in and call them, provide a mock for the bot + irc. The module can express expected inputs from irc and expected outputs. Framework can also make sure it doesn't crash on a few randomized inputs for its command

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.