def create_tables(self):
self.open_db()
- cursor = self.query('create table if not exists factions (id char(36) not null, bot_id varchar(32) not null, member_id varchar(32) not null, server_id varchar(32) not null, channel_id varchar(32) not null, newsflash_channel_id varchar(32), name varchar(128) not null, state_id int not null, interval int not null default 86400, updated datetime)')
+ cursor = self.query('create table if not exists factions (id char(36) not null, bot_id varchar(32) not null, member_id varchar(32) not null, server_id varchar(32) not null, channel_id varchar(32) not null, newsflash_channel_id varchar(32), faction_id int not null, name varchar(128) not null, state_id int not null, interval int not null default 86400, updated datetime)')
cursor = self.query('create unique index if not exists factions_id on factions (id)')
cursor = self.query('create index if not exists factions_bot_id on factions (bot_id)')
cursor = self.query('create table if not exists faction_names (faction_id int not null, name varchar(128) not null)')
if len(lines):
await bot.say_many(message.channel, lines)
for tracked in self.tracked_factions:
- await self.report_stale_influence(message.channel, name = tracked.name)
+ await self.report_stale_influence(message.channel, id = tracked.faction_id)
async def list_tracked_factions(self, message):
results = []
log.warning("Can't get channel for faction {}".format(tracked.id))
self.update_tracked_faction(tracked.id, **update)
- await self.report_faction_influence(channel, name = tracked.name, yelp_if_no_data = False)
- await self.report_stale_influence(channel, name = tracked.name)
+ await self.report_faction_influence(channel, id = tracked.faction_id, yelp_if_no_data = False)
+ await self.report_stale_influence(channel, id = tracked.faction_id)
async def get_faction(self, destination, name):
factions = eddb.find_faction(name)