Skip to content

Commit

Permalink
'PollBot-1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
iZboxo committed Feb 18, 2022
1 parent 6c1de15 commit 4c8c137
Showing 1 changed file with 8 additions and 60 deletions.
68 changes: 8 additions & 60 deletions commands/poll.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,10 @@
const { MessageEmbed } = require('discord.js');
const { Command, CommandType, Argument, ArgumentType } = require('gcommands');
const { Command, CommandType } = require('gcommands');

new Command({
name: 'userinfo',
description: 'Check user informations',
type: [ CommandType.SLASH ],
arguments: [
new Argument({
name: 'Poll',
description: 'Select user',
type: ArgumentType.USER,
required: true,
})
],
run: (ctx) => {
// We will use the getMember method because we want to get a straight GuildMember from the argument.
// We'll put `user` in this method because that's what our argument is called.
const member = ctx.arguments.getMember('user');

const embed = new MessageEmbed()
.setAuthor({
name: member.user.tag.toString(),
iconURL: member.user.displayAvatarURL({ dynamic: true }),
})
.addFields([
{
name: 'Username',
value: member.user.username.toString(),
inline: true,
},
{
name: 'Discriminator',
value: member.user.discriminator.toString(),
inline: true,
},
{
name: 'Nickname',
value: member.nickname || 'none',
inline: true,
},
{
name: 'Joined At',
value: member.joinedAt.toString(),
inline: true,
},
{
name: 'Created At',
value: member.user.createdAt.toString(),
inline: true,
}
])
.setColor(member.displayHexColor || "RANDOM")
.setThumbnail(member.user.displayAvatarURL({ dynamic: true }))
.setTimestamp();

ctx.reply({
content: `Informations about ${member.toString()}`,
embeds: [ embed ],
})
}
})
name: 'poll',
description: 'Create new poll!',
type: [CommandType.SLASH, CommandType.MESSAGE],
run: (ctx) => {
return ctx.reply(`Hello ${ctx.user.username}!`);
}
});

0 comments on commit 4c8c137

Please sign in to comment.