Updated deps and fixed broken changes

This commit is contained in:
2022-06-06 13:00:38 +07:00
parent 2c8d533cba
commit 8590d77464
8 changed files with 252 additions and 213 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ const EMBEDS = {
],
user: (data instanceof Interaction) ? data.user : data.author
});
_e.setThumbnail(`${DiscordProvider.client.user?.displayAvatarURL()}?size=4096` || '');
_e.setThumbnail(`${DiscordProvider.client.user?.displayAvatarURL()}?size=4096`);
return _e;
}
}
+2 -2
View File
@@ -210,7 +210,7 @@ export default class MembershipScreening extends DiscordModule {
embed[0].footer = {
text: `${interaction.user.username} | v${App.version}`,
iconURL: `${interaction.user.displayAvatarURL()}?size=4096` || ''
iconURL: `${interaction.user.displayAvatarURL()}?size=4096`
}
if (['approve', 'deny', 'ban'].includes(payload.a)) {
@@ -440,7 +440,7 @@ export default class MembershipScreening extends DiscordModule {
]
});
embed.setThumbnail(`${member.user.displayAvatarURL()}?size=4096` || '');
embed.setThumbnail(`${member.user.displayAvatarURL()}?size=4096`);
const row = new MessageActionRow()
.addComponents(
+4 -1
View File
@@ -140,7 +140,10 @@ export default class UserInfo extends DiscordModule {
}
embed.setThumbnail(TargetMember.user.displayAvatarURL());
embed.setAuthor(`${TargetMember.displayName}`, TargetMember.user.displayAvatarURL());
embed.setAuthor({
name: `${TargetMember.displayName}`,
iconURL: TargetMember.user.displayAvatarURL()
});
return await sendHybridInteractionMessageResponse(data, { embeds: [embed] });
+3 -3
View File
@@ -37,17 +37,17 @@ const EMBEDS = {
const user = DiscordProvider.client.user;
payload.footer = {
text: `${user?.username}`,
iconURL: `${user?.displayAvatarURL()}?size=4096` || ''
iconURL: `${user?.displayAvatarURL()}?size=4096`
}
if (!payload.timestamp)
payload.timestamp = new Date();
if (payload.thumbnail?.url === 'bot_avatar')
payload.thumbnail.url = `${user?.displayAvatarURL()}?size=4096` || '';
payload.thumbnail.url = `${user?.displayAvatarURL()}?size=4096`;
if (payload.image?.url === 'bot_avatar')
payload.image.url = `${user?.displayAvatarURL()}?size=4096` || '';
payload.image.url = `${user?.displayAvatarURL()}?size=4096`;
if (payload.description)
payload.description = payload.description.replaceAll('{bot_username}', user?.username)
+11 -3
View File
@@ -196,8 +196,12 @@ export default class osu extends DiscordModule {
],
user: data.getUser()
});
embed.setAuthor({
name: `${result.name}'s osu profile`,
url: `https://osu.ppy.sh/users/${result.id}`,
iconURL: 'https://upload.wikimedia.org/wikipedia/commons/e/e3/Osulogo.png'
});
embed.setAuthor(`${result.name}'s osu profile`, 'https://upload.wikimedia.org/wikipedia/commons/4/44/Osu%21Logo_%282019%29.png', `https://osu.ppy.sh/users/${result.id}`);
// TODO: Fix for ppl with no image
embed.setThumbnail(`https://a.ppy.sh/${result.id}` || 'https://osu.ppy.sh/images/layout/avatar-guest.png');
@@ -353,9 +357,13 @@ export default class osu extends DiscordModule {
user: data.getUser()
});
embed2.setAuthor(`osu! beatmap`, 'https://upload.wikimedia.org/wikipedia/commons/4/44/Osu%21Logo_%282019%29.png', `https://osu.ppy.sh/beatmapsets/${bm_result.beatmapSetId}${url_mode}/${bm_result.id}`);
embed2.setAuthor({
name: `osu! beatmap`,
url: `https://osu.ppy.sh/beatmapsets/${bm_result.beatmapSetId}${url_mode}/${bm_result.id}`,
iconURL: `https://upload.wikimedia.org/wikipedia/commons/e/e3/Osulogo.png`
});
embed2.setImage(`https://assets.ppy.sh/beatmaps/${bm_result.beatmapSetId}/covers/cover.jpg`);
//
const row = new MessageActionRow();
if(bm_result.hasDownload)
row.addComponents(
+7 -7
View File
@@ -26,7 +26,7 @@ export function makeEmbed(icon: string | undefined, title: string, description:
if(typeof user !== 'undefined')
embed.footer = {
text: `${user.username} | v${App.version}`,
iconURL: `${user.displayAvatarURL()}?size=4096` || ''
iconURL: `${user.displayAvatarURL()}?size=4096`
}
else
embed.footer = {
@@ -107,7 +107,7 @@ export async function sendMessageOrInteractionResponse(data: Message | Interacti
let message;
try {
if(!data.deferred)
return await data.reply(payload);
return await data.reply(payload as InteractionReplyOptions);
else
return await data.editReply(payload);
}
@@ -124,7 +124,7 @@ export async function sendMessageOrInteractionResponse(data: Message | Interacti
if(replace)
return await data.editReply(payload);
else
return await data.followUp(payload);
return await data.followUp(payload as InteractionReplyOptions);
}
catch(errorDM) {
Logger.error(`Cannot find available destinations to send the message CID: ${data.channel!.id} UID: ${data.user.id} DM_ERR: ${errorDM}`);
@@ -134,7 +134,7 @@ export async function sendMessageOrInteractionResponse(data: Message | Interacti
}
}
}
else if(isMessage) return await sendReply(data, payload);
else if(isMessage) return await sendReply(data, payload as MessageOptions);
}
export async function sendHybridInteractionMessageResponse(data: HybridInteractionMessage, payload: MessageOptions | InteractionReplyOptions, replace = false): (Promise<Message | Interaction | undefined>) {
@@ -147,7 +147,7 @@ export async function sendHybridInteractionMessageResponse(data: HybridInteracti
let message;
try {
if(!messageComponent.deferred) {
await messageComponent.reply(payload);
await messageComponent.reply(payload as InteractionReplyOptions);
return messageComponent;
}
else {
@@ -168,7 +168,7 @@ export async function sendHybridInteractionMessageResponse(data: HybridInteracti
if(replace)
return (await messageComponent.editReply(payload) as Message);
else
return (await messageComponent.followUp(payload) as Message);
return (await messageComponent.followUp(payload as InteractionReplyOptions) as Message);
}
catch(errorDM) {
Logger.error(`Cannot find available destinations to send the message CID: ${messageComponent.channel!.id} UID: ${messageComponent.user.id} DM_ERR: ${errorDM}`);
@@ -178,7 +178,7 @@ export async function sendHybridInteractionMessageResponse(data: HybridInteracti
}
}
}
else if(data.isMessage()) return await sendReply(data.getMessage(), payload);
else if(data.isMessage()) return await sendReply(data.getMessage(), payload as MessageOptions);
}
export function getEmotes() {