Пример #1
0
from ZomgBot.plugins import Plugin, Modifier
from ZomgBot.events import EventHandler
from ZomgBot.ircglob import glob, matches

from datetime import datetime
import re

from sqlalchemy import Column, DateTime, Integer, String, Text
from sqlalchemy.sql.expression import null

from twisted.internet import reactor

Base = Plugin.declarative_base("tell")

class Message(Base):
    id = Column(Integer, primary_key=True)
    sender = Column(String)
    to = Column(String)
    message = Column(String)
    channel = Column(String)
    date = Column(DateTime)

    def __init__(self, sender, to, channel, message, date):
        self.sender = sender
        self.to = to.lower()
        self.message = message
        self.date = date
        self.channel = channel.lower()

    def __repr__(self):
        return "<Message('{self.sender}', '{self.to}', '{self.channel}', '{self.message}', '{self.date}')>".format(self=self)
Пример #2
0
from ZomgBot.plugins import Plugin, Modifier
from ZomgBot.events import EventHandler
from ZomgBot.ircglob import glob, matches

from datetime import datetime
import re

from sqlalchemy import Column, DateTime, Integer, String, Text
from sqlalchemy.sql.expression import func

from twisted.internet import reactor
from twisted.internet.defer import Deferred, inlineCallbacks, returnValue

Base = Plugin.declarative_base("ban_manager")


class Ban(Base):
    id = Column(Integer, primary_key=True)
    time = Column(DateTime)
    channel = Column(String(64))
    banmask = Column(String(256))
    ban_exp = Column(String(256))
    banner = Column(String(64))
    reason = Column(Text)

    def __repr__(self):
        return "<Ban(channel={self.channel}, banmask={self.ban_exp}, banner={self.banner})>".format(
            self=self)


class ThreadHelper(object):
Пример #3
0
from ZomgBot.plugins import Plugin, Modifier
from ZomgBot.events import EventHandler
from ZomgBot.ircglob import glob, matches

from datetime import datetime
import re

from sqlalchemy import Column, DateTime, Integer, String, Text
from sqlalchemy.sql.expression import func

from twisted.internet import reactor
from twisted.internet.defer import Deferred, inlineCallbacks, returnValue


Base = Plugin.declarative_base("ban_manager")


class Ban(Base):
    id = Column(Integer, primary_key=True)
    time = Column(DateTime)
    channel = Column(String(64))
    banmask = Column(String(256))
    ban_exp = Column(String(256))
    banner = Column(String(64))
    reason = Column(Text)

    def __repr__(self):
        return "<Ban(channel={self.channel}, banmask={self.ban_exp}, banner={self.banner})>".format(self=self)


class ThreadHelper(object):