lgcord.js is a simple library for interacting with the Discord API. It is written in TypeScript and is designed to be easy to use and easy to understand.
npm install lgcord.js
const { Client, INTENTS } = require("lgcord.js");
const client = new Client([
INTENTS.GUILDS,
INTENTS.GUILD_MESSAGES,
INTENTS.GUILD_MESSAGE_REACTIONS,
]);
client.on("ready", (ready) => {
console.log(`Logged in as ${ready.user.username}`);
});
client.login("bot token");
- messageCreate reply to a message or get info a message sent/receieved by the bot
- messageDelete get info of a message when deleted
- messageUpdate get info of a message if it gets updated/edited
MORE EVENTS DOCS WILL BE ADDED
- Embed Example
const { DiscordEmbed } = require("lgcord.js");
let embed = new DiscordEmbed()
.setTitle("Hello World")
.setColor("Color")
.setDescription("Bot using lgcord.js")
.setFooter("Footer")
.setTimestamp();
message.reply({
embeds: [embed],
});
- Button Example
const {
DiscordMessageActionRow,
DiscordMessageButton,
DiscordButtonStyle,
} = require("lgcord.js");
let row = new DiscordMessageActionRow().addComponents(
new DiscordMessageButton()
.setStyle(DiscordButtonStyle.PRIMARY)
.setLabel("LGCordjs")
.setCustomId("dksdk")
);
message.reply({
components: [row],
});