davipatricio / helly

🛰️ [WIP] A simple, typed, performance-focused Discord API Wrapper.

Home Page:https://helly.denkylabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Helly

A Node.js wrapper for interfacing with Discord.


helly


⚠️ This library is not ready for production use.


Installation

Node.js 16.9.0 or newer is required.

Stable version

npm install helly
yarn add helly
pnpm add helly
Development version
npm install helly@dev
yarn add helly@dev
pnpm add helly@dev

Optional packages

  • bufferutil for a much faster WebSocket connection (npm install bufferutil)

  • utf-8-validate in combination with bufferutil for much faster WebSocket processing (npm install utf-8-validate)

Ping Pong Example

const { Client, Events, GatewayIntentBits } = require('helly');

const client = new Client({
    intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]
});

// Code inside here will run when the bot connects to the Discord API
client.on(Events.Ready /* you can also use 'Ready', but using enums are recommended */, () => {
    console.log("Ready!"); // Log "Ready!"
});


// Code inside here will run when someone sends a message in a channel
client.on(Events.MessageCreate /* you can also use 'MessageCreate', but using enums are recommended */, (message) => {
  if (message.content === '!ping') return message.reply(`🏓 ${client.ping}ms...`)
  if (message.content === 'Hi') return message.reply(`Hello, ${message.author}! How are you?`)
})

// Replace TOKEN with your bot account's token
client.login('TOKEN')

Useful Links

About

🛰️ [WIP] A simple, typed, performance-focused Discord API Wrapper.

https://helly.denkylabs.com

License:Apache License 2.0


Languages

Language:TypeScript 97.6%Language:JavaScript 2.4%