cursor = self.query('create table if not exists announcements (id char(36) not null, bot_id varchar(32) not null, server_id varchar(32) not null, member_id varchar(32) not null, channel_id varchar(32) not null, voice_id varchar(32), sound varchar(128), mention varchar(32), start_date datetime, end_date datetime, interval int, probability float not null default 1.0, last_spoke datetime, asap boolean not null default false, message text, digest char(56))')
cursor = self.query('create unique index if not exists announcements_id on announcements (id)')
cursor = self.query('create index if not exists announcements_bot_id on announcements (bot_id)')
- cursor = self.query('create table if not exists feeds (id char(36) not null, bot_id varchar(32) not null, server_id varchar(32) not null, channel_id varchar(32) not null, description varchar(64), url varchar(128) not null, date boolean not null default true, summary boolean not null default false, link_json varchar(256))')
+ cursor = self.query('create table if not exists feeds (id char(36) not null, bot_id varchar(32) not null, server_id varchar(32) not null, channel_id varchar(32) not null, description varchar(64), url varchar(128) not null, date boolean not null default true, summary boolean not null default false, link_json varchar(256), enabled boolean not null default true)')
cursor = self.query('create unique index if not exists feed_id on feeds (id)')
cursor = self.query('create index if not exists feed_bot_id on feeds (bot_id)')
self.dbh.commit()
def get_feeds(self, client):
now = self.now()
- cursor = self.query("select id, server_id, channel_id, url, date, summary, link_json from feeds where bot_id=?", [client.user.id])
+ cursor = self.query("select id, server_id, channel_id, url, date, summary, link_json, enabled from feeds where bot_id=?", [client.user.id])
for row in cursor.fetchall():
yield dict(row)
self.close_db()