Changelog¶
1.12.0¶
Before you upgrade¶
Nothing should break. Two things you might notice:
- Plugins that use
msg.bot,@registeror@opslog a deprecation warning saying what to use instead (msg.botonly once per bot). They all still work. Preparing for 2.0 has the details - Once a plugin uses
msg.store, adata/folder appears where the bot runs, or insidebot_dirif that's set
New¶
pinhook.testing: aTestBotthat runs your plugins without a server, so you can test them with pytestmsg.reply(text)andmsg.send(target, text)send straight away, so a plugin can reply more than once or to several places- Given just the text,
msg.action(text)replies where the message came from andmsg.notice(text)sends the sender a notice msg.account(the sender's services account) andmsg.is_privatebot_dirkeeps everything a bot uses in one folder, withplugins/,data/andlogs/inside it. Without it, files go where they did in 1.11msg.store, a dictionary each plugin can keep data in. It lasts through!reloadand restarts, and is saved todata_dirautomaticallydata_dir, where plugins keep their saved dataplugin_configgives each plugin its own settings, asmsg.config, plus asharedsection every plugin can read!reloadalso readsplugin_configfrom the config file again, so settings can change without a restart- SASL logins with
sasl_password(andsasl_accountif it's not the nickname). The bot is logged in before it joins channels, and gets its own nick on networks that reserve registered nicks ${NAME}in a config file is filled in from the environment, so passwords don't have to be in the file- Docstrings for everything plugins and bot scripts use, so editors can show help, and an API reference generated from them
- A Preparing for 2.0 guide to getting plugins ready for 2.0
Deprecated¶
msg.bot, which will be read only in 2.0. Usemsg.reply(),msg.send()andmsg.botnickinstead. It still works, and logs a warning once@registerand@opsnow raise aDeprecationWarningtoo, saying what to use instead. They'll be removed in 2.0
Fixed¶
- The example dice plugins used an invalid escape in their regex, which newer Pythons warn about
1.11.0¶
Before you upgrade¶
- SSL now checks the server's certificate. If your bot connects to a server with a self-signed certificate, it will stop connecting until you set
ssl_verify: false. The log says exactly this when it happens. - TwitchBot connects over SSL to
irc.chat.twitch.tvon port 6697, so your oauth token isn't sent in plain text anymore. - Bots mark themselves as bots on servers that support it. Set
bot_mode: falseto turn this off. !banbans accounts and hosts, not just nicks. If the person has spoken since the bot started,!ban trollbans their account if they're logged in, or their user and host if not. Bans are now saved to<nickname>.bans.jsonin the bot's working directory, setban_file: ""to keep them in memory only.!banlistis ops only, since bans can now include hostmasks.- Log lines show which bot they came from (e.g.
bot.pinbot), which adds a field to the log format. Each bot now has its own logger, log level and log file. log_level: offturns logging off completely. It used to still log warnings and errors.- Plugins are loaded as
pinhook_plugins.<filename>. This only matters if one plugin imported another by its filename. - If you subclass Bot:
call_pluginsandcall_internal_commandstake new arguments (botnickandop). - Python 3.8 or newer is required.
New¶
ssl_verifyoption for servers with self-signed certificatesbot_modeoption, sets the bot user mode the server advertisesopsandbanned_userscan use hostmasks (*!*@203.0.113.7) and services accounts ($a:troll) as well as nicksban_fileoption, bans made with!banlast through restartsrequire_accountoption, only answers people logged in to a services accountmsg.is_opfor plugins, which understands accounts and hostmasks- If the bot's nick is taken when it connects, it tries
nick_,nick__and so on, instead of hanging - When connecting fails the log says why (bad certificate, wrong port, server name typo, connection refused) instead of retrying silently
- Unknown options are logged with a suggestion, e.g.
unknown option 'ssl_requred' ignored, did you mean 'ssl_required'? - TOML config files work without extra packages on Python 3.11+
- Mistakes in a config file are listed plainly, instead of as a python traceback
- A documentation site, at https://archangelic.github.io/pinhook/
- Tests, and a workflow running them on Python 3.8 to 3.14 (closes #10)
- Publishing to PyPI uses trusted publishing
Fixed¶
- SSL crashed on Python 3.12+
hide=Trueon commands did nothing!bandidn't actually stop banned users, and bans and ops were case sensitive- The bot didn't ignore messages from its own nick (#75)
- Private messages crashed the bot after its nick changed
- A plugin returning something other than
message()oraction()crashed the bot - Newlines inside a list of output lines crashed the bot
- A plugin named like another module (e.g.
json.py) replaced that module log_levelcrashed on capital letters orwarn!reloadleft deleted plugins behind- Log lines were written more than once when more than one Bot was created
!disablesaid nothing for plugins that don't exist!opand!banwith no nick added an empty name!quitcrashed when Python'ssitemodule isn't loaded- The toml install hint crashed instead of showing
- Removed the
enum34dependency, which could break Python's ownenum