Skip to content

Instantly share code, notes, and snippets.

@cameroncros
Last active March 2, 2019 21:04
Show Gist options
  • Save cameroncros/394cd31cc1deb154b1387647f52def93 to your computer and use it in GitHub Desktop.
Save cameroncros/394cd31cc1deb154b1387647f52def93 to your computer and use it in GitHub Desktop.
const Discord = require('discord.js');
const client = new Discord.Client();
channel = ""
function send_message() {
channel.send({embed: {
title: "This should be the title",
description: "This is some text",
image: {
url: "attachment://image.png"
}
},
files: [{ attachment: 'images/image.jpg', name: 'image.png' }]
});
}
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
channel = msg.channel
send_message()
}
});
client.login('token')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment