CMD_SHORTCUTS['nick'] = 'window.nick'
CMD_SHORTCUTS['privmsg'] = 'window.privmsg'
CMD_SHORTCUTS['reconnect'] = 'window.reconnect'
+CMD_SHORTCUTS['raw'] = 'window.raw'
_LOG_PREFIX_SERVER = '$'
_LOG_PREFIX_OUT = '>'
'Send chat message msg to target.'
self._send_msg('PRIVMSG', (target, msg), log_target=target, to_log=msg)
+ def cmd__raw(self, verb: str, params_str: str = '') -> None:
+ 'Send raw command, with direct input of params string.'
+ if params_str[:1] == ':':
+ params = [params_str]
+ else:
+ params = params_str.split(' :', maxsplit=1)
+ params = params[0].split() + params[1:2]
+ self._send_msg(verb, tuple(params))
+
class _PrivmsgPromptWidget(PromptWidget):
_nickname: str = ''
) -> bool:
'Apply settings in kwargs, follow representation update triggers.'
changes = self._db.set(key, value, confirmed)
- for i, t in enumerate((('', value), ('confirmation of', confirmed))):
+ for i, t in enumerate((('', value), ('confirmation of ', confirmed))):
if changes[i]:
self.log(f'changing {t[0]}{key} to: [{t[1]}]', scope=scope)
for win in [w for w in self.windows
self._client_tui_trigger('log', scope=scope, msg=item, **kwargs)
if scope == LogScope.RAW:
with open(f'{self.client_id}.log', 'a', encoding='utf8') as f:
- f.write((f'>' if kwargs['out'] else '<') + f' {msg}\n')
+ f.write(('>' if kwargs['out'] else '<') + f' {msg}\n')
def _update_db(self, key: str, value: int | str, confirm: bool) -> None:
super()._update_db(key, value, confirm)