fix(?) the nickname
This commit is contained in:
parent
35378dfa07
commit
868779edf7
1 changed files with 5 additions and 2 deletions
|
@ -36,13 +36,16 @@ class fakebotCommand extends Command {
|
||||||
let Attachment = (message.attachments).array();
|
let Attachment = (message.attachments).array();
|
||||||
let url;
|
let url;
|
||||||
let username = args.user.username;
|
let username = args.user.username;
|
||||||
|
let member = message.guild.members.get(args.user.id);
|
||||||
// Get attachment link
|
// Get attachment link
|
||||||
if (Attachment[0]) {
|
if (Attachment[0]) {
|
||||||
url = Attachment[0].url;
|
url = Attachment[0].url;
|
||||||
}
|
}
|
||||||
// Show nickname if user is in guild
|
// Show nickname if user is in guild
|
||||||
if (message.guild.members.get(args.user.id).nickname) {
|
if (member) {
|
||||||
username = message.guild.members.get(args.user.id).nickname;
|
if (member.nickname) {
|
||||||
|
username = member.nickname;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message.channel.createWebhook(username, {
|
message.channel.createWebhook(username, {
|
||||||
|
|
Loading…
Reference in a new issue