0.0.4 • Published 3 years ago
flitzzdev-v13 v0.0.4
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:
Capitalize()
- Capitalize the first letter of a stringpasswordGen()
- Function to create passwords made by letters and numbers randomly with specified length.bin()
- Function that allows you to bin codes.randomNumber()
- Create a random numberPages()
- Create some pagesreactionPages()
- Create some pagesstartSnake()
- Play an snake game
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 {passwordGen} = require('flitzzdev')
// Fetching the function
module.exports = { // Change To Your Own Handler
name: 'passwordgen',
description: 'Create a random password',
run: async(client, message, args) => { // Change To Your Own Handler
message.channel.send(passwordGen({Length: 6})) // The numbers into ({Length: }) of the passGen function will be the 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({content: umber}) // OutPut: 5, 49, 50, 17, 29
}
}
Dropdown Pages
Dropdown Paginator function allows you to create embed pages easily and fast. Example:
// Defining the package
const { MessageEmbed } = require("discord.js")
const pagination = require("flitzzdev").Pages
module.exports = { // Change To Your Own Handler
name: 'dropdown-pages',
description: 'Create some pages with dropdown',
run: async(client, message, args) => { // Change To Your Own Handler
let pages = [
new MessageEmbed() .setAuthor("Page 1"),
new MessageEmbed() .setAuthor("page 2")
]
pagination(message, pages)
}
}
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!