-
Notifications
You must be signed in to change notification settings - Fork 3
Home
-
Node.js: v18.0.0 or higher
-
MongoDB Atlas Account (free)
-
npm: v6.0.0 or higher
-
pm2: Optional but recommended. (JS manager)
-
Clone the repository:
git clone https://github.com/Rodaviva29/StripeCord.git
-
Install all dependencies:
npm install
. -
Change the file
.env.example
to.env
. -
Configure the necessary environment variables in
.env
. -
Start the application:
npm start
or check 6. -
If you are using pm2 as JS manager, you can use
pm2 start index.js --name name_of_your_choice
instead.
Some important commands to be ready to go with pm2: pm2 logs/list/start/stop/restart <name_of_your_choice>.
Also you can simple install pm2 with the command: npm install pm2 -g
.
It's critical that you add Privileged Gateway Intents in https://discord.com/developers/applications/. To add to your server: https://discordapi.com/permissions.html#1095216660479
When you create a new bot in discord developers it comes with public bot per default, I advise you to disable that.
- StripeCord storage 3 types of information in MongoDB (Atlas or not).
- E-mail, Discord User ID, or hadActiveSubscription (boolean).
- You can create a free cluster with Database name you choose in DATABASE_NAME in
.env
- You will also need to create a Collection from a name you choose in DATABASE_COLLECTION_NAME in
.env
- It's needed a Mongo DB Connection URL you can create a profile for that URL from
Database Access
tab. - It's also recommended to limit Network Access for certain IPs (your server machine) in
Network Access
tab.
- Firstly you should get a Stripe API Key from "Developers" Tab.
- You can generate a Stripe Restricted Key with the needed permissions (e.g view only)
- You probably need to change Stripe API version (default one is from 2019), go to latest.
- As said, you need to change the default enviroment file to .env (default is .env.example)
SUBSCRIPTION_NAME
: Your Subscription Name to use in some Messages of the Bot.
DISCORD_CLIENT_TOKEN:
Your Discord Bot's token Check here where to get it.
DATABASE_URL:
Your Mongo DB URL (something like this: mongodb+srv://user:[email protected]).
DABASE_NAME
: Your database name.
DATABASE_COLLECTION_NAME
: Your sub category database name, known as collection name.
CHECK_HOURS
: Time in hours that the function check should be activated.
COMMAND_NAME_STATUS
: Name of the administration verification command user status should be called.
COMMAND_NAME_LINK
: Name of the user link/email command should be called.
COMMAND_NAME_ADMIN_LINK
: Name of the admin force link/email command should be called.
STRIPE_API_KEY
: API Key from Stripe.
STRIPE_PAYMENT_LINK
: Payment Link that users should use to get a subscription.
STRIPE_PORTAL_LINK
: Portal/User Dashboard Link that users should use to go to the configuration portal of the subscriptions.
PAYING_ROLE_ID
: Role id that should be given to the user that has an active subscription.
GUILD_ID
: Guild id that the bot should work.
CLIENT_ID
: Discord bot id. (id of the bot itself)
LOGS_CHANNEL_ID
: Channel Id in the guild id provided for the bot sends logs (sucessfull e-mail links and cancelled subscriptions).