Skip to content

Joy6000/Stops-Prefab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of contents

Installation

npm install stops-djs-prefab

Usage

Index

const Discord = require('discord.js')
const client = new Discord.Client()
const botPrefab = require('stops-djs-prefab')

new botPrefab(client, {
    commandsDir: 'commands' // Commands Directory
    eventsDir: 'events'
})
.setToken('super secret token') // logs your bot in (EXPERIMENTAL!)
.setPrefix('>') // sets prefix
.setMongoURI('MONGOURI') // Must have a mongo server up and running!
.showWarnings(false) // If set to false warnings will not show. Set to true by default.
.showLoadedCommands(false) // If set to false it will not log all commands that were successfully loaded. Set to true by default.
.showLoadedEvents(false) // If set to false it will not log all events that were successfully loaded. Set to true by default.
.setOwners(['123456789123456789']) // Sets bot owners for owneronly commands.

Making a command

Command File in Commands Directory:

module.exports = {
    name: 'ping',
    aliases: 'p',
    execute({ message, args, client }) {
        message.reply('Pong!!')
    }
}

Making an event

Event File in Events Directory called (message.js):

module.exports = (client, handler, message) => {
    console.log('Successfully cached message!')
    message.channel.send('Hello!') // I DO NOT RECOMMEND DOING THIS. IT WILL LEAD TO RATE LIMITS (if there is a very active chat) AND/OR CONFUSION IN ALL PARTIES.
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published