| title | Webhook Integration Overview | |
|---|---|---|
| authors |
|
Welcome! This guide will walk you through installing, configuring, and running the Integrations Bot for the first time.
- Node.js (v18 or newer) installed
- npm (comes with Node.js)
- (Optional) SQLite for database inspection
Clone the repository or download the latest release:
git clone https://github.com/yourusername/integrations-bot.git
cd integrations-botOr unzip the archive and open the folder in your code editor.
You can run the bot on your own hardware (self-hosted) or a paid VPS/cloud server. See below for tips:
| Feature | Self-Hosted | Paid VPS (Cloud Host) |
|---|---|---|
| Cost | Free (uses your hardware) | Monthly fee (varies) |
| Uptime | Depends on your device | 24/7, high reliability |
| Public Accessibility | Requires port forwarding | Public IP by default |
| Maintenance | You manage everything | Host manages hardware |
| Best For | Hobbyists, testing | Production, always-on bots |
npm install- Copy the template config and env files:
cp src/config/template.config.json src/config/config.json cp src/config/.env.template src/config/.env
- Open
src/config/config.jsonand fill in:- Channel IDs for sales, refunds, subscriptions (under
discordConfig) - Webhook config (under
webhookConfig) - Any other required fields (see comments in the template)
- Channel IDs for sales, refunds, subscriptions (under
- Save the file.
- Open
src/config/.envand fill in:- BOT_TOKEN (from Discord Developer Portal)
- CLIENT_ID (from Discord Developer Portal)
- Save the file.
To receive Payhip webhooks reliably, your bot must be accessible from the internet. This usually means setting up a public domain name and DNS.
Free Domain:
- Use DigitalPlat to register a free domain.
DNS Hosting:
- Use Cloudflare to manage your DNS for free, add SSL, and protect your site.
Steps:
- Register a free domain at DigitalPlat.
- Add your domain to Cloudflare and update your nameservers as instructed.
- Create an A record pointing to your server’s public IP address.
- (Optional) Enable SSL in Cloudflare for secure HTTPS access.
- The bot will create the SQLite database and tables automatically on first run.
- No manual setup is required unless you want to inspect or modify the schema (see
src/data/schema/).
node src/bot/Handler.jsor, if you have a start script:
npm startOr use a process manager like PM2 for production:
npm install -g pm2
pm2 start src/bot/Handler.js --name payhip-botYou should see a message indicating the bot is online.
- Go to the Discord Developer Portal and select your application.
- Under "OAuth2 > URL Generator", select
botandapplications.commandsscopes. - Set permissions (at minimum:
Send Messages,Embed Links,Manage Webhooks). - Copy the generated URL and open it in your browser to invite the bot to your server.
- Go to Payhip Dashboard > Account > Settings > Developer.
- Enter your public webhook URL (e.g.,
https://yourdomain.com/webhook/payhip). - Select the events you want to receive.
- Use
/pingor/testin your Discord server to verify the bot is responding. - Check the console for any errors or status messages.
- Bot not appearing online?
- Double-check your bot token in
.envand config file. - Make sure you have internet access and the correct Node.js version.
- Double-check your bot token in
- Commands not working?
- Ensure the bot has the right permissions in your server.
- Try re-inviting the bot with the correct scopes.
- Webhooks not received?
- Make sure your domain is set up correctly and your server is accessible from the internet.
- Check firewall or port issues if self-hosting.
- Discord errors?
- Double-check your bot token and channel IDs in the config.
- For more help, see the documentation or open an issue on GitHub.
Need help? Join our Discord support server.