Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
const discord = require("discord.js"); const token = require("../config.json"); const client = new discord.Client(); client.on("ready", () => { client.user.setActivity("my code", { type: "STREAMING", url: "https://www.twitch.tv/chto-to" }) })
client.on('ready', () => { client.user.setActivity("my code", { type: "STREAMING", url: "https://www.twitch.tv/chto-to" }); });
const discord = require("discord.js") const client = new discord.Client({ disableEveryone: true, disabledEvents: ['TYPING_START'] }) const { readdirSync } = require("fs") const { join } = require("path") const { TOKEN, PREFIX } = require("./config.json") client.login(TOKEN) client.commands = new discord.Collection() client.prefix = PREFIX client.queue = new Map() client.on("ready", () => console.log("\nI'am ready! P.S Nexi Bot!\n")) client.on("warn", info => console.log(info)) client.on("error", console.error) const commandFiles = readdirSync(join(__dirname, "commands")).filter(file => file.endsWith(".js")) for (const file of commandFiles) { const command = require(join(__dirname, "commands", `${file}`)); client.commands.set(command.name, command) } client.on("message", async message => { if (message.author.bot) return if (!message.guild) return if (message.content.startsWith(PREFIX)) { const args = message.content.slice(PREFIX.length).trim().split(/ +/) const command = args.shift().toLowerCase() if (!client.commands.has(command)) return try { client.commands.get(command).execute(message, args) } catch (error) { console.error(error) message.reply("Ошибка").catch(console.error) } } })
const Discord = require('discord.js'); const client = new Discord.Client(); client.login(token); client.on('ready', () => { client.user.setActivity("my code", { type: "STREAMING", url: "https://www.twitch.tv/chto-to" }); });