WIP: Format code with Google Typescript formatting guidelines
This commit is contained in:
@@ -3,7 +3,7 @@ import {
|
||||
Client,
|
||||
SlashCommandBuilder,
|
||||
TextChannel,
|
||||
} from "discord.js";
|
||||
} from 'discord.js';
|
||||
import {
|
||||
Sequelize,
|
||||
Model,
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
BOOLEAN,
|
||||
DATE,
|
||||
literal,
|
||||
} from "sequelize";
|
||||
} from 'sequelize';
|
||||
|
||||
export interface Settings {
|
||||
client: Client; // Main Discord client object
|
||||
@@ -63,7 +63,7 @@ export async function initAndSyncTables(sequelize: Sequelize) {
|
||||
type: BOOLEAN,
|
||||
},
|
||||
},
|
||||
{ sequelize },
|
||||
{sequelize},
|
||||
);
|
||||
CheckIn.init(
|
||||
{
|
||||
@@ -76,14 +76,14 @@ export async function initAndSyncTables(sequelize: Sequelize) {
|
||||
allowNull: false,
|
||||
},
|
||||
},
|
||||
{ sequelize },
|
||||
{sequelize},
|
||||
);
|
||||
Nag.hasOne(CheckIn, { foreignKey: "nagId" });
|
||||
Nag.hasOne(CheckIn, {foreignKey: 'nagId'});
|
||||
await Nag.sync();
|
||||
await CheckIn.sync();
|
||||
}
|
||||
|
||||
import { Guild, Channel } from "discord.js";
|
||||
import {Guild, Channel} from 'discord.js';
|
||||
|
||||
export class Plugin {
|
||||
settings: Settings;
|
||||
@@ -106,7 +106,7 @@ export class Plugin {
|
||||
|
||||
async triggerNag(nag: Nag) {
|
||||
const client = this.settings.client;
|
||||
const chan = client.channels.cache.get("1234"); // TODO
|
||||
const chan = client.channels.cache.get('1234'); // TODO
|
||||
if (!(chan instanceof TextChannel)) {
|
||||
return; // TODO
|
||||
}
|
||||
@@ -114,16 +114,16 @@ export class Plugin {
|
||||
const failText =
|
||||
nag.failText ??
|
||||
`<@${nag.userId}> didn't complete "${nag.text}". Shame shame!`;
|
||||
const mentionHere = nag.mentionHere ? "<@here> " : "";
|
||||
const mentionHere = nag.mentionHere ? '<@here> ' : '';
|
||||
const msg = `${mentionHere}${failText}`;
|
||||
await chan.send(msg);
|
||||
} catch (error) {
|
||||
console.log("Error while creating Nag:", error); // TODO
|
||||
console.log('Error while creating Nag:', error); // TODO
|
||||
}
|
||||
}
|
||||
|
||||
async loop() {
|
||||
console.debug("nag.js main loop");
|
||||
console.debug('nag.js main loop');
|
||||
// Find all nags where the last check-in was before (next check in) - (24 hours)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user