woodruffw / yossarian-bot Goto Github PK
View Code? Open in Web Editor NEWAn IRC bot with a bunch of features.
License: Other
An IRC bot with a bunch of features.
License: Other
Plugins are currently documented in COMMANDS.md, and the bot's core isn't really documented at all.
Ideas:
Current, Ping
just acknowledges the user with a UNIX timestamp. This isn't at all accurate, and doesn't give the user a good idea of their latency.
Ideas:
User should send a ISO 8601 stamp via !ping <stamp>
, which is then subtracted from the current time. The stamp should either be in UTC or include a timezone offset.
Example of the bug in action:
11:25:58 < Oooooo> !yt Bug 2: The Buggining
11:26:21 < Oooooo> !yt Bug 3 - Bugging You Again
11:26:22 < yossarian-bot> Oooooo: Bugging you [thestringstheory] - https://youtu.be/UBMNP6x3PA4
Currently, CustomTriggers
can only add triggers composed of runs of non-space characters.
It should be able to support (limited) regular expressions and triggers containing spaces.
Ideas:
!trigger add 'this is a trigger with spaces' 'this is the response'
!trigger add this is a trigger with spaces -> this is the response
!trigger add /match this/ this is a matched response
Various yossarian-bot
plugins access the evironment for API keys.
It would be good to load such keys from a central location, rather than expecting them to be preloaded into the environment. For example, something like this in config.yml
:
environment:
FOO_API: value
The environment
hash could then be loaded in yossarian-bot.rb
.
Currently, yossarian-bot
is updated by fetching changes to the git repository and running ./bot-control.rb restart
. Ideally, this could be automated from within the bot and issued from within IRC itself.
Idea:
!admin update
, which diffs the fetch before merging it to see which plugins need to be restarted. This won't work for the core, which will need to restart entirely in the event of changes.
Already an approved idea, but yos-bot would probably benefit from having a regex-based banlist from which it checks every new user in a channel for autokick functionality.
Proposed syntax:
!moderator <akick> <add | rm> <literal | /regex/>
where angle brackets indicate required operands and | means "or".
Configuration file (banlist.yml) should look like so (example channel is #and-the-rest):
---
'#and-the-rest:'
- greenbagels # matches literal nick
- /\w+bagels.+/ # matches regex string against entire hostmask
Obviously, there is some leeway for how to implement the regex matching itself... a general regex to handle all cases would probably be more elegant than actually requiring regex delimiters, since literals just require you to ignore metacharacters and character classes...
The general goal is to keep consistent syntax with the rest of the bot while avoiding too much overhead, lest we fall into inconsistency like so many projects before us (e.g. git).
'remind' doesn't handle the error case of the first argument not being an integer. Ideally, the error(s) should include the full syntax of the command.
HAL
does not store its "brain" across reboots. This should be done to maximize learning. Additionally, it should learn on a per-channel basis.
As of 90fe0e4, the old (Wunderground-based) Weather
plugin has been disabled -- Wunderground appears to have broken much of the search functionality in their API.
Open to suggestions and PRs for a new Weather
plugin.
I can't figure out how to login as administrator. I see how to set nicks ... but surely there must be a password?
Something about encode_www_form
missing from Addressable::URI
.
yossarian-bot
currently leverages cinch-identify
for authentication and ignores cinch's built-in SASL support. Since SASL is always performed pre-join, it's preferable when available and should be enabled in the bot.
Idea:
Test server_info['auth']['type']
for 'sasl'
, then branch and fill in conf.sasl.username
/password
instead of the normal Cinch::Plugins::Identify
configuration.
The GoogleTranslate
plugin is no longer functional, following Google's removal of an unofficial API.
Alternatives:
The readme states that this code is MIT-licensed: "licensed under the MIT License." but the license has additional restrictions that means this is not longer the MIT proper and not an open source nor a free software license. It would be nice to clarify to avoid confusion, uncertainty and doubts. NB: this also applies to several other repositories.= of yours
all plugins that use open-uri and just call open()
give me wrong number of arguments (given 2, expected 1)
. when changed to be called like URI.open()
, they work fine. So far the plugins I've seen that do this are crypto and beedogs.
I dont recall this being an issue the last time I touched yossarian-bot, especially because beedogs does it in its init so I wouldve probably noticed it not starting
version info (cant remember what I had last time as I always uninstall it when I'm done with it):
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
Bundler version 2.1.4
what I think are gem versions from 'gem list':
activesupport (5.2.3)
benchmark (default: 0.1.0)
bigdecimal (default: 2.0.0)
bundler (2.1.4)
cgi (default: 0.1.0)
concurrent-ruby (1.1.5)
connection_pool (2.2.2)
covid19_data_ruby (0.0.1)
crass (1.0.4)
csv (default: 3.1.2)
daemons (1.3.1)
date (default: 3.0.0)
dbm (default: 1.1.0)
delegate (default: 0.1.0)
did_you_mean (default: 1.4.0)
domain_name (0.5.20190701)
duck-duck-go (1.1.3)
etc (default: 1.1.0)
faraday (0.15.4)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.4.1)
flippy (0.1.3)
forwardable (default: 1.3.1)
gdbm (default: 2.1.0)
genregen (0.0.8)
getoptlong (default: 0.1.0)
goodreads (0.7.0)
google-search (1.0.3)
grinch (1.0.1)
grinch-identify (1.7.1)
hashie (2.1.2)
haste (0.2.3)
htmlentities (4.3.4)
http-cookie (1.0.3)
httparty (0.17.0)
httpclient (2.8.3)
i18n (1.6.0)
io-console (default: 0.5.3)
ipaddr (default: 1.2.2)
json (default: 2.3.0)
lastfm (1.27.3)
leetspeak (0.1.1)
logger (default: 1.4.2)
matrix (default: 0.2.0)
mechanize (2.7.6)
mime-types (3.3)
mime-types-data (3.2019.0904)
mini_portile2 (2.4.0)
minitest (5.11.3)
multi_xml (0.6.0)
multipart-post (2.0.0)
mutex_m (default: 0.1.0)
myanimelist (1.0.0)
net-http-digest_auth (1.4.1)
net-http-persistent (3.0.1)
net-pop (default: 0.1.0)
net-smtp (default: 0.1.0)
netrc (0.11.0)
nokogiri (1.10.9)
nokogumbo (2.0.1)
ntlm-http (0.1.1)
oauth (0.5.4)
observer (default: 0.1.0)
open3 (default: 0.1.0)
open_uri_redirections (0.2.1)
openssl (default: 2.1.2)
optimist (3.0.0)
ostruct (default: 0.2.0)
prime (default: 0.1.1)
pstore (default: 0.1.0)
psych (default: 3.1.0)
racc (default: 1.4.16)
readline (default: 0.0.2)
readline-ext (default: 0.1.0)
reline (default: 0.1.2)
research_topicgen (0.1.6)
rest-client (2.0.2)
rexml (default: 3.2.3)
rss (default: 0.2.8)
ruby-eval-in (0.0.7)
ruby-termios (1.0.2)
ruby-upworthy (1.0.0)
sanitize (5.1.0)
sdbm (default: 1.0.0)
singleton (default: 0.1.0)
stringio (default: 0.1.0)
strscan (default: 1.0.3)
telegraph (1.0.1)
thread_safe (0.3.6)
time_difference (0.7.0)
timeout (default: 0.1.0)
tracer (default: 0.1.0)
tzinfo (1.2.5)
unf (0.1.4)
unf_ext (0.0.7.6)
uri (default: 0.10.0)
webrick (default: 1.6.0)
webrobots (0.1.2)
wolfram (0.2.1)
xkcd (1.1.1)
xml-simple (1.1.5)
yaml (default: 0.1.0)
zlib (default: 1.1.0)
The bot should pass a RuboCop lint perfectly.
The style rules are here.
There is currently a bounty on bugs that cause yossarian-bot
to crash or busy loop (causing a denial of service). The first three reproducible bugs reported that meet these requirements will receive free Club-Mates.
Most yossarian-bot
plugins are very repetitive and repeat the same operations for slight variations of the same command.
This should be reduced via auxiliary methods in each plugin.
Might be overkill for such a small project (since "building" it is literally 99% dependency installation), but I'd figure travis builds would be marginally helpful and quick to verify that PR builds are working fine.
Perhaps a prerequisite would be some kind of unit tests? Doesn't make sense to just randomly run the bot as a test and kill it.
Copied directly from the old TODO.md:
use_opped
)It'd be nice to have a !ny
command that retrieves a random New Yorker cartoon.
Here's their random cartoon endpoint: https://www.newyorker.com/cartoons/random/randomAPI
Currently, yossarian-bot
can only enable and disable plugins on a instance-wide basis. This is inconvenient for when different channels have different needs.
Idea:
!admin plugin <enable|disable> <#channel|*>
The weather plugin now uses apixu for weather data, apparently they decided to move to weatherstack (https://github.com/apilayer/weatherstack#important-apixu-shutdown-on-october-14th-2019) this is fairly straight forward to rework as the response is nearly the same. So I'll just do this beginning of October.
I'd like to also take this chance to implement any format changes people might have, the data returned is as follows:
currently the format is:
"Current temperature in $name, $region, $country is $temp_c°C ($temp_f°F) and $weather_description.",
It'd be nice to have something like NowPlaying
, but for Goodreads:
<foo> !nr [USERNAME]
<yossarian-bot> foo: USERNAME is currently reading "Whatever" by "Whoever."
Relevant links:
https://www.goodreads.com/api/index#shelves.list
https://github.com/sosedoff/goodreads#shelves
Shouldn't be too hard to implement, since the goodreads
gem is already used by BookInfo
.
I'll do this in a bit, leaving it here as a note.
We originally had a !g
plugin that searched the web using Google's old REST API, but they've since removed that in favor of the Custom Search API.
!s
currently works, but uses some weird search engine that doesn't provide very good results.
Since Custom Search provides up to 100 free queries per day (source) and can be configured to provide default search results, we should just switch to that.
Edit: It looks like the trick with Custom Search is to create your search engine with only one schema: "Thing".
yossarian-bot
could be turned into a Gem with relative ease. This would make distribution even easier than the current git clone
and allow versioning to match that in version.yml
.
IRC isn't case sensitive for nicknames, but some plugins that use nicks probably are.
Looks like I broke it:
=nil>>: #‹Thread: 0x00007fee50d3530 /home/william/yossarian-bot/vendor/bundle/ruby/3.2.0/gems/grinch-1.1.0/lib/cinch/handler.rb:94 run>
1 in total.
[2023/07/19 12:12:27.265] !! /home/william/yossarian-bot/plugins/youtube_search.r:34:in 'youtube_search': undefined method 'encode' for URI: Module (NoMethodError)
[2023/07/19 12:12:27.2651
It/home/william/yossarian-bot/vendor/bundle/ruby/3.2.0/gems/grinch-1.1.0/lib/cinch/plugin.rb:414:in'call'
[2023/07/19 12:12:27.265]
It/home/william/yossarian-bot/vendor/bundle/ruby/3.2.0/gems/grinch-1.1.0/lib/cinch/plugin.rb:414:in 'block (2 levels) in _register_mat
chers'
[2023/07/19 12:12:27.265] !!
At/home/william/yossarian-bot/vendor/bundle/ruby/3.2.0/gems/grinch-1.1.0/lib/cinch/handler.rb:101:in'blockincall'
(ruby-eval-in)[https://rubygems.org/gems/ruby-eval-in] provides an interface to https://eval.in via a gem, so CodeEval
should use that instead of rolling its own system.
A command that uses the github API to submit an issue to this repo, allowing more direct feedback for potential bugfixes.
Title says it all.
bob: !np
should be equivalent to
bob: !np bob
When you're sent a message, yosbot tells you to reply using the normal message syntax. Perhaps have messaging set up such that sending a message to someone sets you as the previous sender in a field under their nick. Then, using a !reply command would send a message to the last person to mail you.
The LastSeen
plugin does not persist its records across reboots (all seen records are stored in a single hash). This should be changed so that users can look up seen times for people who have not been since since before a reboot.
Ideas:
Look at UserIntros
or any other persistent plugin for inspiration.
The Cleverbot
plugin is currently broken, following a change to cleverbot's interface. The plugin is backed by a gem that seems to be inactive/abandoned, so fixing this probably involves reverse engineering the new cleverbot interface.
Google Maps just got an API, maybe you could put that in and have some sort of Map command, like !map 32901 or !map 4053 Wilkes Drive Melbourne FL 32901 and then it would spit out a link to the address. It could also do Lat/Long coordinates
Also pizza command like taco but for pizza. i cant find a website that isnt from the major pizza makers. perhaps put it out to the community to see if they could find it
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.