예제 #1
0
def check_status(bot):
    global last_status
    status = nplstatus.get()
    if status != last_status:
        last_status = status
        if status:
            bot.privmsg('NPL-Registrations are now open! http://npl.teamspeakusa.com/ts3npl.php')
        else:
            bot.privmsg('NPL-Registrations are now closed!')
예제 #2
0
ip = 'irc.quakenet.org'
port = 6667
nick = 'TSBot'
channel = '#teamspeak'

start_time = time.time()

db = sqlite3.connect('bar.db')
db_cursor = db.cursor()
db_cursor.execute('CREATE TABLE IF NOT EXISTS bar (trigger text, answer text)')
db_cursor.execute('CREATE TABLE IF NOT EXISTS lowscore (username text, lines text, time int)')
db.commit()

global last_status
last_status = nplstatus.get()


# functions for the bar-functionality
def add_to_bar(trigger, answer):
    db_cursor.execute('INSERT INTO bar VALUES (?, ?)', (str(trigger.lower()), str(answer)))
    db.commit()


def remove_from_bar(trigger):
    db_cursor.execute('DELETE FROM bar WHERE trigger=?', (trigger.lower(),))
    db.commit()


def get_triggers():
    r = []