comparison irc/channel.py @ 656:79e785f0bdad

For issue #38, change IRC bot to use Redis instead of MySQL. Also deleting the bot from this repo as it now has its own repo.
author Brian Neal <bgneal@gmail.com>
date Sat, 11 May 2013 15:22:45 -0500
parents
children
comparison
equal deleted inserted replaced
655:d9d6b4b8bab7 656:79e785f0bdad
1 """Abstracts the list of users in the IRC channel."""
2
3 from redis import RedisError
4
5 from core.services import get_redis_connection
6
7 def get_users():
8 """Return a list of users in the IRC channel."""
9 conn = get_redis_connection()
10 try:
11 nicks = conn.get('irc:channel_members')
12 except RedisError:
13 nicks = None
14
15 return nicks.split() if nicks else []