echo-message ended up in self.state.capabilities_req even though it wasn't
requested, so the bot was stuck in state:
"Waiting for ACK/NAK of capabilities: {'echo-message'}".
Plugin can opt in to getting echo messages by setting the class attribute
'echo_message = True' if they want to get echos.
This defaults to False in order not to break existing plugins, and because
they usually don't need it (there's outFilter for most cases).
If on an insecure connection: reconnect.
If on a secure connect: store it and do nothing else.
For now, stored STS policies are not read when connecting to an
insecure server.
Fixes c1d3bad64f, which crashed with:
```
ERROR 2020-01-18T01:34:07 Uncaught exception in NickAuth._callCommand:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/supybot/callbacks.py", line 1337, in _callCommand
irc.errorNoCapability(cap)
File "/usr/local/lib/python3.7/dist-packages/supybot/callbacks.py", line 544, in errorNoCapability
raise Error()
supybot.callbacks.Error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/supybot/log.py", line 368, in m
return f(self, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/supybot/callbacks.py", line 1359, in _callCommand
irc.error(str(e))
File "/usr/local/lib/python3.7/dist-packages/supybot/callbacks.py", line 1065, in error
raise ArgumentError
supybot.callbacks.ArgumentError
```
It's nicer to use 'irc.channel' instead of 'irc.args[0]', and .channel
provides the actual channel name (stripped of the statusmsg prefix),
so it can be used by plugins when they want to use the actual channel
name.
* supybot-plugin-create: compactify import statements in the template
* supybot-plugin-create: prefer importlib over imp on Python >= 3.4
The imp module is deprecated as of Python 3.4[1], with importlib being the successor. However, importlib is only available in Python 2.7+ and 3.1+, so we should still use a fallback.
[1]: https://docs.python.org/3.6/library/imp.html
* test: add test cases for supybot-plugin-create
* -plugin-create: fix errors when only a subset of args are given
* -plugin-create: rename --real-name to --author/-a
These days, working under a pseudonym or alias is not unheard of, so putting emphasis on real names feels somewhat out of place.
* -plugin-create: add -d as an alias to --desc for consistency