Raku / whateverable

🤖 Different IRC bots that operate on a bunch of prebuilt Rakudo versions
https://gist.github.com/Whateverable
GNU Affero General Public License v3.0
18 stars 14 forks source link

Support messages from the discord bridge #357

Closed taboege closed 5 years ago

taboege commented 5 years ago

The new Discordable role is mixed into Whateverable and hence all bots. It allows to handle messages from the discord bridge transparently by stripping the discord username prefix from the message and reinserting the message into the event processor as if it came from IRC.

Testable also got support for impersonating the discord bridge.

taboege commented 5 years ago

Here's a new version. The what: issue is fixed, the way Testable impersonates discord6 has been redone as per IRC feedback. All tests are now by default executed twice: once normally and once from the faked discord bridge. Tests with side effects (like notable's) must be explicitly prevented from running twice. The following tests now pass (which are all currently non-bitrotten ones):

Note that only the very last test in unicodable.t has :!both not because it has side effects but because the test fails with

ok 175 - good MIME type                                                                                   
not ok 176 - good MIME type (bridged)                                                                     
# Failed test 'good MIME type (bridged)'                                                                  
# at /home/tab/src/perl6/taboege-whateverable/xt/lib/Testable.pm6 (Testable) line 114                     
# expected: ["testable139689, Successfully fetched the code from the provided URL"]                       
#  matcher: 'infix:<~~>'                                                                                  
#      got: ["testable139689, U+0075 LATIN SMALL LETTER U [Ll] (u)"]                                      
# Test failed. Stopping test suite, because PERL6_TEST_DIE_ON_FAIL environmental variable is set to a true value.
# Bot process finished (exit code=0, signal=1)

That LATIN SMALL LETTER U is most likely the beginning of the query sent u: …. Why that survives remains to be understood. Normally IRC::Client should remove that inside handle-event.

AlexDaniel commented 5 years ago

This is amazing! Thank you!