Skip to content

A discord.js bot for the TGD server's daily-standup channel

Notifications You must be signed in to change notification settings

glowurms/tgd-streakbot

 
 

Repository files navigation

To run this bot:

  1. Create an app and a bot in the Discord Developer Portal.

  2. Ensure the bot "user account" is added to your Discord server.

  3. Install NodeJS.

  4. Download this repo.

  5. Create a text file named .env (literally .env nothing before the dot) in the root directory of the downloaded tgd-streakbot repo.

  6. Edit the .env file in a plain-text editor like notepad. At minimum write BOT_SECRET=[bot token], replacing [bot token] with the bot's secret token copied from the Discord dev portal.

    Example .env contents:

    # REQUIRED CONFIG
    BOT_SECRET=****************************
    
    # OPTIONAL CONFIG
    channelName=daily-standup
    
    dayStartHour=0
    dayStartMinute=0
    
    morningAnnouncementHour=7
    morningAnnouncementMinute=0
    
    midDayReminderHour=12
    midDayReminderMinute=0
    
    midWeekSummaryHour=13
    midWeekSummaryMinute=0
    
    midWeekDayOfWeek=3
  7. Save and close the .env file.

  8. Navigate a command prompt to the root directory of the downloaded tgd-streakbot repo.

  9. Run the command: npm install

  10. Run the command: node .

  11. The command prompt should say "Logged in as TGD StreakBot". The bot should appear in the server's user list as online.

  12. Leave the command prompt open for as long as you want the bot to run.

As users post messages, the bot will create and update a file named db.json. You can modify or delete this file yourself, but you need to restart the bot to handle changes you make. Either close the command prompt and start a new one, or input Ctrl+C to kill the bot, then run the "node ." command again.

You can change the channel this bot operates in, as well as the hour and minute that it considers the day to start at. These are constant values near the top of the code in bot.js. You'll need to restart the bot for it to detect these changes.

About

A discord.js bot for the TGD server's daily-standup channel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%