This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { Client, MessageActionRow, MessageButton, Intents, MessageEmbed} = require('discord.js'); | |
| const client = new Client({intents: Intents.ALL}) | |
| client.on('ready', () => { | |
| const buttons = new MessageActionRow() | |
| .addComponents( | |
| new MessageButton({ | |
| customID: 'create', | |
| style: "PRIMARY", | |
| type: "BUTTON", | |
| label: 'Создать' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Функция на получение информации об лайке при сообщении при лайке. Не работает если имеется буст S и выше, используйте пример ниже. | |
| const bumpMessageTriggerConfig = { | |
| guildID: "", | |
| channelID: "", | |
| botID: "575776004233232386" // ID бота | |
| }; | |
| function bumpTriggerBot(message, config) { | |
| let logic = (message.guild.id == config.guildID && message.channel.id == config.channelID && message.author.id == config.botID) | |
| ? true | |
| : false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fs.readdirSync('./events/').filter(file => file.endsWith('.js')).forEach(file => { | |
| const event = require(`./events/${file}`); | |
| let eventName = file.split('.')[0]; | |
| client.on(eventName, event.bind(null, client)); | |
| delete require.cache[require.resolve(`./events/${file}`)]; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { categoryID, voiceID} = config | |
| module.exports = async (client, oldState, newState) => { | |
| if(newState.channelID === voiceID) { | |
| newState.guild.channels.create("Комнатка ☁️", { | |
| type: "VOICE", | |
| parent: categoryID, | |
| permissionOverwrites: [ | |
| { | |
| id: newState.guild.id, | |
| allow: ["VIEW_CHANNEL"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const {admin} = config | |
| module.exports.run = async (client, message, args) => { | |
| try { | |
| let helpembed = new Discord.MessageEmbed() | |
| .setTitle('Помощь') | |
| .setDescription('**Если хотите узнать поподробнее о команде напишите `f.help` __`команда`__**') | |
| .setColor('#ca8080') | |
| .setThumbnail(client.user.displayAvatarURL) | |
| .addField(`Если вы нашли недоработку или баг сообщите разработчкиу f.bug`,"[• Open-Source](https://github.com/sqdshcom/simple-discord-bot)"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs') | |
| fs.readdir('./cmds', (err, files) => { | |
| if (err) console.log(err) | |
| files.forEach((element,iterator) => { | |
| if(!element.includes(".")) { | |
| fs.readdir(`./cmds/${element}`,(err,sub_files)=>{ | |
| sub_files.forEach((elem,iterator)=>{ | |
| let props = require(`./cmds/${element}/${elem}`); | |
| client.commands.set(props.help.name, props); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fs.readdir("./cmds/", (err, files) => { | |
| if (err) console.log(err); | |
| let jsfile = files.filter(f => f.split(".").pop() === "js"); | |
| if (jsfile.length <= 0) { | |
| console.log("[BOOT | ERROR] Не найдено команд"); | |
| return; | |
| } | |
| jsfile.forEach((f, i) => { |