Releases: jeromeludmann/deno-irc
v0.8.1
Fixes
Mode Setting Formats
Some MODE message formats are not properly parsed.
Following variants are now supported:
MODE #channel +bme *!*@host someone!user@host
MODE #channel +b *!*@host -m +e someone!user@host
Coverage
Missing test cases have been added and coverage now reaches 100% for core
and plugins
parts.
To generate the coverage report:
make test-coverage
HTML report:
make test-coverage-html
v0.8.0
More Granular Raw Events
The client can now subscribe to more granular raw events.
For instance, instead of doing:
client.on("raw", (msg) => {
if (msg.command === "join") {
// ...
}
});
client.on("raw", (msg) => {
if (msg.command === "rpl_topic") {
// ...
}
});
it is now possible to just write:
client.on("raw:join", (msg) => {
// ...
});
client.on("raw:rpl_topic", (msg) => {
// ...
});
The previous raw
event name keeps the same behavior:
client.on("raw", (msg) => {
// all the raw events
});
But internally, it now translate into all the available raw events:
client.on([
"raw:admin", "raw:cap", "raw:connect", // ...
"raw:rpl_welcome", "raw:rpl_yourhost", "raw:rpl_created", // ...
"raw:err_unknownerror", "raw:err_nosuchnick", "raw:err_nosuchnick", // ...
], (msg) => {
// all the raw events
});
Multi Events Subscribing
Event emitter allow to listen more than one event.
Example from plugins/nicklist
:
client.on(["part", "kick", "quit", "kill"], (msg) => {
const { source, params } = msg; // msg is PartEvent | KickEvent | QuitEvent | KillEvent
const nick = "nick" in params ? params.nick : source?.name;
const channel = "channel" in params ? params.channel : undefined;
if (nick !== undefined) {
removeNick(nick, channel);
}
});
Allowing to listen to several events at a time can be handy in some specific cases.
Supported Server Feature Events
Events related to supported server features are now emitted:
isupport:chanmodes
andisupport:prefix
(used byplugins/chanmodes
to handle channel modes aspects)isupport:chantypes
(used byplugins/chantypes
to provide some helpers likeclient.utils.isChannel
)isupport:usermodes
They are mainly used to offer a way to be aware of the server features and allow client to update its own behavior.
Client Helpers
client.utils
contains some convenient methods based on supported server features.
Following have been added:
client.utils.isChannel
(previously imported fromcore/strings
)client.utils.isCtcp
(previously imported fromplugins/ctcp
)client.utils.createCtcp
(previously imported fromplugins/ctcp
)
v0.7.0
Fixes
Nicklist
Add missing NICK
support to track nick changes in plugins/nicklist
.
BREAKING CHANGES
Each message contains now source
and params
object.
-
source
object is optional and replaces the oldorigin
key. It containsname
key (containing the user nick or the server host). It may also contain an optionalmask
object, containinguser
name andhost
name (only if thesource
refers to a user). -
params
object contains all the existing previous message keys, except thesource
object.
Example with privmsg
event:
client.on("privmsg", (msg) => {
const { source, params } = msg;
if (!source) {
return;
}
if (source.name === "nick") {
client.privmsg(params.target, `Hello ${source.name}!`);
}
});
Internal
Plugin Dependencies
Plugins resolve their dependencies first before to load themselves.
It allows to prevent a plugin which depends on another plugins to be loaded before them. It also improves plugin internal API by providing plugin
factory from core/plugins.ts
.
Potential circular dependencies will be prevented thanks to type checking.
Testing
Plugin unit tests use the full featured client constructor in order to have a more representative context of testing.
v0.6.1
Fixes:
- fix case where
MODE
messages coming from server crashes the client
v0.6.0
Features:
plugins/nicklist
:'nicklist'
event to keep nicklists up to dateplugins/names
: used byplugins/nicklist
, withmulti-prefix
capabilityplugins/mode
: user and channel modes managementplugins/isupport
: supported features by the serverplugins/list
: a way to retrieve the entire channel list, see #5plugins/err_reply
: convenient way to handle allERR_
error replies
Internal:
- capability requesting management on connect in
plugins/registration
deleteProperty
trap added andbeforeMutate
is now recursive incore/hooks
- massive renaming to be more understandable
BREAKING CHANGES:
plugins/registration
: put user data intouser
stateplugins/myinfo
: put server data intoserver
state
v0.5.1
v0.5.0
v0.4.1
Internal features:
- add and expose
core/hooks
feature to plugin parts
Fixes:
plugins/join
: do not allow callingjoin()
without channelplugins/reconnect
: throw on connect without existing error listenerplugins/verbose
: stringify raw messagesplugins/oper_on_register
: restore missing test
Refactoring:
core/client
: preserve stack trace of thrown errorscore/events
: change visibility ofresetErrorThrowingBehavior()
andcount()
v0.4.0
Features:
- add
plugins/reconnect
- allow
join()
command to take channel keys - add
maxListeners
option to avoid infinite loops caused by too many listeners
Fixes:
- close link with server after using
quit()
and prevent error to be thrown
Refactoring:
- rewrite plugin internal management
v0.3.0
Error handling:
- rewrite error throwing behavior (BREAKING CHANGE)
- merge
and"error:client"
to"error:server"
"error"
Behavior changes:
- resolve
connect()
withDeno.Conn
when connected - remove listener on
"disconnected"
indisconnect()
- remove the
nick
key from"myinfo"
event payload - rename event
"raw:ctcp"
to"ctcp"
Improvements:
- improve
plugins/verbose
(previouslyplugins/debug
)
Internal:
- rewrite tests using new mocks (see
testing
folder)