Skip to content

Instantly share code, notes, and snippets.

@sudocode1
Last active Mar 25, 2021
Embed
What would you like to do?
Discord X CLIChat
const Discord = require("discord.js");
const CLIChat = require("clichat.js");
const [bot, client] = [new Discord.Client(), new CLIChat.Client('ip', "discord-interact", true, "SOME_TOKEN")];
client.login();
bot.on('ready', async () => {
console.log("Bot ready");
});
client.on('id', () => {
console.log("CLIChat client ready");
});
bot.on('message', async message => {
if (message.author.id == bot.user.id) return;
if (message.channel.name !== "clichat-interaction") return;
client.send(`${message.member.nickname == null ? message.author.username : message.member.nickname}: ${message.content}\b\n`);
});
client.on('message', async m => {
bot.channels.cache.find(x => x.id == "824750368680050819").send(`${m.username}: ${m.content}`);
});
bot.login("bot token");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment