CassandraConnection¶
-
class
wsirc.cassandra_connection.
CassandraConnection
¶ Object to handdle Cassandra database insertions and queries.
-
conn
¶ the Cassandra cqlengine Cluster object.
-
session
¶ the Cassandra cqlengine Session object.
-
distinct
()¶ Fetch all the distinct channel, nickname pairs stored in Cassandra.
Returns: A cassandra.cluster.ResultSet.
-
get_log
(channel, user, limit=100)¶ Fetch the latest chat messages from a specific channel and user pairs stored in Cassandra.
Parameters: - channel – Twitch channel to search in.
- user – Twitch user to search for.
- limit – Maximum chat lines to fetch. This is limited to 1000 maximum.
Returns: A cassandra.cluster.ResultSet.
-
on_chat
(wsirc, msg, hooks)¶ Callback function to add to the hook handler.
Parameters: - wsirc – The global WS_IRC object.
- msg – The current Message object.
- hooks – The global Hooks object.
-
start
()¶ Function to start the Cassandra server connection.
-