/[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 285 by rakin, Mon Jul 29 17:29:22 2024 UTC revision 289 by rakin, Mon Jul 29 17:29:23 2024 UTC
# Line 53  export default class UserLookupCommand e Line 53  export default class UserLookupCommand e
53              }              }
54          });          });
55    
56    
57            if (user.hexAccentColor) {            
58                embed.setColor(user.hexAccentColor);
59            }
60    
61          const fieldsCommon: APIEmbedField[] = [            const fieldsCommon: APIEmbedField[] = [  
62                            
63          ];          ];
# Line 61  export default class UserLookupCommand e Line 66  export default class UserLookupCommand e
66              {              {
67                  name: "Server Member?",                  name: "Server Member?",
68                  value: member ? "Yes" : "No",                  value: member ? "Yes" : "No",
69                    inline: true
70                },
71                {
72                    name: "Bot?",
73                    value: user.bot ? "Yes" : "No",
74                    inline: true
75              },              },
76              {              {
77                  name: "Account created",                  name: "Account created",
78                  value: formatDistanceToNowStrict(user.createdAt, { addSuffix: true }),                  value: user.createdAt.toLocaleString() + " (" + formatDistanceToNowStrict(user.createdAt, { addSuffix: true }) + ")",
79                  inline: true                  inline: true
80              }              }
81          ];          ];
# Line 72  export default class UserLookupCommand e Line 83  export default class UserLookupCommand e
83          if (member) {          if (member) {
84              fields.push({              fields.push({
85                  name: "Joined Server",                  name: "Joined Server",
86                  value: member.joinedAt ? formatDistanceToNowStrict(member.joinedAt, { addSuffix: true }) : "Information not available",                  value: member.joinedAt ? member.joinedAt.toLocaleString() + " (" + formatDistanceToNowStrict(member.joinedAt, { addSuffix: true }) + ")" : "Information not available",
87                  inline: true                  inline: true
88              });              });
89    
90              if (member.premiumSince) {              if (member.premiumSince) {
91                  fields.push({                  fields.push({
92                      name: "Boosted Server",                      name: "Boosted Server",
93                      value: formatDistanceToNowStrict(member.premiumSince, { addSuffix: true }),                      value: member.premiumSince.toLocaleString() + " (" + formatDistanceToNowStrict(member.premiumSince, { addSuffix: true }) + ")",
94                      inline: true                      inline: true
95                  });                  });
96              }              }
# Line 87  export default class UserLookupCommand e Line 98  export default class UserLookupCommand e
98              if (member.communicationDisabledUntil) {              if (member.communicationDisabledUntil) {
99                  fields.push({                  fields.push({
100                      name: "Timed-out Until",                      name: "Timed-out Until",
101                      value: formatDistanceStrict(member.communicationDisabledUntil, new Date()),                      value: member.communicationDisabledUntil.toLocaleString() + " (" + formatDistanceStrict(member.communicationDisabledUntil, new Date()) + ")",
102                      inline: true                      inline: true
103                  });                  });
104              }              }
105    
106              if (member.displayAvatarURL() != user.displayAvatarURL()) {              if (member.displayAvatarURL()) {
107                  embed.setThumbnail(member.displayAvatarURL());                  embed.setThumbnail(member.displayAvatarURL());
108              }              }
109    
110                if (member.nickname) {
111                    fields.push({
112                        name: "Nickname",
113                        value: Util.escapeMarkdown(member.nickname)
114                    });
115                }
116    
117                if (member.displayHexColor) {
118                    fields.push({
119                        name: "Guild Profile Theme Color",
120                        value: member.displayHexColor
121                    });
122                }
123                
124                if (member.displayHexColor && !user.hexAccentColor) {
125                    embed.setColor(member.displayHexColor);
126                }
127    
128                if (member.voice && member.voice.channel) {
129                    fields.push({
130                        name: "Current Voice Channel",
131                        value: member.voice.channel.toString()
132                    });
133                }
134    
135                fields.push({
136                    name: "Completed Membership Screening",
137                    value: member.pending ? "No" : "Yes"
138                });
139    
140                fields.push({
141                    name: "Mention",
142                    value: member.toString()
143                });
144    
145                if (member.roles.highest.id !== member.guild.id) {
146                    fields.push({
147                        name: "Highest Role",
148                        value: member.roles.highest.toString()
149                    });
150                }
151          }          }
152    
153          fields = [...fields, ...fieldsCommon];          fields = [...fields, ...fieldsCommon];
154          embed.setFields(fields);          embed.setFields(fields);
155            embed.setTimestamp();
156                    
157          await message.reply({          await message.reply({
158              embeds: [              embeds: [

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26