ianmitchell / arx-7 Goto Github PK
View Code? Open in Web Editor NEWA dumb IRC bot
A dumb IRC bot
When the bot is kicked, it should autorejoin the channel. Additionally, it should handle a net split gracefully
So this happened. Dunno if you're able to tell what occurred but have an exception error:
belfiore@souma:~/ARX-7$ node app.js
/home/belfiore/ARX-7/node_modules/irc/lib/irc.js:748
throw err;
^
TypeError: Cannot read property 'includes' of undefined
at ARX7.message (/home/belfiore/ARX-7/src/arx7.js:84:29)
at Client. (/home/belfiore/ARX-7/src/bot.js:28:8)
at emitMany (events.js:108:13)
at Client.emit (events.js:182:7)
at Client. (/home/belfiore/ARX-7/node_modules/irc/lib/irc.js:517:22)
at emitOne (events.js:77:13)
at Client.emit (events.js:169:7)
at iterator (/home/belfiore/ARX-7/node_modules/irc/lib/irc.js:745:26)
at Array.forEach (native)
at Socket. (/home/belfiore/ARX-7/node_modules/irc/lib/irc.js:740:15)
When given .o
with spaces afterwards, ARX-7 will return "undefined"
When the bot starts, it's possible for the name field in config.json to not be a properly formatted channel. You can essentially have just "nisekoi" instead of "#nisekoi". Of course, the bot should also allow to be launched with double hashes for those odd channels on freenode like ##freebsd or something.
Ref: See issue martynsmith/node-irc#399
There is a lot of functionality that doesn't work for our usecase, and over time we've been reinventing the wheel for a lot of the higher APIs. It might be worth looking at alternative libraries to use. Hopefully, it'd also make it easier to test the arx7.js
file
[12:44:47] @torchlight .o 9007199254740992-9007199254740994
[12:44:55] * %Belfiore (~[email protected]) Quit (Read error: Connection reset by peer)
Aoi-chan accidentally put the Imgur plugin in for Commie, so Rhe got mad at me again. He suggested adding an IRC interface / recognized commands to modify the bot while it's running. Adding / Removing plugins shouldn't be too difficult.
This will mostly be so I can learn how to set this up - not super needed with a project like this
You can apparently run the bot without having the leading # in the channel name. It won't join the channel, of course, for the lack of the leading #. There either needs to be an alert for the lack of the leading # or the bot just needs to not run.
We should add a couple of tests for @Kyhz's .time
command
On the little bit of testing I did, it appears that the bot does not respond to commands based on the position of the channel in the config file. Everything below the second channel name entry won't respond to any of the listed commands. The bot will join the channels just fine, however. Example below:
"channels": [
{
"name": "#aoi-chan",
"key": null,
"plugins": [
"choose",
"reply",
"order",
"twitter",
"youtube",
"time"
]
},
{
"name": "#commie-subs",
"key": null,
"plugins": [
"choose",
"reply",
"imgur",
"order",
"twitter",
"youtube"
]
},
{
"name": "#fffpeeps",
"key": null,
"plugins": [
"choose",
"reply",
"imgur",
"order",
"twitter",
"youtube"
]
},
{
"name": "#horriblesubs",
"key": null,
"plugins": [
"choose",
"reply",
"imgur",
"order",
"twitter",
"youtube"
]
},
{
"name": "#gundam",
"key": null,
"plugins": [
"choose",
"reply",
"imgur",
"order",
"twitter",
"youtube"
]
}
],
URLs currently all show up as t.co. Replace them with the full URLs.
Vlvt requested Soundcloud support, similar to how YouTube works
For uptime and other reasons, it would be nice to be able to be able to connect the bot to a user on a bouncer. The general way this works is that you have a ZNC instance running on a server to keep the user online even if the user isn't actually connected in an IRC client. The general process for this is as follows:
/server whateverdomain.com:xxxx or /server whateverdomain.com:+xxxy (for SSL).
Once you've connected to the server you'll get the following:
*** You need to send your password. Configure your client to send a server password.
*** To connect now, you can use /quote PASS :, or /quote PASS /: to connect to a specific network.
At that point, you can provide what is requested. You would reply by sending the server the following:
/quote pass username:password
OR
/quote pass username/network:password
Once it has done that, it will join all the channels and be connected. I imagine this will be best as a config option of a ZNC yes/no option, a znc username option, a znc network option (i personally don't use ZNC in that fashion), and a znc password option. If there is no ZNC Network, then just put the znc username and password together to get username:password.
With the channel being a key, it makes it hard to account for non-lowercase values. It might be worth looking into different ways of representing channels/plugins to offload some of the checks performed on each message. If not, we should still refactor some of the code out of the message loop and precompute it if possible
Aoi-Chan has requested a Nico Video plugin
We'll need to tie into a Showtimes API, which will be defined elsewhere. This will be similar to Servrhe's functionality
Essentially have the ability to set a usermode on the bot on connection to a server, after it identifies to nickserv and joins channels. For example, being able to set +G or +g on it, if you so desired.
Aoi has requested we add support for channel keys
Blacklisted word checks are pretty rudimentary right now; the system should redesigned to be more flexible.
Right now, we use promises in some places (API calls), but probably should be making more liberal usage of them. It makes sense to make the plugins async in nature, and (I hope) will make it easier to test with Mocha. Changes will happen in #18
Currently we're using a babel require hook, which has negative performance impacts. This isn't super important, but it'd be nice to have a build/run NPM script that would compile ARX-7 into a single, es5 file.
We should have some unit tests to prevent regressions
[10:43:40] <&RHExcelion> .c xD
[10:43:40] <%Belfiore> RHExcelion: xD
[10:43:40] * Athena sets mode: +b *!*@bots.on.bots
[10:43:40] * Belfiore was kicked by Athena (Watch your language!)
Not sure if this is something I introduced or an oversight @kunaldes?
Get to work Lae <3
It seems that characters like <, >, &, and so on will display as their respective entity names (or whatever they're called), >, <, &. Ideally it would just display the characters instead of taking up the space.
For example, the tweet https://twitter.com/StockTwits/status/612616851269488640 displays as the following:
[Twitter]: 15 patterns in technical analysis and how they look. Print this out and hang it -> http://t.co/scZXLVMbdL $SPY http://t.co/VE30iFWL6n | By StockTwits (@stocktwits)
theres the one with the candles
It would be nice to be able to ignore specific people like chronic spammers, people who flood the channel, and nbk. :)
It would be nice to have a feature added so the user can specify how many lines can be flooded to the server per second before it gets excess flooded out. Apparently Rizon has a limit at 1 line/500ms global limit, but I'm not sure if thats a network limit or a server limit, so being able to set the ratelimiting globally would be nice so it can impact all bot responses.
Ideally, SSL Support should be added to the bot. Most decent IRC servers support SSL connections, typically on port 6697 or 9999, however some use different ports. Ideally you could just add something to config.json for a "ssl": "true/false". Either that or make it detect on the server line in config.json whether there is a colon and a port, for example irc.rizon.net:6667 (non-ssl) or irc.rizon.net:+6697 (ssl). It may be better to just have them both separate.
Let's port the bot to Twitter, because ๐
Request to add a feature that will keep the bot from responding to certain commands per channel if another nick is present. For example, if the bot were in #Horriblesubs, both Belfiore and another bot would respond to .choose. As well, if a YouTube link were pasted, Belfiore and Internets would respond as well. If it were possible to check for Internets or Yotsugi for the YouTube and Choose scripts respectively, it would stop double pasting as well as act as a failover if one of the other bots were to disappear.
Due to self-signing issues with IRC servers and ZNC bouncers, it is often necessary to permit invalid SSL certificates or Unsigned certificates. Hexchat, for example, has an option in the server list to accept invalid SSL certificates. For security reasons it should be a setting, but the need for the feature is there.
"xd" only bans on full words and other bad words are not present in the list (like t.ly)
As discovered by @kunaldes, Channels in the config file are case sensitive; if they aren't lowercase, the bot will crash.
RHE has requested some basic conversion support. Perhaps something like this: http://mathjs.org/
You can make ARX-7 return a blacklisted word. If you search for .yt Disney
, it might output "Disney XD" - if XD is a blacklisted word, it should be filtered to something else ([redacted]?)
We have several pending tests that need to be implemented
We'll need to add commands to allow Staff to modify a Showtimes database. This will be similar to Servrhe's functionality
We should try to move away from passwords and support whitelisted identified names for admin commands. node-irc
doesn't support this; we'll have to figure out a way to do this ourselves.
Request from Aoi (instead of nodebot, something custom)
RHExcelion2 has requested Wolframalpha API integration
It'd be fun to have an option where the bot could auto-update itself. Not sure how entirely feasible it is, but it's worth looking into!
When given a malformed id such as youtube.com/watch?v=8WZr6fโฆ
, the following line causes a crash (snippet of undefined):
title: data['items'][0]['snippet']['title'],
When given the command .c , ,
with any number of commas, ARX-7 will respond with "undefined"
Due to >Rizon, have the bot not autorejoin a channel, or just stay gone when it has been kicked. Otherwise, the bot will be killed and can be glined and can cause everything connected from that IP to be knocked off of the network.
As reported here: 25922c6#commitcomment-12848617
twitter-node-client has a few console.log
statements in it that screw up logging and testing - we should look into replacing it.
It seems that the bot isn't identifying to nickserv and then joining the channels defined in the config. It's either joining too quickly and exposing the host or it's joining the channels first and then identify to nickserv. Currently, this is what occurs:
The host reflected should be "bots.on.bots".
Similar to the bug report requesting SSL support, being able to define ports should be permitted as well. Just like the SSL option, either have a "port": "6667" option or adjust the server line to detect colons and know that "irc.rizon.net:6667" means to connect on port 6667.
When searching for rather specific entries, such as ๆฐๅนดๆใใใใosuใจใใกใใ
the search errors out with "null"
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.