Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update BetterBotTags.plugin.js to fix the addon #83

Open
wants to merge 1 commit into
base: potato
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Plugins/BetterBotTags/BetterBotTags.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @description Some improvements for bot tags, like the addition of webhook tags.
* @author Qb
* @authorId 133659541198864384
* @version 2.0.1
* @version 2.0.2
* @invite gj7JFa6mF8
* @source https://github.com/QbDesu/BetterDiscordAddons/blob/potato/Plugins/BetterBotTags
* @updateUrl https://raw.githubusercontent.com/QbDesu/BetterDiscordAddons/potato/Plugins/BetterBotTags/BetterBotTags.plugin.js
Expand All @@ -21,14 +21,13 @@ module.exports = (() => {
const config = {
info: {
name: "BetterBotTags",
version: "2.0.1",
version: "2.0.2",
github_raw: "https://raw.githubusercontent.com/QbDesu/BetterDiscordAddons/potato/Plugins/BetterBotTags/BetterBotTags.plugin.js"
},
changelog: [
{
title: 'Bug Fixes', types: 'fixed', items: [
'Fixed missing padding in replies and compact display.',
'Fixed surplus space when icons are disabled.',
'Fixed the tags no longer showing up.',
],
},
],
Expand Down Expand Up @@ -89,7 +88,7 @@ module.exports = (() => {
};


const MessageHeader = getModuleAndKey(Filters.byStrings(".message",".compact", ".author", ".showPopout"));
const MessageHeader = getModuleAndKey(Filters.byStrings("message","compact", "author", "showPopout", "decoration"));
const BotTag = getModuleAndKey(Filters.combine(Filters.byProps("Types"), Filters.byStrings(".BOT")));

const BotTagTypes = {
Expand Down Expand Up @@ -239,7 +238,7 @@ module.exports = (() => {
else if (this.isDefaultMessage(message)) type = this.isOfficial(message) ? BotTagTypes.OFFICIAL : BotTagTypes.SERVER;
else if (this.isWebhook(message)) type = BotTagTypes.WEBHOOK;
else if (user?.bot) type = BotTagTypes.BOT;
else if (channel.isForumPost() && channel.ownerId === user.id && !isRepliedMessage) type = BotTagTypes.ORIGINAL_POSTER;
else if (channel?.isForumPost() && channel.ownerId === user.id && !isRepliedMessage) type = BotTagTypes.ORIGINAL_POSTER;

if (type==null) return;
for (let key in decorations) {
Expand Down Expand Up @@ -270,6 +269,7 @@ module.exports = (() => {

onStart() {
if (!BotTag) return BdApi.showToast(`${config.info.name}: Failed to resolve BotTag Module`, { type: "error" });
if (!MessageHeader) return BdApi.showToast(`${config.info.name}: Failed to resolve MessageHeader Module`, { type: "error" });
this.patch();
}

Expand Down