Skip to content

Releases: zorael/kameloso

v3.14.159

27 Jan 20:41
e24619a
Compare
Choose a tag to compare

The pi release.

The library used to make secure HTTPS queries was changed from arsd-official:http to requests. Regrettably, the latter does not have the ability to fetch cryptographic certificates from the Windows registry, so Windows users now require a certificate bundle file for some plugins to function well (or at all). One can be downloaded with the --get-cacert command-line flag. (This flag has been in place for ages, but now it's relevant again.)

For a one-time Windows setup, call the program with --get-openssl --get-cacert.

This release also merges the self-test suite, which previously lived in a separate branch. Compiling the selftest dub configuration now adds a method selftest to the IRCPlugin class, which proxies calls to plugin modules' top-level .selftest, where available. The point is to have plugins test themselves, by sending messages to a second bot and verifying the responses. A selftest command to start the process was added to the Admin plugin.

  • Improved the --setup-twitch experience
  • (Windows) --get-openssl now downloads OpenSSL 3.2 instead of OpenSSL 1.1
  • Fixed Twitch 7tv custom emotes failing to import due to API endpoint changes
  • Added import of global FrankerFaceZ emotes
  • Custom emote imports are now staggered so as to hopefully not trigger rate-limiting measures
  • Largely rewrote the Webtitle plugin to work more like the Twitch plugin with regards to threading HTTP queries
  • Added support for specifying a time precision to use when reporting quotes
  • Rewrote the Bash plugin to use the bashforever.com clone site, instead of the seemingly dead bash.org original
  • Refactored some disable this(this) structs into classes
  • Raised Twitch-related API retry delay to 4 seconds, up from 1. Additionally, some queries now retry endlessly instead of giving up after 10 failures.
  • Twitch custom emotes are now highlighted in messages replied to. Normal emotes are not, for technical reasons.
  • Added the ability to explicitly include and/or exclude entire event types from being printed to the terminal, by use of comma-separated type names passed with --set printer.{include,exclude}=.... Gated behind debug (and/or version Debug).
  • Added Twitch command !subs; reports how many subscribers the current channel has
  • Fixed Twitch !vanish and !nuke not working due to the removal of the .timeout and .delete chat commands -- API calls must now be made instead
  • Fixed the ability to send Twitch whispers, similarly broken by the removal of the .w chat command
  • The Twitch plugin now uses a configurable number of concurrent worker threads, default 3
  • The Webtitle plugin now uses a configurable number of concurrent worker threads, default 3
  • What channels the bot is currently in now carries across reconnects
  • Disconnecting no longer suspends polls' durations; they now end at the end time, regardless of how much of the duration was spent offline
  • Fixed blacklisted users being incorrectly filtered despite a Permissions of .ignore
  • Channel-rejoining behaviour on reconnects/reexecs is now configurable as connect.rejoinBehaviour
  • Added ability to modify already existing timers by use of !timer modify
  • Added ability to modify already existing oneliners by use of !oneliner modify
  • Added ability to make aliases of oneliners by use of !oneliner alias, which creates a oneliner that transparently resolves to a different one
  • Updated dialect dependency to v2.2.0
  • Updated lu dependency to v2.2.0
  • Updated requests dependency to v2.1.3
  • ...

v3.13.0

26 Sep 18:18
449d684
Compare
Choose a tag to compare

This release is small but critically fixes non-Twitch builds not connecting properly.

Additionally changed the --monochrome command-line flag to --color=(auto|always|never) to comply with what seems to be the standard convention. This also renames the configuration file core.monochrome entry to .colours (and inverts it).

v3.12.1

06 Sep 23:12
a1f33ef
Compare
Choose a tag to compare

This is primarily an emergency hotfix for non-super Twitch key generation not saving the key to the configuration file.

Additionally changed the API endpoint used for Twitch channel follower queries. The hitherto-used helix/users/follows was deprecated in February 2023 and is scheduled to be shut down on September 12th. The new endpoint requires additional OAuth scopes, so a new key will have to be generated for the !followage command to work.

  • Refactored the Webtitle plugin slightly
  • Now generally uses .assumeUnique instead of .idup wherever applicable
  • Fixed the CircleCI build script always failing to fetch the compiler due bash set -u

v3.12.0

25 Aug 17:06
98deb26
Compare
Choose a tag to compare

This release includes a rewritten Pipeline plugin that does non-blocking reads. To the user it should behave exactly as before, but it now no longer uses a separate thread that sits blocking on reading from the pipe. It was both simple and needlessly complicated but as a quick hack it sort of worked, except when it didn't. As before, this plugin remains Posix-only.

Enabled the -dip1000 compilation flag for scoped pointers. This regrettably bumps the minimum dmd version from 2.085 to 2.086 (and ldc from 1.14 to 1.16) to resolve linker errors. At the time of writing (August 2023) we're at 2.105, so 2.086 from May 2019 is still decidedly ancient.

Disabled the -dip25 compilation flag for sealed references. Contemporary compilers enable it by default now, and explicitly including it just generates "-dip25 no longer has any effect" noise when compiling.

  • Refactored plugin initialisation in such a way that allows Twitch keygens to perform their captive routines without first connecting to a server
  • Improved Google and Spotify keygens to the point of usability
  • Made throttling/scheduling of outgoing messages more precise
  • Bumped minimum dialect dependency version to v2.0.4
  • Bumped lu dependency version to v2.0.0
  • ldc versions older than 1.25 fail to link in release mode and seem to have been for some time, but what do

v3.11.1

21 Jul 12:47
v3.11.1
e324534
Compare
Choose a tag to compare

This is a quick fix for configuration entries for the Webtitle plugin breaking in v3.11.0.

Also added tentative support for zero-length prefixes (a prefix of ""). With this set, the bot should only resspond to nickname: command-type invocations.

  • Lowered Fiber stack size back down to 32k in hopes of lowering runtime memory usage under torture-test conditions
  • Removed sedreplace.history and replaced use of a dynamic array for message history with a static one hardcoded to a size of 8, for the same runtime memory reasons

v3.11.0

18 Jul 21:10
v3.11.0
d0e777d
Compare
Choose a tag to compare

This release further lowers memory required for compilation, mostly by moving some static code out of templates into non-templated free functions.

For the sake of consistency, plural plugin names have been string-replaced into their singular form. The Oneliners plugin is now the Oneliner plugin, Notes/Note, Quotes/Quote, Webtitles/Webtitle and ChanQueries/ChanQuery. This should be completely behind-the-scenes and configuration files should not be broken by this change.

  • Stopwatches now persist across connections (and across executions of the program)
  • Miscellaneous cosmetic cleanup across the whole project

v3.10.0

28 Jun 20:58
v3.10.0
52e2b81
Compare
Choose a tag to compare

This release adds mapping of IRC colours 16 and above to terminal ANSI colouring, as recommended at https://modern.ircdocs.horse/formatting.html#colors-16-98. The old behaviour can be re-enabled by disabling core.extendedOutgoingColours.

Many functions responsible for various Twitch API operations were rewritten into delegates that get passed to a common function, which in turn retries them a hardcoded number of times or until they return without throwing. This deduplicated a lot of code and should prove more robust than previous solutions.

In places where a $random token could be supplied in user-defined strings (to be automatically replaced with a value between 0-100 exclusive), an additional syntax $random(i..n) is now also supported. This allows for a random number other than default one between 0-99 to be generated. The upper-bounds n is exclusive, and $random is thus equivalent to $random(0..100).

Added a core.reexecToReconnect setting that makes the program re-execute itself when it would otherwise have reconnected, such as upon connection lost or upon server request. This should help with minimising memory use that can otherwise steadily grow when torture-testing over longer timeframes, but is generally not necessary.

On Posix it uses the execvp function and the new instance neatly replaces the old one in-place. Windows lacks this feature, so on Windows we fake the behaviour by spawning a new process in a minimised console, and then exiting the program. For now, Powershell is hardcoded to be used as the shell console.

Note that settings changed while the program was running will not transfer to the new instance, unless they were first saved to the configuration file or other persistent resource files. It will simply relaunch itself with the arguments passed to the original instance. (This merely means that changes from any kameloso: set plugin.setting=value commands will not carry over.)

  • Added setting core.extendedColours, used to toggle use of terminal ANSI colours above the base 16
  • As mentioned above, added setting core.extendedOutgoingColours, used to toggle use of IRC colours above the base 16
  • Added setting connect.maxPingPeriodAllowed, hidden from the configuration file, used to customise how much time in seconds the program should allow between PINGs received before suspecting something is wrong
  • Restored Twitch !shoutout; it has its uses, despite /shoutout being a thing now
  • Made some effort to not write things out to the terminal if headless mode is enabled. Some still gets printed out, but only where it's invasive to fix.
  • Various refactoring and tweaks

v3.9.0

22 Feb 01:50
v3.9.0
d9d6af3
Compare
Choose a tag to compare

This release fixes all known instances of memory corruption and subsequent crashes that seemingly snuck their way in with some of the changes in the previous v3.8.0 release.

Along with an update to dialect v2.0.0, IRCEvent.aux is now a static array of strings, and IRCEvent.counts a static array of Nullable!longs. IRCEvent.count and IRCEvent.altcount were summarily removed. All current plugins have been updated accordingly, largely by merely string-replacing .aux with .aux[0], and .count with .counts[0].get. One exception is command event handlers, who can now access the command word in .aux[$-1].

Messaging functions were refactored to take a Property bitfield flag parameter, replacing up to four other std.typecons.Flag parameters. They are also no longer templates.

When determining whether or not an event handler of a given plugin should be called upon some incoming event type, the program used to iterate through the handler's array of annotated accepted event types and compare the elements one by one with the incoming event type, by use of std.algorithm.searching.canFind. If there was a match, the event handler would be called. This meant that there would be a lot of comparisons in the pathological case with many event handlers accepting many event types. In fact, one of the biggest hotspots revealed by profiling is (was) std.algorithm.searching.canFind.

if (eventHandlerUDA.acceptedEventTypes.canFind(event.type)) { /* ... */ }

Since the arrays of accepted types are known at compile-time, we now generate a bool[] array per plugin that we simply index with the value of the event type, since it's functionally an integer.

if (eventHandlerUDA.acceptedEventTypeMap[event.type]) { /* ... */ }

The array iteration becomes a single array index operation.

  • Plugins now need to import kameloso.plugins for mixin ModuleRegistration
  • bash.org is back up, so the plugin stays
  • The TwitchPlugin.useAPIFeatures setting was removed; API features are now permanently enabled and will more aggressively retry on failures
  • Now (seems to) compile with -dip1000, but isn't configured in dub.sdl to do so yet
  • Polls now support vote choices with spaces in them
  • Various fixes and improvements

v3.8.0

01 Feb 14:24
v3.8.0
bbbd1e4
Compare
Choose a tag to compare

This release saw some wins in lowering compilation memory required, which is now down from around 3100 Mb to 2000 Mb for a Twitch build (Linux, x86_64). Some gains were had by consolidating template instantiations and being smarter about module reflection, while others were from removing or versioning out some fringe functionality. Notably, some error messages will be less informative in non-dev builds. After these changes gdc also now seems more likely to successfully link.

The Counter plugin was refactored to use a Counter struct instead of a naked long for counts. This allows us to introduce custom format patterns, with which users can now set how counter queries/increments/decrements/assignments should be phrased. The command is !counter format.

Added support for third-party BetterTTV, FrankerFaceZ and 7tv Twitch emotes. This makes !ecount much more relevant. Channel-specific emotes are imported upon joining a channel, and global channel-independent ones on program startup, both irrespective of ecount setting. Only applies to home channels (unless version TwitchCustomEmotesEverywhere is set, which is left as a debugging feature).

At the time of writing http://bash.org has been down for several weeks. The Bash plugin remains enabled by default for now, but if the site doesn't return we might as well version the plugin out and eventually delete it outright.

Other notable changes:

  • Quotes were broken on Twitch and should now be fixed
  • dialect dependency version bumped to v1.5.0
  • The compatibility alias --set twitchbot.* (to --set twitch.*) was finally removed
  • Twitch USERSTATE should no longer spam warnings on all outgoing messages
  • The Time plugin was slightly refactored but should behave the same as before
  • Refactored many plugins' sending to server into nested functions
  • Added a messaging function reply that replies to Twitch channel messages, but so far it's not being used

v3.7.1

14 Jan 01:30
v3.7.1
94088af
Compare
Choose a tag to compare

This release includes a fix for Twitch background monitor Fibers ending upon receiving unexpected server responses. This could happen due to connection outages transient enough that the bot stays connected to the server, but long enough that server queries failed. With this the monitors now endlessly retry for as long as we stay in a channel. The plugin also no longer overlaps multiple monitor Fiber instances monitoring the same channel, which was a fringe edge-case that you would run into if you left a channel and rejoined it.

The Time plugin can now express the time in 12-hour AM/PM, if set to do so in the configuration file. The default remains 24-hour time.

Polls now survive disconnects and exits/restarts of the program. They do not survive unrecoverable crashes though, such as due to segmentation faults or being killed by signals. Naturally, votes placed when the bot isn't there to hear them aren't magically counted.