Commit 0a0a314d authored by hark's avatar hark
Browse files

Merge remote-tracking branch 'origin/antani'

parents 0793b1e5 d18c216d
......@@ -13,13 +13,21 @@ def shout(bot, trigger):
conn = sqlite3.connect(db)
c = conn.cursor()
mastodon = Mastodon(
access_token = bot.config.mastodon.access_token,
api_base_url = bot.config.mastodon.api_base_url
)
c.execute('''INSERT INTO shouts(created_at,name,message) VALUES(?,?,?)''', (trigger.time, trigger.nick, trigger.group(2) ))
mastodon.toot('Shoutout from ' + trigger.nick +' : ' + trigger.group(2))
try:
c.execute('''INSERT INTO shouts(created_at,name,message) VALUES(?,?,?)''', (trigger.time, trigger.nick, trigger.group(2) ))
except:
bot.say("database failed")
try:
mastodon = Mastodon(
access_token = bot.config.mastodon.access_token,
api_base_url = bot.config.mastodon.api_base_url
)
mastodon.toot('Shoutout from ' + trigger.nick +' : ' + trigger.group(2))
except:
bot.say("mastodont failed")
conn.commit()
conn.close()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment