From a44b37c51b723311c50000a87c046069a230b823 Mon Sep 17 00:00:00 2001 From: kieranrobson Date: Tue, 10 May 2022 20:58:30 +0100 Subject: [PATCH] Added 24 hour coursework help channel message --- events/ready.js | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/events/ready.js b/events/ready.js index 5100c69..0207e32 100644 --- a/events/ready.js +++ b/events/ready.js @@ -1,17 +1,30 @@ const client = require("../index"); +const discord = require("discord.js") client.on('ready', () => { console.log('HullCSS is online') client.user.setActivity(`-help | hullcss.org` , {type:"WATCHING"}) - - - const guild = client.guilds.cache.get('427865794467069962'); + const guild = client.guilds.cache.get('969944638498680872') setInterval(() =>{ - const memberCount = client.guilds.cache.get('427865794467069962').memberCount - const channel = guild.channels.cache.get('906167542249308160'); + const memberCount = client.guilds.cache.get('969944638498680872').memberCount + const channel = client.channels.cache.get('969944638981034014'); channel.setName(`Discord Members: ${memberCount.toLocaleString()}`); - }, 60000); + }, 600000); - }) + const courseworkhelpchannel = client.channels.cache.get('970027557607071754') + setInterval(() =>{ + const embed = new discord.MessageEmbed() + .setColor('GREEN') + .setFooter(`Sent every 24 hours`) + .setTimestamp() + .setTitle("Reminder") + .setDescription(`As a reminder that this is a community help channel. Here are some rules to follow before using this channel.`) + .addField('Code Rules', 'Please keep all code relevevant and short to prevent getting too much help. This channel is to get help with coursework, not for members to do it for you.') + .addField('Code Sharing', 'For shorter pieces of code please use discord in built code blocks. For larger pieces, please use a thid party code sharing site.') + .addField('Canvas', 'The best place to get help will always be by asking the lecturer. By using the Canvas discussion forum, this means that you will get direct help from the module team and others studying the module.') + .addField('Pingable Role', 'There is a pingable role for you to ping helpful people. Please don`t overuse it.') + courseworkhelpchannel.send({ embeds: [embed] }); + }, 86400000); +})