Skip to content

Discord bot that verifies a purchase from PayPal and assigns roles.

License

Notifications You must be signed in to change notification settings

EndlessGames/VerifyPurchaseDiscordBot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VerifyPurchaseDiscordBot

Discord bot that searches your PayPal transactions (via user email) and assigns a role if the purchase has been verified.

This bot supports SpigotMC and MCMarket

ScreenShot

Some pics of the Discord bot

Steps for getting started:

  • install the libraries in requirements.txt
    • python -m pip install -r requirements.txt

Guide to filling out the .env file:

DISCORD_TOKEN=Ojzk1MTM2Mc0NjYTATQy2Mkz.gfqYfq99A.JScoVbGD1Lo0HDbonDuvYjJPtPy
  • Create a new discord application and put the token value here, click here
  • Make sure to set the Oauth2 scope to: [bot, applications.commands]
GUILD_ID="897460772427382670"
  • Put here the guild id (discord server id) you want to use the bot on
  • If you don't know your discord server id, click here
ADMIN_ID_LIST="143651103467110401 290472907317051392"
  • Put here any admin role ids (discord role ids) that you want the bot to private message (seperated by spaces within the string)
  • If you don't know a discord user id, click here
ADMIN_ROLE_ID="945380919903150090"
  • Put here the admin role id (discord role id) that you want to allow to write in the verification channel, otherwise the bot will delete the messages
  • If you don't know the discord role id click here
REPORT_CHANNEL_ID="945380919903150090"
  • Put here the channel id (discord channel id) where the bot will send a message with the success of the verification every time someone will use the verification command
  • If you don't know the discord channel id click here
VERIFY_CHANNEL_ID="945380919903150090"
  • Put here the channel id (discord channel id) where users can only use the verification command
  • Make sure that users can write within that channel
  • If you don't know the discord channel id click here
PAYPAL_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PAYPAL_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • Create a PayPal API application in a 'Live' environment click here
  • Make sure to grant the application access to 'Transaction Search'
RESOURCE_LIST="PluginName1:846789230670774275,846789230670774276;PluginName2:RoleId1,RoleId2"
  • Put your Spigot or McMarket resource name here followed by the Discord roles (comma-separated) you want to assign to a user once they have verified a purchase for that plugin name. (These roles must already exist on your server)
  • Put as many of these as you have separated by semicolon within the string like in the example above

Now just run the bot wherever you are going to host it (and make sure it has a sufficient role to assign roles to users):

py -3 main.py

Donate
If this bot is helpful to you, please consider donating.

About

Discord bot that verifies a purchase from PayPal and assigns roles.

Resources

License

Stars

Watchers

Forks

Languages

  • Python 96.4%
  • Shell 2.7%
  • Dockerfile 0.9%