Poppy
Poppy9mo ago

Is it possible to Use Discord Api in BuildShip?

Hello is it possible for that to work?
2 Replies
Shams
Shams9mo ago
Hi @Poppy, it might be possible the main problem is discordjs expects a server to be listening at all times to monitor events and respond https://discordjs.guide/creating-your-bot/main-file.html#running-your-application while buildship requires an event to be sent throught an api call to be processed one solution can be to setup a very small vm (f1-micro) https://cloud.google.com/products/calculator?hl=en&dl=CiRhMjE2MTY1NC1mMjI3LTRkN2ItOWM2Zi02MTcxZWJiNGQ3NDIQCBokN0I5MDUwNjktOUVFMC00NkFELTk4NkYtRDJBRDRGNjEyNTI4 (~$3.88/month) to listen to differnet bot event and make requests buildship then respond example code to run on the server
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
const buildshipResponse = await fetch(`[BUILDSHIP_REST_URL]`,{method:"POST",body:JSON.stringify(interaction)});
const responseText = await buildshipResponse.text()
await interaction.reply(responseText);
},
};
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction) {
const buildshipResponse = await fetch(`[BUILDSHIP_REST_URL]`,{method:"POST",body:JSON.stringify(interaction)});
const responseText = await buildshipResponse.text()
await interaction.reply(responseText);
},
};
i havn't tested this out but if you want to try it out I'm happy to help out
Google Cloud Pricing Calculator
Create your own Custom Price Quote for the products offered through Google Cloud based on number, usage, and power of servers
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Shams
Shams9mo ago
ArcticTutorial
YouTube
How to host your Discord.js bot using Google Cloud for FREE! (2021)
In this video, I will teach you how to host your Discord.js Bot for free using Google Cloud instead of using Heroku (An alternate option) 30 days of free royal music by going to: http://bit.ly/rlb-es (Supports Ryan Lennox-Bradley) https://www.youtube.com/channel/UCgBLR9zlrdkfhJ-ST6pZxgA (If you have any question, comment down below and I'll tr...