This repository has been archived by the owner on May 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ADAMJR
committed
Feb 18, 2021
1 parent
9bbbc7c
commit 5e29c26
Showing
5 changed files
with
267 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const Command = require('./command'); | ||
const users = require('../data/users'); | ||
const canvacord = require('canvacord'); | ||
const economy = require('../modules/economy'); | ||
|
||
module.exports = class extends Command { | ||
name = 'profile'; | ||
|
||
async execute(msg, userMention) { | ||
const userId = userMention | ||
?.replace('<@!', '') | ||
.replace('>', '') ?? msg.author.id; | ||
const user = msg.guild.members.cache.get(userId)?.user; | ||
if (!user) | ||
throw new TypeError('Member not found'); | ||
const savedUser = await users.get(userId); | ||
const rank = await economy.getRank(userId, msg.guild.id); | ||
|
||
const buffer = await new canvacord.Rank() | ||
.setAvatar(user.displayAvatarURL({ format: 'png' })) | ||
.setRank(rank, '# ', true) | ||
.setLevel(0, ' ', false) | ||
.setCurrentXP(savedUser.coins) | ||
.setRequiredXP(1_000_000) | ||
.setProgressBar('#C5B358', 'COLOR', false) | ||
.setProgressBarTrack('#000000') | ||
.setBackground('IMAGE', 'https://cdn.pixabay.com/photo/2019/04/30/10/47/background-4168284_960_720.jpg') | ||
.setUsername(user.username) | ||
.setDiscriminator(user.discriminator) | ||
.build(); | ||
|
||
await msg.channel.send({ | ||
files: [{ | ||
attachment: buffer, | ||
name: 'profile.png', | ||
}] | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters