Update doc strings for DefaultChannel

This commit is contained in:
Griatch 2022-03-27 18:04:40 +02:00
parent 73743e8b6c
commit 5af84817b5
2 changed files with 28 additions and 10 deletions

View file

@ -17,7 +17,7 @@ updated after May 2021 will be missing some translations.
+===============+======================+==============+ +===============+======================+==============+
| es | Spanish | Aug 2019 | | es | Spanish | Aug 2019 |
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+
| fr | French | Nov 2018 | | fr | French | Mar 2022 |
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+
| it | Italian | Feb 2015 | | it | Italian | Feb 2015 |
+---------------+----------------------+--------------+ +---------------+----------------------+--------------+

View file

@ -19,15 +19,33 @@ class DefaultChannel(ChannelDB, metaclass=TypeclassBase):
create different types of communication channels. create different types of communication channels.
Class-level variables: Class-level variables:
- `send_to_online_only` (bool, default True) - if set, will only try to - `send_to_online_only` (bool, default True) - if set, will only try to
send to subscribers that are actually active. This is a useful optimization. send to subscribers that are actually active. This is a useful optimization.
- `log_file` (str, default `"channel_{channelname}.log"`). This is the - `log_file` (str, default `"channel_{channelname}.log"`). This is the
log file to which the channel history will be saved. The `{channelname}` tag log file to which the channel history will be saved. The `{channelname}` tag
will be replaced by the key of the Channel. If an Attribute 'log_file' will be replaced by the key of the Channel. If an Attribute 'log_file'
is set, this will be used instead. If this is None and no Attribute is found, is set, this will be used instead. If this is None and no Attribute is found,
no history will be saved. no history will be saved.
- `channel_prefix_string` (str, default `"[{channelname} ]"`) - this is used - `channel_prefix_string` (str, default `"[{channelname} ]"`) - this is used
as a simple template to get the channel prefix with `.channel_prefix()`. as a simple template to get the channel prefix with `.channel_prefix()`. It is used
in front of every channel message; use `{channelmessage}` token to insert the
name of the current channel. Set to `None` if you want no prefix (or want to
handle it in a hook during message generation instead.
- `channel_msg_nick_pattern`(str, default `"{alias}\\s*?|{alias}\\s+?(?P<arg1>.+?)") -
this is what used when a channel subscriber gets a channel nick assigned to this
channel. The nickhandler uses the pattern to pick out this channel's name from user
input. The `{alias}` token will get both the channel's key and any set/custom aliases
per subscriber. You need to allow for an `<arg1>` regex group to catch any message
that should be send to the channel. You usually don't need to change this pattern
unless you are changing channel command-style entirely.
- `channel_msg_nick_replacement` (str, default `"channel {channelname} = $1"` - this
is used by the nickhandler to generate a replacement string once the nickhandler (using
the `channel_msg_nick_pattern`) identifies that the channel should be addressed
to send a message to it. The `<arg1>` regex pattern match from `channel_msg_nick_pattern`
will end up at the `$1` position in the replacement. Together, this allows you do e.g.
'public Hello' and have that become a mapping to `channel public = Hello`. By default,
the account-level `channel` command is used. If you were to rename that command you must
tweak the output to something like `yourchannelcommandname {channelname} = $1`.
""" """