This commit is contained in:
lilyissillyyy
2025-11-02 13:27:44 -05:00
parent 530916aa2a
commit d68f4e5631
+7 -9
View File
@@ -41,7 +41,7 @@ module.exports = class TweetCommand extends Command {
{ {
key: 'user', key: 'user',
type: 'string', type: 'string',
max: 20 max: 25
}, },
{ {
key: 'text', key: 'text',
@@ -292,18 +292,16 @@ module.exports = class TweetCommand extends Command {
} }
async fetchUser(user) { async fetchUser(user) {
if (user === 'me') {
}
try { try {
const matches = val.match(/^(?:<@!?)?([0-9]+)>?$/); const matches = user.match(/^(?:<@!?)?([0-9]+)>?$/);
if (matches) { if (matches) {
const user = await this.client.users.fetch(matches[1]); const found = await this.client.users.fetch(matches[1]);
if (!user) throw new Error('User not found'); if (!found) throw new Error('User not found');
const avaURL = user.displayAvatarURL({ extension: 'png', size: 64, forceStatic: true }); const avaURL = found.displayAvatarURL({ extension: 'png', size: 64, forceStatic: true });
const avatarRes = await request.get(avaURL); const avatarRes = await request.get(avaURL);
return { return {
screenName: user.username, screenName: found.username,
name: user.globalName || user.username, name: found.globalName || found.username,
avatar: avatarRes.body, avatar: avatarRes.body,
avatarShape: 'Circle', avatarShape: 'Circle',
checkType: null, checkType: null,