Close tickets after 5 days of inactivity
This commit is contained in:
@@ -143,6 +143,7 @@ export class Database {
|
||||
}
|
||||
|
||||
static async getDiscordIds(e621Id: string | number): Promise<string[]> {
|
||||
// Perhaps this would be better and then we can return all the data: SELECT * FROM (SELECT * FROM discord_names WHERE user_id = ? ORDER BY id DESC) GROUP BY discord_id;
|
||||
const ids = await Database.db.all<{ discord_id: string }[]>('SELECT DISTINCT discord_id FROM discord_names WHERE user_id = ?', e621Id);
|
||||
|
||||
return ids.map(r => r.discord_id);
|
||||
@@ -470,5 +471,9 @@ export class Database {
|
||||
return await Database.db.get<PrivateHelpTicket>('SELECT * from private_help_tickets WHERE user_id = ? ORDER BY timestamp DESC LIMIT 1', userId);
|
||||
}
|
||||
|
||||
static async getAllOpenPrivateHelpTickets(): Promise<PrivateHelpTicket[]> {
|
||||
return await Database.db.all<PrivateHelpTicket[]>('SELECT * from private_help_tickets WHERE status = ?', PrivateHelpTicketStatus.OPEN);
|
||||
}
|
||||
|
||||
// -- END PRIVATE HELP TICKETS
|
||||
}
|
||||
Reference in New Issue
Block a user