Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

peterthehan/discord-emoji-log-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Emoji Log Bot

Discord Twitter Follow

A Discord bot that logs user emoji usage.

Be aware that while the Google Sheets API has a free tier, it has limits in place. You can read more about the API limits here and the document limits here.

Given that a Google Sheets document supports up to 5000000 cells and the main logs table has 5 columns, that gives us appromixately 1000000 rows. If we assume a rate of 500 logs per day, that gives us approximately 5.5 years before we have to consider archiving rows.

Google Sheets Setup

  1. Follow the setup instructions found in the project google-spreadsheet to create a Google Sheets API Service Account.

    Take note of the client email associated with the Service Account. Additionally, you will have downloaded a credentials JSON file after following through the instructions. You will need these in the next section.

  2. Create a Google Sheets document in your Google Drive.

  3. Click the green Share button and share the file with the client email associated with the Service Account.

    Make sure the Service Account has edit access to this file or the bot will not be able to log data!

Setup

  1. Follow the instructions in create-discord-bot.

  2. Copy the client_email and private_key values in the credentials JSON file into your .env file:

    CLIENT_EMAIL=client_email_value_here
    PRIVATE_KEY=private_key_value_here
    
  3. Download this widget and move the src-discord-emoji-log-bot folder into the src/widgets/ folder created in step 1.

    npm i -s emoji-regex@^9.2.2 google-spreadsheet@^^3.1.15 to install this widget's dependencies.

  4. Open config.js to configure your own settings:

    module.exports = {
      sheetId: "1CrvJ3Zuec5F7dF5ez_nPOJ5auZVfPrXz_W8GG2o0PZM",
      guildChannelMap: {
        "258167954913361930": {
          channelsToIgnore: [],
        },
      },
    };

    Add as many rules as you want to configure for other servers.

  5. npm start to run the bot.

Design

schema

Visit for more help or information!