Git Product home page Git Product logo

stripe-discord-bot's Introduction

Stripe Discord Bot

This Stripe Discord bot is useful to put a Discord server behind a paywall. It makes direct requests to Stripe, meaning there is no other fees (like when using Donatebot.io) to manage roles. Users have to provide their email using /email and they get instant access. There is a daily check to make sure their subscriptions are still active.

Installation

You can install and host this bot on your own server. Here are the main steps:

  • Download and install Node.js v16 or higher.
  • Download and install PostgreSQL v13 or higher.
  • Create a new database and a new role that has access to the database.
  • Install the dependencies of the project by running yarn install.
  • Run yarn build to get the JavaScript output of the project.
  • Install PM2 or another process manager to keep your bot alive, or run yarn start.
  • You are done!

Bugs or questions

If you have any issue or bug with this bot, you can contact me using Discord, Androz#2091 or @androz2091.

Configuration

All configuration for this template can be made in the .env file found in the root directory. Below will be details about each setting.

DISCORD_CLIENT_TOKEN: Your Discord Bot's token which you can find Here.

DB_NAME: The name of the PostgreSQL database you created.
DB_USERNAME: The username of the role with read and write access to the database.
DB_PASSWORD: The password of the role.

EMBED_COLOR: The color which you would like your embed's side bar to be. (BLUE, #FF0000, Ect.)

COMMAND_PREFIX: The prefix before the command name to execute that command.

GUILD_ID: This is optional. In the case that your bot runs on a private server, it should be the ID of the server. Otherwise, leave empty (if this field is filled, it will be faster to create Slash Commands).

ENVIRONMENT: Can be ENVIRONMENT or PRODUCTION. Defines whether some scripts or things should be run or not. For example, the database schemas will not be modified in production, even to synchronize them, because we may loose data.

STRIPE_API_KEY: Your Stripe account API Key.

EMAIL_COMMAND_CHANNEL_ID: The ID of the channel in which members will enter their Stripe email.

PAYING_ROLE_ID/LIFETIME_PAYING_ROLE_ID: The ID of the role members will get of they pay.

LIFETIME_INVOICE_LABEL_KEYWORD: The keyword that will be used to detect a lifetime invoice (searching for this keyword in the label).

STRIPE_PAYMENT_LINK: The link for the users to buy a new subscription.

LOGS_CHANNEL_ID: The ID of the channel used as admin logs.

SUBSCRIPTION_NAME: The display name of the subscription you are selling. Ex: Super Premium

stripe-discord-bot's People

Contributors

androz2091 avatar

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.