Skip to content

This is an example usage of how to achieve scheduling post with Discord Bot

Notifications You must be signed in to change notification settings

tigadika/Scheduled-Discord-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Bot with Scheduled Message

This is an example of how you can accomplish to make a scheduled message using Discord Bot and node-cron

Cron is one of the popular utility that provide some form of job scheduler or automation code

Tech stack used in this example:

  • express (server framework)
  • axios (HTTP client)
  • node-cron (Cron-job scheduling)
  • dotenv (environment variable)

Working with discord bot

In this example, we are using Discord Developer Portal documentation which allow us to create Discord Bot & Application along with its permission (wether to just sending message or change user role) with ease. Just follow along the official documentation intro.

Then, we use axios as a HTTP client to make a request to Discord Bot endpoint (make sure that the Bot is added to your server).

Read more:

Working with Cron Job in general

Working with node-cron or any package that utilized any form of Cron Job is relatively easy, if we know the standarized unix-cron string format.

The standard time fields is going to be like this:

'* * * * *'

each star '*' represent a Minute, Hour, Day of the Month, Month, and Day of the Week respectively, and we can change it to suit our needs.

Read more:

Hope this helps!

About

This is an example usage of how to achieve scheduling post with Discord Bot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published