Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/totigm/discord-bot

This is a library to create Discord bots. It handles all the commands stuff behind the scenes, so you can focus on your bot's logic.
https://github.com/totigm/discord-bot

bot bot-builder botbuilder bots discord discord-bot discord-js typescript

Last synced: 3 months ago
JSON representation

This is a library to create Discord bots. It handles all the commands stuff behind the scenes, so you can focus on your bot's logic.

Awesome Lists containing this project

README

        

Welcome to @totigm/discord-bot 👋



NPM version


GitHub repo


Downloads


CI


GitHub repo stars


Documentation


License: MIT

## 📄 Introduction

This is a library to create Discord bots. It is a Discord implementation of the [@totigm/bot-builder](https://www.npmjs.com/package/@totigm/bot-builder) package, which handles all the commands stuff behind the scenes, so you can focus on your bot's logic.

> The [discord.js v12](https://v12.discordjs.guide) library is being used.

## 🔗 Quick links

- [Reference documentation](./docs/reference.md)
- [Options](#⚙️-options)
- [Set up a discord bot](https://v12.discordjs.guide/preparations/setting-up-a-bot-application.html)
- [Discord.js v12 docs](https://v12.discordjs.guide)
- [Bot builder](https://www.npmjs.com/package/@totigm/bot-builder)
- [WhatsApp bot](https://www.npmjs.com/package/@totigm/whatsapp-bot)
- [GitHub](https://github.com/totigm/discord-bot#readme)
- [NPM](https://www.npmjs.com/package/@totigm/discord-bot)

## 💻 Installation

```sh
npm i @totigm/discord-bot
```

or

```sh
yarn add @totigm/discord-bot
```

## 🚀 Getting started

Check [this tutorial](https://v12.discordjs.guide/preparations/setting-up-a-bot-application.html) on how to create a discord bot.

Start adding commands to your bot by checking the [reference documentation](./docs/reference.md).

## 🤖 Example usage

```ts
import DiscordBot from "@totigm/discord-bot";

const bot = new DiscordBot("YOUR_DISCORD_BOT_TOKEN");

bot.addCommand("hey", (message) => `Hey ${message.author.username}! How are you doing?`, {
description: "Say hey",
explanation: "The bot will say hey to the user using their Discord's name",
example: {
output: "Hey Toti! How are you doing?",
},
});
```

The previous code will create a bot that works like this:

![bot conversation](https://user-images.githubusercontent.com/64804554/185551989-2beacc0e-8026-47fa-8f12-2820ef412a86.png)

## ⚙️ Options

When you create a bot, you can pass an options object to customize it. Check its [options](./docs/options.md) documentation for more information.

```ts
const options = { ... };

const bot = new DiscordBot("YOUR_BOTS_TOKEN", options);
```

## 👤 Author


GitHub: totigm




Twitter: totigm8




LinkedIn: totigm




NPM: totigm

## 🤝 Contributing

Contributions are more than welcome!

We think that you might have great ideas to make this project even better. If you do, please create a pull request and/or issue following the [contribution guidelines](./docs/CONTRIBUTING.md).

## ⭐️ Show your support

Give a ⭐️ if this project helped you!

## 📝 License

Copyright © 2022 [Toti Muñoz](https://github.com/totigm).

This project is [MIT](https://github.com/totigm/discord-bot/blob/master/LICENSE) licensed.

---

This project was made with ❤ and TypeScript