From 240f3047f5faa6050954ca05e7c9ef6dd89dfcf0 Mon Sep 17 00:00:00 2001 From: Edward Chan <95153850+ifrog800@users.noreply.github.com> Date: Tue, 24 Jan 2023 20:30:17 -0500 Subject: [PATCH] updates pfp automatically Every week updates the bot's profile picture. --- .gitignore | 5 ++++- events/ready.js | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9b9dbb5..8f1ee2e 100644 --- a/.gitignore +++ b/.gitignore @@ -104,4 +104,7 @@ dist .tern-port # service account key -serviceAccountKey.json \ No newline at end of file +serviceAccountKey.json + +# jet brains +.idea/ \ No newline at end of file diff --git a/events/ready.js b/events/ready.js index 79ea6b0..60bf0ba 100644 --- a/events/ready.js +++ b/events/ready.js @@ -2,6 +2,15 @@ const { db } = require('../firebase'); const { Events, ActivityType} = require('discord.js'); const moment = require('moment'); const { FieldValue } = require('firebase-admin/firestore'); +const { get } = require("https") + + +function updatePfp() { + client.user.setAvatar("https://github.com/robere2.png") + .then(user => console.debug(`${new Date()} Updated Avatar!`)) + .catch(console.error); +} + module.exports = { name: Events.ClientReady, @@ -43,5 +52,8 @@ module.exports = { } }) }, 86400 * 1000); + + updatePfp(); + setInterval(updatePfp, 1000 * 60 * 60 * 24 * 7); }, }; \ No newline at end of file