- {Parser.parse(edit.content)}
+ {parseEditContent(edit.content, message)}
openHistoryModal(message)}
+ aria-role="button"
+ >
+ {children}
+
+ );
+ },
+
+ Messages: proxyLazy(() => ({
+ DELETED_MESSAGE_COUNT: getMessage("{count, plural, =0 {No deleted messages} one {{count} deleted message} other {{count} deleted messages}}")
+ })),
+
patches: [
{
// MessageStore
@@ -324,7 +368,8 @@ export default definePlugin({
match: /this\.customRenderedContent=(\i)\.customRenderedContent,/,
replace: "this.customRenderedContent = $1.customRenderedContent," +
"this.deleted = $1.deleted || false," +
- "this.editHistory = $1.editHistory || [],"
+ "this.editHistory = $1.editHistory || []," +
+ "this.firstEditTimestamp = $1.firstEditTimestamp || this.editedTimestamp || this.timestamp,"
}
]
},
@@ -337,7 +382,7 @@ export default definePlugin({
// Pass through editHistory & deleted & original attachments to the "edited message" transformer
match: /(?<=null!=\i\.edited_timestamp\)return )\i\(\i,\{reactions:(\i)\.reactions.{0,50}\}\)/,
replace:
- "Object.assign($&,{ deleted:$1.deleted, editHistory:$1.editHistory, attachments:$1.attachments })"
+ "Object.assign($&,{ deleted:$1.deleted, editHistory:$1.editHistory, firstEditTimestamp:$1.firstEditTimestamp })"
},
{
@@ -356,7 +401,8 @@ export default definePlugin({
" return $2;" +
"})())," +
"deleted: arguments[1]?.deleted," +
- "editHistory: arguments[1]?.editHistory"
+ "editHistory: arguments[1]?.editHistory," +
+ "firstEditTimestamp: new Date(arguments[1]?.firstEditTimestamp ?? $2.editedTimestamp ?? $2.timestamp)"
},
{
// Preserve deleted attribute on attachments
@@ -404,6 +450,11 @@ export default definePlugin({
// Render editHistory in the deepest div for message content
match: /(\)\("div",\{id:.+?children:\[)/,
replace: "$1 (!!arguments[0].message.editHistory?.length && $self.renderEdits(arguments[0])),"
+ },
+ {
+ // Make edit marker clickable
+ match: /"span",\{(?=className:\i\.edited,)/,
+ replace: "$self.EditMarker,{message:arguments[0].message,"
}
]
},
@@ -433,6 +484,30 @@ export default definePlugin({
replace: "children:arguments[0].message.deleted?[]:$1"
}
]
+ },
+ {
+ // Message grouping
+ find: "NON_COLLAPSIBLE.has(",
+ replacement: {
+ match: /if\((\i)\.blocked\)return \i\.\i\.MESSAGE_GROUP_BLOCKED;/,
+ replace: '$&else if($1.deleted) return"MESSAGE_GROUP_DELETED";',
+ },
+ predicate: () => Settings.plugins.MessageLogger.collapseDeleted
+ },
+ {
+ // Message group rendering
+ find: "Messages.NEW_MESSAGES_ESTIMATED_WITH_DATE",
+ replacement: [
+ {
+ match: /(\i).type===\i\.\i\.MESSAGE_GROUP_BLOCKED\|\|/,
+ replace: '$&$1.type==="MESSAGE_GROUP_DELETED"||',
+ },
+ {
+ match: /(\i).type===\i\.\i\.MESSAGE_GROUP_BLOCKED\?.*?:/,
+ replace: '$&$1.type==="MESSAGE_GROUP_DELETED"?$self.Messages.DELETED_MESSAGE_COUNT:',
+ },
+ ],
+ predicate: () => Settings.plugins.MessageLogger.collapseDeleted
}
]
});
diff --git a/src/plugins/messageLogger/messageLogger.css b/src/plugins/messageLogger/messageLogger.css
index d5a9c5f17..2759129d9 100644
--- a/src/plugins/messageLogger/messageLogger.css
+++ b/src/plugins/messageLogger/messageLogger.css
@@ -8,11 +8,15 @@
.emoji,
[data-type="sticker"],
iframe,
- .messagelogger-deleted-attachment:not([class*="hiddenAttachment_"]),
+ .messagelogger-deleted-attachment,
[class|="inlineMediaEmbed"]
) {
filter: grayscale(1) !important;
transition: 150ms filter ease-in-out;
+
+ &[class*="hiddenMosaicItem_"] {
+ filter: grayscale(1) blur(var(--custom-message-attachment-spoiler-blur-radius, 44px)) !important;
+ }
}
.messagelogger-deleted
@@ -23,8 +27,7 @@
iframe,
.messagelogger-deleted-attachment,
[class|="inlineMediaEmbed"]
-):hover,
-.messagelogger-deleted {
+):hover {
filter: grayscale(0) !important;
}
@@ -35,3 +38,17 @@
.theme-light .messagelogger-edited {
opacity: 0.5;
}
+
+.messagelogger-edit-marker {
+ cursor: pointer;
+}
+
+.vc-ml-modal-timestamp {
+ cursor: unset;
+ height: unset;
+}
+
+.vc-ml-modal-tab-bar {
+ flex-wrap: wrap;
+ gap: 16px;
+}
diff --git a/src/plugins/moreUserTags/index.tsx b/src/plugins/moreUserTags/index.tsx
index be81a8a89..45538fb66 100644
--- a/src/plugins/moreUserTags/index.tsx
+++ b/src/plugins/moreUserTags/index.tsx
@@ -256,6 +256,7 @@ export default definePlugin({
// in profiles
{
find: ",overrideDiscriminator:",
+ group: true,
replacement: [
{
// prevent channel id from getting ghosted
@@ -263,7 +264,7 @@ export default definePlugin({
match: /user:\i,nick:\i,/,
replace: "$&moreTags_channelId,"
}, {
- match: /,botType:(\i\((\i)\)),/g,
+ match: /,botType:(\i),(?<=user:(\i).+?)/g,
replace: ",botType:$self.getTag({user:$2,channelId:moreTags_channelId,origType:$1,location:'not-chat'}),"
}
]
diff --git a/src/plugins/permissionsViewer/index.tsx b/src/plugins/permissionsViewer/index.tsx
index 6401d9450..6a503f2da 100644
--- a/src/plugins/permissionsViewer/index.tsx
+++ b/src/plugins/permissionsViewer/index.tsx
@@ -34,7 +34,7 @@ import UserPermissions from "./components/UserPermissions";
import { getSortedRoles, sortPermissionOverwrites } from "./utils";
const PopoutClasses = findByPropsLazy("container", "scroller", "list");
-const RoleButtonClasses = findByPropsLazy("button", "buttonInner", "icon", "text");
+const RoleButtonClasses = findByPropsLazy("button", "buttonInner", "icon", "banner");
export const enum PermissionsSortOrder {
HighestRole,
diff --git a/src/plugins/pictureInPicture/index.tsx b/src/plugins/pictureInPicture/index.tsx
index 0a22f06db..81d75a256 100644
--- a/src/plugins/pictureInPicture/index.tsx
+++ b/src/plugins/pictureInPicture/index.tsx
@@ -30,7 +30,7 @@ export default definePlugin({
{
find: ".nonMediaMosaicItem]",
replacement: {
- match: /\.nonMediaMosaicItem\]:!(\i).{0,10}children:\[(\S)/,
+ match: /\.nonMediaMosaicItem\]:!(\i).{0,50}?children:\[(\S)/,
replace: "$&,$1&&$2&&$self.renderPiPButton(),"
},
},
diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx
index 7fdc1509a..456e15a57 100644
--- a/src/plugins/reviewDB/index.tsx
+++ b/src/plugins/reviewDB/index.tsx
@@ -37,8 +37,7 @@ import { getCurrentUserInfo, readNotification } from "./reviewDbApi";
import { settings } from "./settings";
import { showToast } from "./utils";
-const PopoutClasses = findByPropsLazy("container", "scroller", "list");
-const RoleButtonClasses = findByPropsLazy("button", "buttonInner", "icon", "text");
+const RoleButtonClasses = findByPropsLazy("button", "buttonInner", "icon", "banner");
const guildPopoutPatch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild, onClose(): void; }) => {
if (!guild) return;
@@ -181,9 +180,9 @@ export default definePlugin({
onClick={() => openReviewsModal(user.id, user.username)}
look={Button.Looks.FILLED}
size={Button.Sizes.NONE}
- color={RoleButtonClasses.color}
- className={classes(RoleButtonClasses.button, RoleButtonClasses.banner)}
- innerClassName={classes(RoleButtonClasses.buttonInner, RoleButtonClasses.banner)}
+ color={RoleButtonClasses.bannerColor}
+ className={classes(RoleButtonClasses.button, RoleButtonClasses.icon, RoleButtonClasses.banner)}
+ innerClassName={classes(RoleButtonClasses.buttonInner, RoleButtonClasses.icon, RoleButtonClasses.banner)}
>
diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx
index 37177caad..3e7d216b7 100644
--- a/src/plugins/roleColorEverywhere/index.tsx
+++ b/src/plugins/roleColorEverywhere/index.tsx
@@ -60,7 +60,7 @@ export default definePlugin({
find: 'location:"UserMention',
replacement: [
{
- match: /user:(\i),channel:(\i).{0,400}?"@"\.concat\(.+?\)/,
+ match: /onContextMenu:\i,color:\i,\.\.\.\i(?=,children:)(?<=user:(\i),channel:(\i).{0,500}?)/,
replace: "$&,color:$self.getUserColor($1?.id,{channelId:$2?.id})"
}
],
diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx
index 538200afa..68778915b 100644
--- a/src/plugins/showHiddenChannels/index.tsx
+++ b/src/plugins/showHiddenChannels/index.tsx
@@ -257,7 +257,7 @@ export default definePlugin({
{
find: '"alt+shift+down"',
replacement: {
- match: /(?<=getChannel\(\i\);return null!=(\i))(?=.{0,150}?>0\)&&\(0,\i\.\i\)\(\i\))/,
+ match: /(?<=getChannel\(\i\);return null!=(\i))(?=.{0,200}?>0\)&&\(0,\i\.\i\)\(\i\))/,
replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})`
}
},
@@ -265,8 +265,8 @@ export default definePlugin({
{
find: ".APPLICATION_STORE&&null!=",
replacement: {
- match: /(?<=getState\(\)\.channelId.{0,30}?\(0,\i\.\i\)\(\i\))(?=\.map\()/,
- replace: ".filter(e=>!$self.isHiddenChannel(e))"
+ match: /getState\(\)\.channelId.+?(?=\.map\(\i=>\i\.id)/,
+ replace: "$&.filter(e=>!$self.isHiddenChannel(e))"
}
},
{
@@ -307,7 +307,7 @@ export default definePlugin({
]
},
{
- find: '+1]})},"overflow"))',
+ find: '})},"overflow"))',
replacement: [
{
// Create a variable for the channel prop
diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts
index 599bcd36d..90bb345ef 100644
--- a/src/plugins/showHiddenThings/index.ts
+++ b/src/plugins/showHiddenThings/index.ts
@@ -18,34 +18,21 @@
import { definePluginSettings, migratePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
-import definePlugin, { OptionType } from "@utils/types";
+import definePlugin, { OptionType, PluginSettingDef } from "@utils/types";
+
+const opt = (description: string) => ({
+ type: OptionType.BOOLEAN,
+ description,
+ default: true,
+ restartNeeded: true
+} satisfies PluginSettingDef);
const settings = definePluginSettings({
- showTimeouts: {
- type: OptionType.BOOLEAN,
- description: "Show member timeout icons in chat.",
- default: true,
- },
- showInvitesPaused: {
- type: OptionType.BOOLEAN,
- description: "Show the invites paused tooltip in the server list.",
- default: true,
- },
- showModView: {
- type: OptionType.BOOLEAN,
- description: "Show the member mod view context menu item in all servers.",
- default: true,
- },
- disableDiscoveryFilters: {
- type: OptionType.BOOLEAN,
- description: "Disable filters in Server Discovery search that hide servers that don't meet discovery criteria.",
- default: true,
- },
- disableDisallowedDiscoveryFilters: {
- type: OptionType.BOOLEAN,
- description: "Disable filters in Server Discovery search that hide NSFW & disallowed servers.",
- default: true,
- },
+ showTimeouts: opt("Show member timeout icons in chat."),
+ showInvitesPaused: opt("Show the invites paused tooltip in the server list."),
+ showModView: opt("Show the member mod view context menu item in all servers."),
+ disableDiscoveryFilters: opt("Disable filters in Server Discovery search that hide servers that don't meet discovery criteria."),
+ disableDisallowedDiscoveryFilters: opt("Disable filters in Server Discovery search that hide NSFW & disallowed servers."),
});
migratePluginSettings("ShowHiddenThings", "ShowTimeouts");
diff --git a/src/plugins/showMeYourName/index.tsx b/src/plugins/showMeYourName/index.tsx
index 8d1504e1a..4f9fcf304 100644
--- a/src/plugins/showMeYourName/index.tsx
+++ b/src/plugins/showMeYourName/index.tsx
@@ -67,7 +67,7 @@ export default definePlugin({
const { nick } = author;
const prefix = withMentionPrefix ? "@" : "";
- if (isRepliedMessage && !settings.store.inReplies || username === nick.toLowerCase())
+ if (isRepliedMessage && !settings.store.inReplies || username.toLowerCase() === nick.toLowerCase())
return <>{prefix}{nick}>;
if (settings.store.mode === "user-nick")
diff --git a/src/plugins/spotifyControls/index.tsx b/src/plugins/spotifyControls/index.tsx
index b811b2eed..ae5fbcd82 100644
--- a/src/plugins/spotifyControls/index.tsx
+++ b/src/plugins/spotifyControls/index.tsx
@@ -48,7 +48,7 @@ export default definePlugin({
},
patches: [
{
- find: '"AccountConnected"',
+ find: "this.isCopiedStreakGodlike",
replacement: {
// react.jsx)(AccountPanel, { ..., showTaglessAccountPanel: blah })
match: /(?<=\i\.jsxs?\)\()(\i),{(?=[^}]*?userTag:\i,hidePrivateData:)/,
diff --git a/src/plugins/urbanDictionary/README.md b/src/plugins/urbanDictionary/README.md
deleted file mode 100644
index e065456a3..000000000
--- a/src/plugins/urbanDictionary/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Urban Dictionary
-
-Use /urban slash command to search for a definition for a word on [Urban Dictionary](https://www.urbandictionary.com/).
-
-## Preview
-
-![preview](https://i.imgur.com/1zwzj38.png)
-
-## Usage
-
-- Enable this plugin
-- Set plugin settings as desired
-- Type /urban and start getting definitions right into your Discord client.
diff --git a/src/plugins/urbanDictionary/index.ts b/src/plugins/urbanDictionary/index.ts
deleted file mode 100644
index 89dcdcba4..000000000
--- a/src/plugins/urbanDictionary/index.ts
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Vencord, a modification for Discord's desktop app
- * Copyright (c) 2022 Vendicated and contributors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
-*/
-
-import { ApplicationCommandOptionType, sendBotMessage } from "@api/Commands";
-import { ApplicationCommandInputType } from "@api/Commands/types";
-import { definePluginSettings } from "@api/Settings";
-import { Devs } from "@utils/constants";
-import definePlugin, { OptionType } from "@utils/types";
-
-const settings = definePluginSettings({
- resultsAmount: {
- type: OptionType.NUMBER,
- description: "The amount of results you want to get (more gives better results, but is slower)",
- default: 10
- }
-});
-
-export default definePlugin({
- name: "UrbanDictionary",
- description: "Search for a word on Urban Dictionary via /urban slash command",
- authors: [Devs.jewdev],
- dependencies: ["CommandsAPI"],
- settings,
- commands: [
- {
- name: "urban",
- description: "Returns the definition of a word from Urban Dictionary",
- inputType: ApplicationCommandInputType.BUILT_IN,
- options: [
- {
- type: ApplicationCommandOptionType.STRING,
- name: "word",
- description: "The word to search for on Urban Dictionary",
- required: true
- }
- ],
- execute: async (args, ctx) => {
- try {
- const query: string = encodeURIComponent(args[0].value);
- const { list } = await fetch(`https://api.urbandictionary.com/v0/define?term=${query}&per_page=${settings.store.resultsAmount}`).then(response => response.json());
-
- if (!list.length)
- return void sendBotMessage(ctx.channel.id, { content: "No results found." });
-
- const definition = list.reduce((prev, curr) => {
- return prev.thumbs_up > curr.thumbs_up ? prev : curr;
- });
-
- const linkify = (text: string) => text
- .replaceAll("\r\n", "\n")
- .replace(/([*>_`~\\])/gsi, "\\$1")
- .replace(/\[(.+?)\]/g, (_, word) => `[${word}](https://www.urbandictionary.com/define.php?term=${encodeURIComponent(word)} "Define '${word}' on Urban Dictionary")`)
- .trim();
-
- return void sendBotMessage(ctx.channel.id, {
- embeds: [
- {
- type: "rich",
- author: {
- name: `Uploaded by "${definition.author}"`,
- url: `https://www.urbandictionary.com/author.php?author=${encodeURIComponent(definition.author)}`,
- },
- title: definition.word,
- url: `https://www.urbandictionary.com/define.php?term=${encodeURIComponent(definition.word)}`,
- description: linkify(definition.definition),
- fields: [
- {
- name: "Example",
- value: linkify(definition.example),
- },
- {
- name: "Want more definitions?",
- value: `Check out [more definitions](https://www.urbandictionary.com/define.php?term=${query} "Define "${args[0].value}" on Urban Dictionary") on Urban Dictionary.`,
- },
- ],
- color: 0xFF9900,
- footer: { text: `👍 ${definition.thumbs_up.toString()} | 👎 ${definition.thumbs_down.toString()}`, icon_url: "https://www.urbandictionary.com/favicon.ico" },
- timestamp: new Date(definition.written_on).toISOString(),
- },
- ] as any,
- });
- } catch (error) {
- sendBotMessage(ctx.channel.id, {
- content: `Something went wrong: \`${error}\``,
- });
- }
- }
- }
- ]
-});
diff --git a/src/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx
index b2e7d56df..927a974f0 100644
--- a/src/plugins/viewIcons/index.tsx
+++ b/src/plugins/viewIcons/index.tsx
@@ -183,14 +183,23 @@ export default definePlugin({
},
patches: [
- // Profiles Modal pfp
- ...[".MODAL,hasProfileEffect", ".FULL_SIZE,hasProfileEffect:"].map(find => ({
- find,
+ // Avatar component used in User DMs "User Profile" popup in the right and Profiles Modal pfp
+ {
+ find: ".overlay:void 0,status:",
+ replacement: {
+ match: /avatarSrc:(\i),eventHandlers:(\i).+?"div",{...\2,/,
+ replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openImage($1)},"
+ },
+ all: true
+ },
+ // Old Profiles Modal pfp
+ {
+ find: ".MODAL,hasProfileEffect",
replacement: {
match: /\{src:(\i)(?=,avatarDecoration)/,
replace: "{src:$1,onClick:()=>$self.openImage($1)"
}
- })),
+ },
// Banners
...[".NITRO_BANNER,", "=!1,canUsePremiumCustomization:"].map(find => ({
find,
@@ -202,7 +211,7 @@ export default definePlugin({
'onClick:ev=>$1&&ev.target.style.backgroundImage&&$self.openImage($2),style:{cursor:$1?"pointer":void 0,'
}
})),
- // User DMs "User Profile" popup in the right
+ // Old User DMs "User Profile" popup in the right
{
find: ".avatarPositionPanel",
replacement: {
@@ -210,14 +219,6 @@ export default definePlugin({
replace: "$1style:($2)?{cursor:\"pointer\"}:{},onClick:$2?()=>{$self.openImage($3)}"
}
},
- {
- find: ".canUsePremiumProfileCustomization,{avatarSrc:",
- replacement: {
- match: /children:\(0,\i\.jsx\)\(\i,{src:(\i)/,
- replace: "style:{cursor:\"pointer\"},onClick:()=>{$self.openImage($1)},$&"
-
- }
- },
// Group DMs top small & large icon
{
find: /\.recipients\.length>=2(?! delete a.deleted);
return clone;
diff --git a/src/plugins/whoReacted/index.tsx b/src/plugins/whoReacted/index.tsx
index 5721dc912..679fe714e 100644
--- a/src/plugins/whoReacted/index.tsx
+++ b/src/plugins/whoReacted/index.tsx
@@ -43,14 +43,23 @@ function fetchReactions(msg: Message, emoji: ReactionEmoji, type: number) {
},
oldFormErrors: true
})
- .then(res => FluxDispatcher.dispatch({
- type: "MESSAGE_REACTION_ADD_USERS",
- channelId: msg.channel_id,
- messageId: msg.id,
- users: res.body,
- emoji,
- reactionType: type
- }))
+ .then(res => {
+ for (const user of res.body) {
+ FluxDispatcher.dispatch({
+ type: "USER_UPDATE",
+ user
+ });
+ }
+
+ FluxDispatcher.dispatch({
+ type: "MESSAGE_REACTION_ADD_USERS",
+ channelId: msg.channel_id,
+ messageId: msg.id,
+ users: res.body,
+ emoji,
+ reactionType: type
+ });
+ })
.catch(console.error)
.finally(() => sleep(250));
}
@@ -148,13 +157,6 @@ export default definePlugin({
const reactions = getReactionsWithQueue(message, emoji, type);
const users = Object.values(reactions).filter(Boolean) as User[];
- for (const user of users) {
- FluxDispatcher.dispatch({
- type: "USER_UPDATE",
- user
- });
- }
-
return (
.
-*/
-
-import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage } from "@api/Commands";
-import { Devs } from "@utils/constants";
-import definePlugin from "@utils/types";
-
-export default definePlugin({
- name: "Wikisearch",
- description: "Searches Wikipedia for your requested query. (/wikisearch)",
- authors: [Devs.Samu],
- dependencies: ["CommandsAPI"],
- commands: [
- {
- name: "wikisearch",
- description: "Searches Wikipedia for your request.",
- inputType: ApplicationCommandInputType.BUILT_IN,
- options: [
- {
- name: "search",
- description: "Word to search for",
- type: ApplicationCommandOptionType.STRING,
- required: true
- },
- ],
- execute: async (_, ctx) => {
- const word = findOption(_, "search", "");
-
- if (!word) {
- return sendBotMessage(ctx.channel.id, {
- content: "No word was defined!"
- });
- }
-
- const dataSearchParams = new URLSearchParams({
- action: "query",
- format: "json",
- list: "search",
- formatversion: "2",
- origin: "*",
- srsearch: word
- });
-
- const data = await fetch("https://en.wikipedia.org/w/api.php?" + dataSearchParams).then(response => response.json())
- .catch(err => {
- console.log(err);
- sendBotMessage(ctx.channel.id, { content: "There was an error. Check the console for more info" });
- return null;
- });
-
- if (!data) return;
-
- if (!data.query?.search?.length) {
- console.log(data);
- return sendBotMessage(ctx.channel.id, { content: "No results given" });
- }
-
- const altData = await fetch(`https://en.wikipedia.org/w/api.php?action=query&format=json&prop=info%7Cdescription%7Cimages%7Cimageinfo%7Cpageimages&list=&meta=&indexpageids=1&pageids=${data.query.search[0].pageid}&formatversion=2&origin=*`)
- .then(res => res.json())
- .then(data => data.query.pages[0])
- .catch(err => {
- console.log(err);
- sendBotMessage(ctx.channel.id, { content: "There was an error. Check the console for more info" });
- return null;
- });
-
- if (!altData) return;
-
- const thumbnailData = altData.thumbnail;
-
- const thumbnail = thumbnailData && {
- url: thumbnailData.source.replace(/(50px-)/ig, "1000px-"),
- height: thumbnailData.height * 100,
- width: thumbnailData.width * 100
- };
-
- sendBotMessage(ctx.channel.id, {
- embeds: [
- {
- type: "rich",
- title: data.query.search[0].title,
- url: `https://wikipedia.org/w/index.php?curid=${data.query.search[0].pageid}`,
- color: "0x8663BE",
- description: data.query.search[0].snippet.replace(/( |<([^>]+)>)/ig, "").replace(/(")/ig, "\"") + "...",
- image: thumbnail,
- footer: {
- text: "Powered by the Wikimedia API",
- },
- }
- ] as any
- });
- }
- }
- ]
-});
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index 69fee8d62..4645a63ac 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -534,6 +534,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({
name: "Antti",
id: 312974985876471810n
},
+ Joona: {
+ name: "Joona",
+ id: 297410829589020673n
+ },
vappster: {
name: "vappster",
id: 747192967311261748n
diff --git a/src/webpack/webpack.ts b/src/webpack/webpack.ts
index f21a38d67..272ecd94f 100644
--- a/src/webpack/webpack.ts
+++ b/src/webpack/webpack.ts
@@ -544,7 +544,7 @@ export async function extractAndLoadChunks(code: CodeFilter, matcher: RegExp = D
}
if (rawChunkIds) {
- const chunkIds = Array.from(rawChunkIds.matchAll(ChunkIdsRegex)).map((m: any) => m[1]);
+ const chunkIds = Array.from(rawChunkIds.matchAll(ChunkIdsRegex)).map((m: any) => Number(m[1]));
await Promise.all(chunkIds.map(id => wreq.e(id)));
}
@@ -559,7 +559,7 @@ export async function extractAndLoadChunks(code: CodeFilter, matcher: RegExp = D
return false;
}
- wreq(entryPointId);
+ wreq(Number(entryPointId));
return true;
}