from common import log, queries

def process_event(self, connection, event):
    log.info(event) # Log to console.

    # Get and update resources.
    user = queries.create_or_get_and_update_last_event(self, 'user', 'cn', channel_name=event.target, user_name=event.source.nick, event_content=event.arguments[0])
    channel = queries.create_or_get_and_update_last_event(self, 'channel', 'cn', channel_name=event.target, user_name=event.source.nick, event_content=event.arguments[0])
    queries.update_message_statistics(self, 'message', channel, user)   # Update message statistics
