This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtrash.js
50 lines (44 loc) · 1.67 KB
/
trash.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const Discord = require("discord.js");
const fs = require('fs');
const {
inspect
} = require('util');
const request = require("request");
const Canvas = require("canvas");
function random(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
module.exports.run = async (client, message, args, language) => {
message.delete({
timeout: 10000
});
if (message.mentions.users.size) {
var creatingMsg = await message.channel.send(language.creatingImage);
const canvas = Canvas.createCanvas(846, 861);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage('./assets/trash.png');
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
const vavatar = await Canvas.loadImage(message.mentions.users.first().avatarURL);
ctx.drawImage(vavatar, 258, 0, 243, 243);
const p2avatar = await Canvas.loadImage(message.author.avatarURL);
ctx.drawImage(p2avatar, 368, 430, 181, 181);
creatingMsg.delete();
message.channel.send(language.trash.replace("$user", message.author.toString()).replace("$mention", message.mentions.users.first().toString()), {
files: [{
attachment: canvas.toBuffer(),
name: message.mentions.users.first().username + '_is_Trash.png'
}]
});
} else {
message.reply(language.pleaseMentionUser);
}
}
module.exports.config = {
name: "trash",
description: "Throw someone into the trash",
usage: require("../config.json").prefix + "trash @mention",
accessableby: "Members",
aliases: [],
category: "😊 Just for fun",
dmAvailable: false
}