def process(session_id, fields): usage = "Usage: cancel {-q} {-n nick|-s address}" try: opts, nick = ltd.get_opts(fields[0], quiet="q", mode="ns") if not nick: raise LtdErrorException(usage) except: raise LtdErrorException(usage) ACTION(actions.group.Group).cancel(session_id, nick, **opts)
def process(session_id, fields): usage = "Usage: /stats {-s|-t|-m|-y|-a}" try: opts, rest = ltd.get_opts(fields[0], timeframe="stmya") if rest: raise LtdErrorException(usage) ACTION(actions.info.Info).stats(session_id, **opts, msgid=msgid(fields)) except LtdErrorException as ex: raise ex except: raise LtdErrorException(usage)
def process(session_id, fields): usage = "Usage: talk {-q} {-d} {-r} {-n nick|-s address}" try: opts, nick = ltd.get_opts(fields[0], quiet="q", delete="d", registered="r", mode="ns") if not nick: raise LtdErrorException(usage) except: raise LtdErrorException(usage) ACTION(actions.group.Group).talk(session_id, nick, **opts)
def process(session_id, fields): usage = "Usage: notify {-q} {-n nick|-s address}" if fields[0]: try: opts, target = ltd.get_opts(fields[0], quiet="q", mode="ns") if not target: raise LtdErrorException(usage) except: raise LtdErrorException(usage) ACTION(actions.notification.Notify).toggle(session_id, target, **opts) else: ACTION(actions.notification.Notify).list(session_id)
def process(session_id, fields): usage = "Usage: whereis {-a} {nick}" if fields[0]: try: opts, nick = ltd.get_opts(fields[0], mode="a") if not nick: raise LtdErrorException(usage) except: raise LtdErrorException(usage) ACTION(actions.usersession.UserSession).whereis( session_id, nick, **opts, msgid=msgid(fields)) else: raise LtdErrorException(usage)
def process(session_id, fields): usage = "Usage: hush {-q} {-n nick|-s address}" if fields[0]: try: opts, target = ltd.get_opts(fields[0], quiet="q", mode="ns", msg_type="op") if not target: raise LtdErrorException(usage) except: raise LtdErrorException(usage) ACTION(actions.hush.Hush).toggle(session_id, target, **opts) else: ACTION(actions.hush.Hush).list(session_id)