flitzzdev v0.2.33
📥 Installation
To install the package you need:
You need to install Node.js.
You need to install discord.js.
Type npm i flitzzdev@latest in the terminal to install the latest version of the package
📜 Functions
Functions:
Capitalize()
- Capitalize the first letter of a stringpassGen()
- Function to create passwords made by letters and numbers randomly with specified length.bin()
- Function that allows you to bin codes.remind()
- Function to make remind commandrandomNumber()
- Create a random numberPages()
- Create some pages
Events:
inviteJoin
allows you to get some informations about the invite such as the inviter, etc...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);
}
}
passGen
Generates a simple password
Example:
// Define the package
const Flitz = require('flitzzdev')
// Fetching the function
const passGen = Flitz.passGen
// The numbers into the () of the passGen function will be the length
console.log(passGen(6))
passGen(Length: Number)
Bin
Bin some code with this function
Example:
// Defining the package...
const Flitz = require('flitzzdev')
// if there are no args, it will return a message
if (!args.join(' ')) return message.channel.send('What do you want to bin?');
// else if everything works fine, we will make a new varible called "bin"
else {
// it will be used to bin the args.join(' ') also known as the message.content
const bin = await Flitz.bin(args.join(' '), true);
// then here we will send the results!
message.channel.send('The binned code!' + bin)
}
bin(String)
Flitz.bin(args.join(' '), true/false)
if its true that mean the bin is editable, else if its false that means no one can edit it.
Remind
Used in remind command. Parameters:
- MemberID
- Time
Reason
Example
const Flitz = require("flitzzdev").remind;
const time = args[0];
const reason = args.slice(1).join(" ");
if (!time) return message.channel.send("Please specify some time")
if (!reason) return message.channel.send("Please specify a reason")
remind(message.author.id, time, reason);
message.channel.send("I've set a reminder")
Random Number
const { randomName } = require('flitzzdev') // Importing....
module.exports = { // Change To Your Handler
name: 'number',
description: 'Get Random Number',
execute(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
}
}
Button Pages
Button 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
let pages = [
new MessageEmbed() .setAuthor("Page 1"),
new MessageEmbed() .setAuthor("page 2")
]
pagination(message, pages)
Don't change the id of the buttons otherwise, don't expect it to work.
Events:
Invite Logger Event
This event is for logging invite uses.
- member
- invite
- inviter
Example:
// Define flitzzdev package
const Flitz = require("flitzzdev")
// Define discord.js
const discord = require('discord.js')
// Create a discord client
const client = new discord.Client()
// Define the logger
Flitz.inviteLogger(client)
// The event should work
client.on('inviteJoin', (member, invite, inviter) => {
// Result
console.log(`${member.user.tag} is joined by using the code ${invite.code} wich origin is ${inviter.tag}. Times used: ${invite.uses}`)
});
Flitz.inviteLogger(client)
if you dont put client between () after it, the event wont work
ChatBot
Using Message Event
PreView
const { chatBot } = require('flitzzdev') // Importing Package
client.on('message', async message => {
if(message.channel.id === '777919296595820564') { // Channel ID
if(message.author.bot) return // If author is a bot it won't reply
if(message.channel.type === 'dm') return // If message channel is dm it will return
if(message.attachments.size > 0) return message.reply('I Can\`t 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.tag}, ${reply}`); // Reply to a user
}
}
})
Send me a dm on discord: Flitz#2708 to send idea's or bugs!
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago