/[sudobot]/trunk/src/commands/information/UserLookupCommand.ts
ViewVC logotype

Diff of /trunk/src/commands/information/UserLookupCommand.ts

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 289 by rakin, Mon Jul 29 17:29:23 2024 UTC revision 344 by rakin, Mon Jul 29 17:29:40 2024 UTC
# Line 1  Line 1 
1  import { formatDistanceStrict, formatDistanceToNowStrict } from "date-fns";  import { formatDistanceStrict, formatDistanceToNowStrict } from "date-fns";
2  import { APIEmbedField } from "discord-api-types/v9";  import { APIEmbedField } from "discord-api-types/v9";
3  import { Util, Message, Interaction, CacheType, CommandInteraction } from "discord.js";  import { Util, Message, CacheType, CommandInteraction } from "discord.js";
4  import Client from "../../client/Client";  import Client from "../../client/Client";
5  import MessageEmbed from "../../client/MessageEmbed";  import MessageEmbed from "../../client/MessageEmbed";
6  import CommandOptions from "../../types/CommandOptions";  import CommandOptions from "../../types/CommandOptions";
7  import InteractionOptions from "../../types/InteractionOptions";  import InteractionOptions from "../../types/InteractionOptions";
8  import { emoji } from "../../utils/Emoji";  import { emoji } from "../../utils/Emoji";
9  import getUser from "../../utils/getUser";  import getUser from "../../utils/getUser";
 import { parseUser } from "../../utils/parseInput";  
10  import BaseCommand from "../../utils/structures/BaseCommand";  import BaseCommand from "../../utils/structures/BaseCommand";
11    import { getUserBadges } from "./ProfileCommand";
12    
13  export default class UserLookupCommand extends BaseCommand {  export default class UserLookupCommand extends BaseCommand {
14      supportsInteractions: boolean = true;      supportsInteractions: boolean = true;
# Line 80  export default class UserLookupCommand e Line 80  export default class UserLookupCommand e
80              }              }
81          ];          ];
82    
83            embed.setThumbnail(user.displayAvatarURL());
84    
85          if (member) {          if (member) {
86              fields.push({              fields.push({
87                  name: "Joined Server",                  name: "Joined Server",
# Line 150  export default class UserLookupCommand e Line 152  export default class UserLookupCommand e
152              }              }
153          }          }
154    
155            const badges = getUserBadges(user).join('\n');
156    
157            fields.push({
158                name: "Badges",
159                value: badges.trim() === '' ? '*No badges found*' : badges
160            });
161    
162          fields = [...fields, ...fieldsCommon];          fields = [...fields, ...fieldsCommon];
163          embed.setFields(fields);          embed.setFields(fields);
164          embed.setTimestamp();          embed.setTimestamp();

Legend:
Removed from v.289  
changed lines
  Added in v.344

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26