This is a heart of RainbowBOT. You can also build your own bots with this core!

Overview

RainbowBOT Core

RainbowBOT Core - is a Discord BOT core with rich functionality. This core takes over many routine things like data storing, interactions and commands management, modularity and so on. When you use RainbowBOT Core all you need to do is writing Modules and define them in RainbowBOT constructor. RainbowBOT Core uses Sequelize under the hood to store their and Modules' data. Tested on PostgreSQL and SQLite dialects, but must work on most supported dialects. You can find documentation here: https://rainbowbot.xyz/docs and more practical examples in https://github.com/Hatry1337/RainbowBOT-Core/tree/master/src/Modules/Core

Installation

npm install rainbowbot-core

Examples

This is the minimal Discord BOT built with RainbowBOT Core:

import Discord from "discord.js";
import { Module, RainbowBOT, CoreModules, ModuleUUIDPair } from "rainbowbot-core";
import MyModule from "./Modules/MyModule.ts"

const modules: ModuleUUIDPair[] = [
    { Module: CoreModules.Avatar,      UUID: "390cec87-b1db-52d9-8e55-de82530e380d"}, // All modules requires unique ids, 
    { Module: CoreModules.Config,      UUID: "ee285ab6-018a-5df2-8060-2504e14112b2"}, // so you can generate and read them
    { Module: CoreModules.Profile,     UUID: "37e0a335-4c46-541b-9afc-e6dd6dde1c95"}, // from external file, or just hardcore.
    { Module: CoreModules.RHelp,       UUID: "8209817a-753c-54e9-833b-bdff74fd9fa3"},
    { Module: MyModule,                UUID: "78dc809e-532c-58fa-aa8b-c14f7029f23a"}
]

const bot = new RainbowBOT({
    sequelizeURI: process.env.DBURI,                            // Sequelize initialization URI, see https://sequelize.org/master/manual/getting-started.html#connecting-to-a-database 
    masterGuildId: process.env.MASTER_GUILD,                    // BOT's master guild. Slash Commands will appear on this guild in development mode.
    moduleGlobalLoading: process.env.NODE_ENV === "production", // "Development mode", if you wanna publish your commands globally use true.
    clientOptions: {                                            // Standard Discord.js Client options, see https://discord.js.org/#/docs/discord.js/stable/typedef/ClientOptions
        intents: [
            Discord.Intents.FLAGS.DIRECT_MESSAGES,
            Discord.Intents.FLAGS.GUILDS,
            Discord.Intents.FLAGS.GUILD_MESSAGES,
            Discord.Intents.FLAGS.GUILD_MEMBERS,
        ],
        presence: {
            status: "online",
            activities: [
                {
                    type: "PLAYING",
                    name: "RainbowBOT Core",
                }
            ]
        }
    }
}, modules);

(async () => {
    await bot.login(process.env.TOKEN);
})();

This is the example of RainbowBOT Core Module:

import Discord from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
import { Colors, Module, ModuleManager, Utils }  from "rainbowbot-core";

export default class MyModule extends Module{
    public Name:        string = "MyModule";
    public Usage:       string = "`Usage of MyModule`";
    public Description: string = "Using this module you can do something.";
    public Category:    string = "Info";
    public Author:      string = "Thomasss#9258";

    constructor(Controller: ModuleManager, UUID: string) {
        super(Controller, UUID);
        this.SlashCommands.push(
            new SlashCommandBuilder()
                .setName("helloworld")
                .setDescription(this.Description)
                ) as SlashCommandBuilder
        );
    }
    
    public Test(interaction: Discord.CommandInteraction){
        return interaction.commandName.toLowerCase() === "helloworld";
    }

    public Run(interaction: Discord.CommandInteraction){
        return new Promise<Discord.Message | void>(async (resolve, reject) => {
            return resolve(await interaction.reply("Hello and Welcome to RainbowBOT Core!").catch(reject));
        });
    }
}
You might also like...

A template repository / quick start to build Azure Static Web Apps with a Node.js function. It uses Vue.js v3, Vue Router, Vuex, and Vite.js.

A template repository / quick start to build Azure Static Web Apps with a Node.js function. It uses Vue.js v3, Vue Router, Vuex, and Vite.js.

Azure Static Web App Template with Node.js API This is a template repository for creating Azure Static Web Apps that comes pre-configured with: Vue.js

Jun 25, 2022

Replace files during Vite build - handy when replacing strings is not enough

vite-plugin-replace-files Replace files during Vite build - handy when replacing strings is not enough. Install Install with your favorite package man

Sep 21, 2022

NativeScript empowers you to access native api's from JavaScript directly. Angular, Vue, Svelte, React and you name it compatible.

NativeScript empowers you to access native api's from JavaScript directly. Angular, Vue, Svelte, React and you name it compatible.

NativeScript empowers you to access native APIs from JavaScript directly. The framework currently provides iOS and Android runtimes for rich mobile de

Jan 4, 2023

OSI helps you to track your all open-source Internships and Program in a single place โšก

OSI helps you to track your all open-source  Internships and Program in a single place โšก

Open Source Internships Overview ๐Ÿ‘€ Dark Theme Light Theme Run locally ๐Ÿ›  Fork this repo. open-source-internships ๐Ÿš€ Clone the repo. โฌ git clone https

Jan 2, 2023

Based on vitawind, kowind brings ESLint plugin and some other plugins to it that help you to format your code quickly and efficiently.

๐Ÿฆ KOWIND v3 ๐Ÿฆ Vite helper based on vitawind ๐Ÿงฐ Easy To Install โšก๏ธ Automatically open Tailwind JIT Mode โš™ One-Command Setting ๐Ÿš€ Automatically config

Nov 26, 2022

:fire::fire::fire: ๅผบๅคง็š„ๅŠจๆ€่กจๅ•็”Ÿๆˆๅ™จ|form-create is a form generation component that can generate dynamic rendering, data collection, verification and submission functions through JSON.

:fire::fire::fire: ๅผบๅคง็š„ๅŠจๆ€่กจๅ•็”Ÿๆˆๅ™จ|form-create is a form generation component that can generate dynamic rendering, data collection, verification and submission functions through JSON.

form-create form-create is a form generation component that can generate dynamic rendering, data collection, verification and submission functions thr

Jan 3, 2023

Easily connect your Nuxt3 application to your directus server. ๐Ÿฐ

Easily connect your Nuxt3 application to your directus server. ๐Ÿฐ

nuxt-directus Directus Module for Nuxt 3 โœจ Release Notes ๐Ÿ“– Read the documentation Features Nuxt3 ready Handle authentication RESTful methods TypeScri

Dec 28, 2022

Everything you wish the HTML select element could do, wrapped up into a lightweight, extensible Vue component.

vue-select Everything you wish the HTML select element could do, wrapped up into a lightweight, zero dependency, extensible Vue component. Vue Selec

Jan 2, 2023

Mosha-vue-toastify - A light weight and fun Vue 3 toast or notification or snack bar or however you wanna call it library.

Mosha-vue-toastify - A light weight and fun Vue 3 toast or notification or snack bar or however you wanna call it library.

Mosha Vue Toastify A lightweight and fun Vue 3 toast or notification or snack bar or however you wanna call it library. English | ็ฎ€ไฝ“ไธญๆ–‡ Talk is cheap,

Jan 2, 2023
Releases(3.9.1-beta)
Owner
Thomas Sidereal
Thomas Sidereal
:necktie: :briefcase: Build fast :rocket: and easy multiple beautiful resumes and create your best CV ever! Made with Vue and LESS.

best-resume-ever ?? ?? Build fast ?? and easy multiple beautiful resumes and create your best CV ever! Made with Vue and LESS. Cool Creative Green Pur

Sara Steiert 15.8k Jan 9, 2023
Help you solve the Wordle puzzles when your vocabulary failes you.

Wordle Helper Help you solve Wordle puzzles when your vocabulary failes you. Have fun with it here: wordle.zxh.io How to use First, start a Wordle puz

Xiaohan Zou 5 Jun 20, 2022
A plugin that can help you create project friendly with Vue for @vue/cli 4.5

vue-cli-plugin-patch A plugin that can help you create project friendly with Vue for @vue/cli 4.5. Install First you need to install @vue/cli globally

null 2 Jan 6, 2022
Quasar Framework - Build high-performance VueJS user interfaces in record time

Quasar Framework Build high-performance VueJS user interfaces in record time: responsive Single Page Apps, SSR Apps, PWAs, Browser extensions, Hybrid

Quasar Framework 22.7k Jan 9, 2023
Vue Native is a framework to build cross platform native mobile apps using JavaScript

Vue Native Visit our website at vue-native.io or read the official documentation here. Build native mobile apps using Vue Vue Native is a framework to

GeekyAnts 8.4k Jan 6, 2023
โšก๏ธ The easiest way to build forms with Vue.

Documentation Website What is Vue Formulate? Vue Formulate is the easiest way to build forms with Vue. Please read the comprehensive documentation for

Braid 2.2k Dec 30, 2022
:bento: Full-Stack solution to quickly build PWA applications with Vue.js and Firebase

Welcome to bento-starter ?? ?? bento-starter is an Open-Source Full-Stack solution that helps you to build fast and maintainable web applications usin

Franck Abgrall 1.5k Dec 24, 2022
Build performant, native and cross-platform desktop applications with native Vue + powerful CSS like styling.๐Ÿš€

Vue NodeGui Build performant, native and cross-platform desktop applications with Vue. ?? Vue NodeGUI is powered by Vue ?? and Qt5 ?? which makes it C

NodeGui 765 Dec 30, 2022
Integrate Tauri in a Vite project to build cross-platform apps.

vite-plugin-tauri Integrate Tauri in a Vite project to build cross-platform apps Install Make sure to setup your environment for Tauri development. Th

Amr Bashir 95 Dec 15, 2022