Personal Project

For my senior personal project I decided I wanted to make a Discord Bot that helps me run my Discord Server. I like to have a theme in my server based on upcoming holidays, and before making the bot, I would go through each text and voice channel and change the emojis by hand. Seeing as I planned to run this server for a long time, and I really liked having the themed emojis, I decided to explore making a Discord Bot with JavaScript, using the Discord.JS library. Making the bot served two purposes, the first was simply to make changing the emojis much faster, the second was to learn how to make a bot with zero experience and see if I could do it. Needless to say, I got the bot working, and I have become a lot more familiar with JavaScript.

Code Snippet

                         const BaseCommand = require('../../utils/structures/BaseCommand');

                         module.exports = class TextCommand extends BaseCommand {
                         constructor() {
                         super('text', 'test', []);

                         async run(client, message, args) {
                         //command: text 😍
                         //discord server id: 3812335977********

                         const emoji = args.slice(0).join(" ");
                         //const channelList = [];
                         var array = [];

                         //input check
                         if (!emoji) return"You must include an emoji");

                         for (let i = 0; i < array.length; i++) {
                         var channelid = array[i].toString();
                         var channelType = message.guild.channels.cache.get(channelid).type;
                         if (channelType == 'text') {
                         let channelName = message.guild.channels.cache.get(channelid).name;
                         let nameToArray = [...channelName];
                         const newName = nameToArray.join('');

                         function getChannelIDs(fetch) {
                         try {
                         let channels = client.channels.cache.array();
                         for (const channel of channels) {
                         } catch (err) {
                         console.log('array error')
               'An error occoured while getting the channels.')

                         return array;