mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
displayName in Steam Card
This commit is contained in:
@@ -26,6 +26,7 @@ module.exports = class SteamCardCommand extends Command {
|
|||||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||||
}
|
}
|
||||||
const { user } = args;
|
const { user } = args;
|
||||||
|
const username = message.guild.member(user) ? message.guild.member(user).displayName : user.username;
|
||||||
const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png');
|
const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png');
|
||||||
const blank = new Jimp(494, 568, 0xFFFFFF);
|
const blank = new Jimp(494, 568, 0xFFFFFF);
|
||||||
let images = [];
|
let images = [];
|
||||||
@@ -36,7 +37,7 @@ module.exports = class SteamCardCommand extends Command {
|
|||||||
avatar.resize(450, 450);
|
avatar.resize(450, 450);
|
||||||
blank.composite(avatar, 25, 25);
|
blank.composite(avatar, 25, 25);
|
||||||
blank.composite(steamcard, 0, 0);
|
blank.composite(steamcard, 0, 0);
|
||||||
blank.print(font, 38, 20, user.username);
|
blank.print(font, 38, 20, username);
|
||||||
blank.getBuffer(Jimp.MIME_PNG, (err, buff) => {
|
blank.getBuffer(Jimp.MIME_PNG, (err, buff) => {
|
||||||
if (err) return message.say(':x: Error! Something went wrong!');
|
if (err) return message.say(':x: Error! Something went wrong!');
|
||||||
return message.channel.send({files: [{attachment: buff}]});
|
return message.channel.send({files: [{attachment: buff}]});
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "31.4.0",
|
"version": "31.4.1",
|
||||||
"description": "A Discord Bot",
|
"description": "A Discord Bot",
|
||||||
"main": "shardingmanager.js",
|
"main": "shardingmanager.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user