wobscale / euircbot Goto Github PK
View Code? Open in Web Editor NEWA featureful nodejs irc bot
License: MIT License
A featureful nodejs irc bot
License: MIT License
#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:
https://github.com/PiPeep/prelude.mk/
Hypothesis is that the . is confusing things.
<$cbgbt> https://github.com/styleguide/ruby
< ^> Github response is dicked
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
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.
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.
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.
For example, !command !-1 would run it with the last line. Depends on logger service.
Support: !-#, !$, !nick !nick-# ...
e.g. !bible ephesians 6:12
It'd be nice to be able to spam people links and whatnot even if they're not in IRC.
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.
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.
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.
The first ~500 chars of a reddit comment url should be previewed in irc by the bot.
When I post spotify album or playlist URIs I want metadata.
<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
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.
#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.
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?
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.
Would be cool to get updates in IRC if a build is passing/failing
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.
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.
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.
https://twitter.com/christruncer/status/515485410026594305
I'll dick around with this but I need someplace to keep notes until I have time to mess with it.
It would be neat if linking a product gave title & price, and perhaps search similar to !g.
Allow euircbot to prepend to the topic. Would obviously require -t on the channel or +h/+o on the bot.
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.
Allow Euircbot to have a regisered nick like a real person.
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.)
Currently if you !quo someone who used /me, it does something like this:
https://twitter.com/QuoteDeskEng/status/597849593355767808
Ideally we could have it go * someone did this * instead.
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.
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.
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)
Github module gets confused when a link to a gist is posted.
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.
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.
/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)
A module that takes logs of the IRC channel, configurable to write them to a file or to publish them online somehow. Perhaps via S3.
^^
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.
Should be pretty easy to implement.
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)
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.
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
<foo> "foo bar baz" # comment
<bot> foo bar baz
This isn't desirable behaviour, especially when the comment is #noquo
๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.