Skip to content

Latest commit

 

History

History
95 lines (71 loc) · 2.67 KB

Readme.md

File metadata and controls

95 lines (71 loc) · 2.67 KB

Built with Love Made with Javascript

NPM version NPM downloads Patreon

npm installnfo

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.

Installation

npm install lgcord.js

Example

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");

Events Available:

  • 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

Examples :

  • 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],
});

Support me!!

ko-fi