Skip to content

How to make triggered command with canvacord? #69

Answered by twlite
twlite asked this question in Q&A
Discussion options

You must be logged in to vote
const Discord = require("discord.js");
const client = new Discord.Client();
const canvacord = require("canvacord");

client.on("ready", () => {
    console.log("I'm online!");
});

client.on("message", async (message) => {
    if (message.author.bot) return;
    if (message.content === "!triggered") {
        let avatar = message.author.displayAvatarURL({ dynamic: false, format: 'png' });
        let image = await canvacord.Canvas.trigger(avatar);
        let attachment = new Discord.MessageAttachment(image, "triggered.gif");
        return message.channel.send(attachment);
    }
});

client.login("Your_Bot_Token_here");

Replies: 1 comment

Comment options

twlite
Jan 21, 2021
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by twlite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant