Add the --welcome option, that takes an on/off parameter and
enables/disables welcome messages when a new user joins the MUC.
The default is enabled.
send_welcome() was refactored from muc_online().
Issue: RoboTux's rant.
- CLI arguments can now be saved to/read from config file.
- Arguments format : name= value
- Replaced argparse module with configargparse.
- Modified debug argument accordingly to configargparse behavior.
The uptime is now sent on the MUC if the command was in a public
message, and privately if the bot was contacted privately.
The parse_command()'s `echo` argument was renamed `priv` to better
reflect the logic.
The default file name is now "{muc}.db", with "{muc}" substituted with
the name of the current MUC. The substitution done in the user-provided
database file name as well. This makes easy to handle multiple instances
of the bot connecting to several MUCs.
This will also allow one to set up an alternative data directory in the
(future) configuration file, as simply as:
database = /var/lib/kaabot/{muc}.db
This commit also changes the short option for --database from -db to -b
(like base). This avoids having a single-dash long option.
- Wrap the few lines that still were longer than 80 characters.
- Drop long commands "backlog" and "historique" from the bot's help
message, since they are not (and won't be) implemented.
- Fix typo in JSON decoding warning message ("filenam").
- New option --vocabulary to provide the path to a vocabulary file
(default: vocabulary.json in the working directory).
- Added file vocabulary.json with the current set of insults. The schema
is done so we can extend it with other categories of vocabulary (I'm
thinking of a "greetings" category).
Closes: #4
- The bot now accepts commands sent privately.
- Whenever someone tries to read the log by a private message, the bot
reports it publicly.
- When a private message is not a valid command, the user is insulted
publicly.
- Direct messages (sent with the bot's JID, not from a MUC) are refused.
Closes: #1, #2
- The bot now interprets ':', and strip extra whitespaces.
- The general logic of the tests was improved, parse_command() was added
to make thinks clearer.
* Quit setting encoding:
UTF-8 is used by default in Python 3, hence the Python 3 version of
sleekxmpp does't have setdefaultencoding().
* Use input() instead of raw_input().