gogecord
v1.2.0
Published
A lightweight library for interacting with the [Discord API](https://discord.com/developers/docs/intro). Written in TypeScript and compiled to JavaScript, this library provides developers with the necessary tools to create powerful Discord bots quickly an
Downloads
12
Maintainers
Readme
Gogecord
A lightweight library for interacting with the Discord API. Written in TypeScript and compiled to JavaScript, this library provides developers with the necessary tools to create powerful Discord bots quickly and easily.
Features
- TypeScript Support: Fully typed library with TypeScript for better development experience and safety.
- JavaScript Compatibility: The library is compiled to JavaScript, making it easy to use in both TypeScript and JavaScript projects.
- Bot Development: Ideal for building custom bots that interact with Discord servers efficiently.
Installation
You can install Gogecord via npm:
npm install gogecord
Usage
Example for TypeScript
import { Client } from 'gogecord';
const client = new Client({
intents: ['GuildBans', 'GuildMembers', 'GuildMessages', 'GuildPresences', 'Guilds', 'MessageContent'],
token: 'app_token'
});
client.on('ready', (client) => {
console.log('Logged in as', client.user.username);
});
client.on('messageCreate', (client, message) => {
if (message.content == 'hi') message.reply({ content: 'hi!' });
if (message.content == 'bye') message.reply({ content: 'bye!' });
});
Example for JavaScript
const { Client } = require('gogecord');
const client = new Client({
intents: ['GuildBans', 'GuildMembers', 'GuildMessages', 'GuildPresences', 'Guilds', 'MessageContent'],
token: 'app_token'
});
client.on('ready', (client) => {
console.log('Logged in as', client.user.username);
});
client.on('messageCreate', (client, message) => {
if (message.content == 'hi') message.reply({ content: 'hi!' });
if (message.content == 'bye') message.reply({ content: 'bye!' });
});