Skip to content

Commit

Permalink
ユーザー情報
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse484 committed Mar 16, 2019
1 parent f2f3a9c commit 5b2164c
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions commands/bot/userinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,49 @@ module.exports = class user_info extends Command {
constructor(client) {
super(client, {
name: "userinfo",
aliases: ["uinfo", "ユーザー情報"],
group: "bot",
memberName: "userinfo",
description: "ユーザーの情報を表示します",
args: [
{
key: "user",
type: "user",
prompt: "ユーザー名又はIDを入力してください",
default: "",
},
],
});
}

run(message) {

run(message, { user }) {
const user_info = (user_id) => {
const user = this.client.users.get(user_id);
return {
embed: {
author: {
icon_url: user.avatarURL,
name: `${user.username}の情報`,
},
thumbnail: { url: user.avatarURL },
fields: [
{ name: "ユーザー名", value: user.tag, inline: true },
{ name: "ID", value: user.id, inline: true },
{ name: "ステータス", value: user.presence.status, inline: true },
{ name: "Bot", value: user.bot ? "はい" : "いいえ", inline: true },
],
footer: { text: "作成日" },
timestamp: user.createdAt,
color: 0xB8E986,
},
};
}


if (user) {
return message.say(user_info(user.id));
} else {
return message.say(user_info(message.author.id));
}
}
};

0 comments on commit 5b2164c

Please sign in to comment.