resthaven
v0.0.3
Published
A module with many facilititors that you can use in your Discord.js bot 🥳
Downloads
29
Maintainers
Readme
🚀 Updates
- ResponsiveEmbed class added.
- Subcommand feature has been added to option function.
- Utilize function added.
- Turkish support has been added to ms function.
- Bug fix.
🏅 Usage examples.
const {
ProLogs, ProEmbed, ProWeb, SpesteDB, ResponsiveEmbed,
Option, OptionType, EmbedStyle
} = require("resthaven");
const logger = new ProLogs();
const web = new ProWeb();
const db = new SpesteDB({ path: "./src/your-database-path.json" });
logger.success("User game success worked.");
logger.info("User joined the game.");
db.set("user", { money: 300, inventory: ["Box"] }); // "user": { money: 300, inventory: ["Box"] }
const moneydata = db.get("user").money; // 300
web.get(`https://example.com`) // Response
const data = { userMoney: db.get("user").money } // { userMoney: 300 }
web.post(`https://example.com/api/newJoinUser`, JSON.stringify(data), "Content-Type": "application/json") // Response
const option = Option("inventory-item", "Please select an inventory item", OptionType.String, choices: [{ name: "Box", value: "box" },{ name: "Sword", value: "sword" } ])
console.log(responsiveEmbed.getDevice(interaction.member))
responsiveEmbed.applyProcess(
interaction.member,
() => { interaction.reply({ embeds: [desktopEmbed.getEmbed()] }) }, // For Desktop
() => { interaction.reply({ embeds: [mobileEmbed.getEmbed()] })}, // For Mobile
() => { interaction.reply({ embeds: [webEmbed.getEmbed()] }) }, // For Web
(devices) => { cinteraction.reply({ embeds: [multiDevices.getEmbed()] }) } // For multiple devices, for example: desktop, web
);
const embed = new ProEmbed()
.setInteraction(interaction) // Your interaction.
.setTitle("User Info") // Optional
.setDescription(`Money: ${moneydata}`) // Required
.setThumbail("https://example.com/thumbailUrl") // Optional
.setImage("https://example.com/ImageUrl") // Optional
.setStatus(EmbedStyle.Default); // Required
interaction.reply({ embeds: [embed.getEmbed()] }) // Reply
🕷️ I found a bug!
📱 You need contact me from discord.