mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 08:14:47 +02:00
Steam Card Uses Member Nickname
This commit is contained in:
@@ -10,6 +10,7 @@ module.exports = class SteamCardCommand extends Command {
|
|||||||
group: 'avatar-edit',
|
group: 'avatar-edit',
|
||||||
memberName: 'steam-card',
|
memberName: 'steam-card',
|
||||||
description: 'Draws a user\'s avatar over a Steam card.',
|
description: 'Draws a user\'s avatar over a Steam card.',
|
||||||
|
guildOnly: true,
|
||||||
throttling: {
|
throttling: {
|
||||||
usages: 1,
|
usages: 1,
|
||||||
duration: 30
|
duration: 30
|
||||||
@@ -17,9 +18,9 @@ module.exports = class SteamCardCommand extends Command {
|
|||||||
clientPermissions: ['ATTACH_FILES'],
|
clientPermissions: ['ATTACH_FILES'],
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'user',
|
key: 'member',
|
||||||
prompt: 'Which user would you like to edit the avatar of?',
|
prompt: 'Which user would you like to edit the avatar of?',
|
||||||
type: 'user',
|
type: 'member',
|
||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -27,8 +28,8 @@ module.exports = class SteamCardCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async run(msg, args) {
|
async run(msg, args) {
|
||||||
const user = args.user || msg.author;
|
const member = args.member || msg.member;
|
||||||
const avatarURL = user.displayAvatarURL({
|
const avatarURL = member.user.displayAvatarURL({
|
||||||
format: 'png',
|
format: 'png',
|
||||||
size: 512
|
size: 512
|
||||||
});
|
});
|
||||||
@@ -44,7 +45,7 @@ module.exports = class SteamCardCommand extends Command {
|
|||||||
ctx.drawImage(avatar, 25, 25, 450, 450);
|
ctx.drawImage(avatar, 25, 25, 450, 450);
|
||||||
ctx.drawImage(base, 0, 0);
|
ctx.drawImage(base, 0, 0);
|
||||||
ctx.font = '30px Roboto';
|
ctx.font = '30px Roboto';
|
||||||
ctx.fillText(user.username, 35, 48);
|
ctx.fillText(member.displayName, 35, 48);
|
||||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'steam-card.png' }] });
|
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'steam-card.png' }] });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
return msg.say(`Oh no, the image generation failed: \`${err.message}\`. Try again later!`);
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "31.0.0",
|
"version": "31.0.1",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Shard.js",
|
"main": "Shard.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user