easyuse
v4.0.0
Published
this for pm code only but is used for node,js
Downloads
2
Readme
const Discord = require('discord.js');
const client = new Discord.Client();
const { log } = require('easyuse');
log();
client.login("");
or you can use a diffrent way!
const Discord = require('discord.js');
const client = new Discord.Client();
const { log, sum } = require('easyuse');
sum(77,99);
log();
client.login("");
new ticket system
const Discord = require('discord.js')
const client = new Discord.Client()
const { easyticket } = require('easyuse')
const ticket = new easyticket()
// When bot is ready
client.on('ready', () => {
console.log(`${client.user.tag} is now online!`)
console.log("Bot: Hosting " +
`${client.users.cache.size}` +
" users, in " +
`${client.channels.cache.size}` +
" channels of " +
`${client.guilds.cache.size}` +
" guilds."
);)
// Example: Bot: Hosting 1053 users, in 265 channels of 10 guilds.
})
client.on('message', async message => {
let prefix = "+";
const args = message.content.slice(prefix.length).split(" ");
const command = args.shift().toLowerCase();
if ( command == 'ticket' ) {
const reason = args.join(" ") ? args.join(" ") : "No Reason Provoided"
ticket.makeTicket(message, reason)
/*
Creates a new ticket
if no reason is provoided the reason is "No Reason Provoided"
Reason is optional and not needed to create a channel
if you want the message author to be dmed that he created a
ticket pls use >>> ticket.makeTicket(message, args.join(" "), true)
for default its set for false
*/
} else if ( command == 'close' ) {
ticket.closeTicket(message)
} else if ( command == 'role' ) {
ticket.setRole(message)
// Seting a support role
// Support roles gets pinged whenever a ticket is maded
} else if ( command == 'remove-role' ) {
ticket.DelRole(message, client)
// Remove a support role
} else if ( command == 'send' ) {
ticket.msgTicketChannel(message, prefix)
// send a message to a ticket
} else if ( command == 'category' ) {
ticket.Category(message, client, args.join(" "))
// creates a ticket at the selected Category
} else if ( command == 'delcategory' ) {
ticket.DelCategory(message, client)
// Deleated the selected category from the list of creating
// tickets, next time tickets will not be created at that category
} else if ( command == 'embed-message' ) {
ticket.editEmbed(message, args.join(" "))
// Set's a message when user creates a ticket
} else if ( command == 'remove-embed' ) {
ticket.DelEmbed(message, client)
// Removes the embed message that are used in every ticket getting
// created
} else if ( command == `adduser` ) {
ticket.ticketAddUser(message);
// Add's a user to a ticket
} else if ( command === `id` ) {
ticket.fetchChanID(message, args.join(" "))
// gets a channel id
}
}) client.login('TOKEN')
Hangman
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send('You need manage messages permission.')
const channel = message.mentions.channels.first() || message.guild.channels.cache.get(args[0])
if(!channel) return message.channel.send('Please specify a channel')
const word = args.slice(1).join(" ")
if(!word) return message.channel.send('Please specify a word to guess.')
const hang = new hangman({
message: message,
word: word,
client: client,
channelID: channel.id,
})
hang.start();