From 8ab25c6a482692a1a6360b445914ce8dc0d7edda Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 23 Jul 2022 18:20:12 +0100 Subject: [PATCH] feat(arabot): add scheduled standup reminder --- .../ping.ts => schedules/standup.ts} | 24 +++++++------------ src/utils/ids.ts | 10 ++++++++ 2 files changed, 18 insertions(+), 16 deletions(-) rename src/{commands/ping.ts => schedules/standup.ts} (56%) diff --git a/src/commands/ping.ts b/src/schedules/standup.ts similarity index 56% rename from src/commands/ping.ts rename to src/schedules/standup.ts index 29002b5..fd89e4e 100644 --- a/src/commands/ping.ts +++ b/src/schedules/standup.ts @@ -17,23 +17,15 @@ along with this program. If not, see . */ -import { Command } from '@sapphire/framework'; -import type { Message } from 'discord.js'; +import { container } from '@sapphire/framework'; +import type { TextChannel } from 'discord.js'; +import { IDs } from '../utils/ids'; -export class PingCommand extends Command { - public constructor(context: Command.Context) { - super(context, { - name: 'ping', - aliases: ['pong'], - description: 'ping pong', - }); - } +export async function standupRun() { + const { client } = container; - public async messageRun(message: Message) { - const msg = await message.channel.send('Ping?'); + const channel = client.channels.cache.get(IDs.channels.staff.coordinators) as TextChannel; - const content = `Pong from JavaScript! Bot Latency ${Math.round(this.container.client.ws.ping)}ms. API Latency ${msg.createdTimestamp - message.createdTimestamp}ms.`; - - return msg.edit(content); - } + await channel.send(`Hiya <@&${IDs.roles.staff.coordinator}> it's time for your weekly standup! + \nPlease submit it in <#${IDs.channels.staff.standup}> :)`); } diff --git a/src/utils/ids.ts b/src/utils/ids.ts index eae07a3..832c115 100644 --- a/src/utils/ids.ts +++ b/src/utils/ids.ts @@ -37,6 +37,16 @@ const IDs = { restricted3: '856582673258774538', restricted4: '872472182888992858', }, + staff: { + coordinator: '993636242019323904', + devCoordinator: '966031741099855973', + }, + }, + channels: { + staff: { + coordinators: '989249700353953843', + standup: '996009201237233684', + }, }, };