Giter VIP home page Giter VIP logo

discord-birthday-role-bot's Introduction

Discord Birthday Role Bot

Discord Twitter Follow

A Discord bot that assigns members a birthday role based on their account creation date and server join date.

Setup

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

    Don't forget to give your bot the Manage Roles permission!

  2. Download this bot and move the src-discord-birthday-role-bot folder into the /src/bots folder from step 1.

    Run npm i cron@^1.8.2 and npm i -D @types/cron@^1.7.3 to install this bot's dependencies.

  3. Open config.json to configure your own settings:

    [
      {
        "guildId": "258167954913361930",
        "accountBirthdayRoleId": "606324811068735489",
        "serverBirthdayRoleId": "606262166672113675",
        "daysToLookBack": 1,
        "daysToLookForward": 1,
        "timezone": "America/Los_Angeles",
        "cronExpression": "0 0 20 * * *"
      }
    ]

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

    • guildId is the server id.
    • accountBirthdayRoleId is the role id assigned to users with an account birthday.
    • serverBirthdayRoleId is the role id assigned to members with a server birthday.
    • Birthday roles are assigned if the birthday falls between the date range created by daysToLookBack and daysToLookForward using the current date (excludes "0th" birthdays for users that join the same day).
    • timezone is the timezone you wish to localize your cronExpression to.
    • cronExpression is the interval at which the birthday checks are done.

    Some useful tools:

    • Moment Timezone: find your timezone string.
    • crontab guru: build your cronExpression. Note that the tool does not support seconds but this bot configuration does.
  4. npm start to run the bot.

Visit for more help or information!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.