@@ -0,0 +1,2053 @@
+#!/usr/bin/env python3%0A%0A###############################################################################%0A# Module Imports%0A###############################################################################%0A%0Aimport arrow%0Aimport peewee%0Aimport sopel%0Aimport re%0A%0Afrom pyscp_bot import snark%0A%0A###############################################################################%0A%0Adb = peewee.SqliteDatabase('notes.db')%0A%0A%0Aclass BaseModel(peewee.Model):%0A%0A    class Meta:%0A        database = db%0A%0A%0Aclass Tell(BaseModel):%0A    sender = peewee.CharField()%0A    recipient = peewee.CharField(index=True)%0A    text = peewee.TextField()%0A    time = peewee.DateTimeField()%0A%0A%0A###############################################################################%0A%0A%0Adef setup(bot):%0A    db.connect()%0A    Tell.create_table(True)%0A    bot._tells_recipients = %7B%0A        i.recipient for i in%0A        Tell.select(Tell.recipient).distinct(Tell.recipient)%7D%0A%0A%0A@sopel.module.commands('tell')%0Adef tell(bot, trigger):%0A    name, text = trigger.group(2).split(maxsplit=1)%0A    now = arrow.now().format('YYYY-MM-DD hh:mm:ss')%0A    Tell.create(sender=trigger.nick, recipient=name, text=text, time=now)%0A    bot._tells_recipients.add(name)%0A    bot.say(snark.tell_stored(trigger.nick))%0A%0A%0A@sopel.module.rule('.*')%0Adef user_active(bot, trigger):%0A    if re.match(r'%5B!%5C.%5D(st%7Cshowt%7Cshowtells)', trigger.group(0)):%0A        return%0A    if trigger.nick in bot._tells_recipients:%0A        deliver_tells(bot, trigger.nick)%0A%0A%0A@sopel.module.commands('st', 'showt', 'showtells')%0Adef showtells(bot, trigger):%0A    if trigger.nick in bot._tells_recipients:%0A        deliver_tells(bot, trigger.nick)%0A    else:%0A        bot.notice(snark.no_tells(trigger.nick), trigger.nick)%0A%0A%0Adef deliver_tells(bot, name):%0A    tells = Tell.select().where(Tell.recipient == name)%0A    for tell in tells:%0A        time_passed = arrow.get(tell.time).humanize()%0A        msg = '%7B%7D said %7B%7D: %7B%7D'.format(tell.sender, time_passed, tell.text)%0A        bot.notice(msg, name)%0A    Tell.delete().where(Tell.recipient == name).execute()%0A    bot._tells_recipients -= %7Bname%7D%0A

add a module for tells and quotes and such