3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-29 14:12:39 +01:00

commands: show topic only if it exists, disable TS output on clientbot

This commit is contained in:
James Lu 2016-08-02 23:57:18 -07:00
parent 0fc0f104bd
commit 197d9fc14a

View File

@ -88,8 +88,13 @@ def showchan(irc, source, args):
nicks = [irc.users[u].nick for u in c.users]
f('Information on channel \x02%s\x02:' % channel)
f('\x02Channel topic\x02: %s' % c.topic)
f('\x02Channel creation time\x02: %s (%s)' % (ctime(c.ts), c.ts))
if c.topic:
f('\x02Channel topic\x02: %s' % c.topic)
if irc.protoname != 'clientbot':
# Clientbot-specific hack: don't show channel TS because it's not properly tracked.
f('\x02Channel creation time\x02: %s (%s)' % (ctime(c.ts), c.ts))
# Show only modes that aren't list-style modes.
modes = irc.joinModes([m for m in c.modes if m[0] not in irc.cmodes['*A']], sort=True)
f('\x02Channel modes\x02: %s' % modes)