Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

abstractFlo/adonis-discordjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adonis-Discordjs

Discordjs is a powerfull javascript library to create Discord bots without pain.

It provide a simple, clean and readable syntax.

This package is a wrapper between adonisjs 4.x and discordjs. All functions from discordjs included and available.

Installation

In your adonisjs 4.x installation type adonis install adonis-discordjs to install the package. After installation there is a bot-plugins.js file on your root folder. This file is the plugin config for all bot plugins. Add following to your start/app.js

const providers = [
  ....
  'adonis-discordjs/providers/Bot'
]

Add .env variables

Please add following variables to your .env file

BOT_TOKEN=YOUR_BOT_TOKEN
BOT_MESSAGE_PREFIX=! // You can set your own prefix, default is !

Start the bot

Start the bot is easy as possible. Add this to the end of your server.js File use('DiscordBot/StartBot')

Than you can start the adonis server with adonis serve —dev or in production node server.js

Thats all, your bot is logged in with token to your server. All errors logged to console from server

Add your code

In the root of your project, there is a file named bot-plugins.js. The contents of this file are as follows:

'use strict'

module.exports = ['Example/Help', 'Example/Prune']

Simply add the path to your logic file to the array and you're good to go.

For example:

'use strict'

module.exports = ['Example/Help', 'Example/Prune', 'app/Services/YOURBOTLOGIC.js']

Thanks

My biggest thanks goes to https://github.com/Devcord/cordlr-cli

My package is only a wrapper between cordlr-cli and adonisjs 4 without the cli part from cordlr. It's a custom implementation with the power of serviceprovider from adonisjs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published