0.0.3 • Published 3 years ago

flitzzdev-v12 v0.0.3

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

Setup

To install the package:

  • Type npm i flitzzdev@latest in the terminal to install the latest version of the package

Table of Contents

Functions:

Events:

  • Chatbot - A simple chatbot to set up!

Functions:

Capitalize

const { Capitalize } = require('flitzzdev') // Import my package

module.exports = {
    name: 'capitalize',
    description: 'Capitalize the first letter of the text',
    run: async(client, message, args) => { // Change To Your Own Handler
        const text = `hey, How Are You?`
        if(!text) return message.reply('Provide Text') // Return a message if there is no text

        const capitaled = await Capitalize({
            Capital: text
        });
        message.channel.send(capitaled);
    }
}

passwordGen

Generates a simple password

Example:

// Define the package
const  Flitz = require('flitzzdev')

// Fetching the function
const passGen = Flitz.passGen

module.exports = { // Change To Your Own Handler
    name: 'passwordgen',
    description: 'Capitalize the first letter of the text',
    run: async(client, message, args) => { // Change To Your Own Handler

message.channel.send(passwordGen(6)) // The numbers into the () of the passGen function will be the length
    }
}

passwordGen(Number of length)

Bin

Bin some code with this function

Example:

// Defining the package...
const  Flitz = require('flitzzdev')
module.exports = { // Change To Your Own Handler
    name: 'bin',
    description: 'Bin some text',
    run: async(client, message, args) => { // Change To Your Own Handler
// if there are is args, it will return a message
if (!args.join(' ')) return message.channel.send('What do you want to bin?');

// args.join(' ') is all of the message content in my handler
const bin = await Flitz.bin(args.join(' '));

// The binned code link will be send in the channel
message.channel.send('The binned code!' + bin)
}
}

Random Number

const { randomName } = require('flitzzdev') // Importing....

module.exports = { // Change To Your Handler
    name: 'number',
    description: 'Get Random Number',
    run: async(client, message, args) => { // Change To Your Handler

        const number = await randomNumber({
            Minimum: 5, // The Minimum Number
            Maximum: 45, // The Maximum Number
        }) // Will Show OutPut From 5(Minimum) To 50(Minimum+Maximum)
        message.channel.send(number) // OutPut: 5, 49, 50, 17, 29
    }
}

Reaction Pages

Reaction Paginator function to create pages Example:

// Defining the package
const { MessageEmbed } = require("discord.js")
const flitz = require("flitzzdev")
module.exports = { // Change To Your Handler
    name: 'reaction-pages',
    description: 'Show some pages',
    run: async(client, message, args) => { // Change To Your Handler

        var page1 = new MessageEmbed()
            .setTitle(client.user.username)
            .setColor('RED')
            .setDescription('This is page 1')
        
        var page2 = new MessageEmbed()
            .setTitle(client.user.username)
            .setColor('GREEN')
            .setDescription('This is page 2')

        const pages = [page1, page2]
        flitz.reactionPages(client, message, pages)
    }
}
 

Snake Game

Play an easy snake game! Example:

// Defining the package
const flitz = require('flitzzdev')
module.exports = {
name: 'snake',
run: async(client, message, args) => {

  flitz.startSnake(client, message, message.channel)
}
}

Events:

ChatBot

Using Message Event

PreView

const { chatBot } = require('flitzzdev') // Importing Package

client.on('message', async message => {
    if(message.channel.id === '881930435779756093') { // Channel ID
    if(message.author.bot) return // If author is a bot it will return the code
    if(message.channel.type === 'dm') return // If the type of the channel is dm it will return
    if(message.attachments.size > 0) return message.reply('It\'s impossible for me to read images') // Images are not allowed
    else {
        const reply = await chatBot({ Message: message }); // Fetches the message of the user
        return message.channel.send(`${message.author}, ${reply}`); // Reply to a user
        }
    }
})

Send me a dm on discord: Flitz#2708 to send idea's or bugs!