aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/PluginSettings/components/SettingBooleanComponent.tsx2
-rw-r--r--src/components/PluginSettings/components/SettingNumericComponent.tsx2
-rw-r--r--src/components/PluginSettings/components/SettingSelectComponent.tsx2
-rw-r--r--src/components/PluginSettings/components/SettingSliderComponent.tsx2
-rw-r--r--src/components/PluginSettings/components/SettingTextComponent.tsx2
-rw-r--r--src/plugins/anonymiseFileNames.ts2
-rw-r--r--src/plugins/experiments.tsx2
-rw-r--r--src/plugins/moyai.ts2
-rw-r--r--src/plugins/pronoundb/utils.ts2
-rw-r--r--src/plugins/uwuify.ts4
-rw-r--r--src/plugins/viewIcons.tsx2
11 files changed, 12 insertions, 12 deletions
diff --git a/src/components/PluginSettings/components/SettingBooleanComponent.tsx b/src/components/PluginSettings/components/SettingBooleanComponent.tsx
index 939ca70..2267996 100644
--- a/src/components/PluginSettings/components/SettingBooleanComponent.tsx
+++ b/src/components/PluginSettings/components/SettingBooleanComponent.tsx
@@ -18,7 +18,7 @@ export function SettingBooleanComponent({ option, pluginSettings, id, onChange,
];
function handleChange(newValue: boolean): void {
- let isValid = (option.isValid && option.isValid(newValue)) ?? true;
+ const isValid = (option.isValid && option.isValid(newValue)) ?? true;
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else {
diff --git a/src/components/PluginSettings/components/SettingNumericComponent.tsx b/src/components/PluginSettings/components/SettingNumericComponent.tsx
index a54d281..f5cc566 100644
--- a/src/components/PluginSettings/components/SettingNumericComponent.tsx
+++ b/src/components/PluginSettings/components/SettingNumericComponent.tsx
@@ -18,7 +18,7 @@ export function SettingNumericComponent({ option, pluginSettings, id, onChange,
}, [error]);
function handleChange(newValue) {
- let isValid = (option.isValid && option.isValid(newValue)) ?? true;
+ const isValid = (option.isValid && option.isValid(newValue)) ?? true;
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else if (option.type === OptionType.NUMBER && BigInt(newValue) >= MAX_SAFE_NUMBER) {
diff --git a/src/components/PluginSettings/components/SettingSelectComponent.tsx b/src/components/PluginSettings/components/SettingSelectComponent.tsx
index 20ff7a5..ede15e5 100644
--- a/src/components/PluginSettings/components/SettingSelectComponent.tsx
+++ b/src/components/PluginSettings/components/SettingSelectComponent.tsx
@@ -13,7 +13,7 @@ export function SettingSelectComponent({ option, pluginSettings, onChange, onErr
}, [error]);
function handleChange(newValue) {
- let isValid = (option.isValid && option.isValid(newValue)) ?? true;
+ const isValid = (option.isValid && option.isValid(newValue)) ?? true;
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else {
diff --git a/src/components/PluginSettings/components/SettingSliderComponent.tsx b/src/components/PluginSettings/components/SettingSliderComponent.tsx
index 64466c1..c11f4ec 100644
--- a/src/components/PluginSettings/components/SettingSliderComponent.tsx
+++ b/src/components/PluginSettings/components/SettingSliderComponent.tsx
@@ -20,7 +20,7 @@ export function SettingSliderComponent({ option, pluginSettings, id, onChange, o
}, [error]);
function handleChange(newValue: number): void {
- let isValid = (option.isValid && option.isValid(newValue)) ?? true;
+ const isValid = (option.isValid && option.isValid(newValue)) ?? true;
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else {
diff --git a/src/components/PluginSettings/components/SettingTextComponent.tsx b/src/components/PluginSettings/components/SettingTextComponent.tsx
index 898f66b..b93bcd8 100644
--- a/src/components/PluginSettings/components/SettingTextComponent.tsx
+++ b/src/components/PluginSettings/components/SettingTextComponent.tsx
@@ -11,7 +11,7 @@ export function SettingInputComponent({ option, pluginSettings, id, onChange, on
}, [error]);
function handleChange(newValue) {
- let isValid = (option.isValid && option.isValid(newValue)) ?? true;
+ const isValid = (option.isValid && option.isValid(newValue)) ?? true;
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else {
diff --git a/src/plugins/anonymiseFileNames.ts b/src/plugins/anonymiseFileNames.ts
index 962b966..4fa60db 100644
--- a/src/plugins/anonymiseFileNames.ts
+++ b/src/plugins/anonymiseFileNames.ts
@@ -49,7 +49,7 @@ export default definePlugin({
anonymise(file: string) {
let name = "image";
- const ext = file.match(/\..+$/g) ?? "";
+ const ext = file.match(/\..+$/g)?.[0] ?? "";
switch (Settings.plugins.AnonymiseFileNames.method) {
case Methods.Random:
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
diff --git a/src/plugins/experiments.tsx b/src/plugins/experiments.tsx
index dde08a4..0b23aff 100644
--- a/src/plugins/experiments.tsx
+++ b/src/plugins/experiments.tsx
@@ -30,7 +30,7 @@ export default definePlugin({
},
}, {
find: ".isStaff=function(){",
- predicate: () => Settings.plugins["Experiments"].enableIsStaff === true,
+ predicate: () => Settings.plugins.Experiments.enableIsStaff === true,
replacement: [
{
match: /return\s*(\w+)\.hasFlag\((.+?)\.STAFF\)}/,
diff --git a/src/plugins/moyai.ts b/src/plugins/moyai.ts
index e3f5db9..3bb7f2e 100644
--- a/src/plugins/moyai.ts
+++ b/src/plugins/moyai.ts
@@ -111,7 +111,7 @@ function countMatches(sourceString: string, pattern: RegExp) {
const customMoyaiRe = /<a?:\w*moy?ai\w*:\d{17,20}>/gi;
function getMoyaiCount(message: string) {
- let count = countOccurrences(message, MOYAI)
+ const count = countOccurrences(message, MOYAI)
+ countMatches(message, customMoyaiRe);
return Math.min(count, 10);
diff --git a/src/plugins/pronoundb/utils.ts b/src/plugins/pronoundb/utils.ts
index 9d3c076..24a55da 100644
--- a/src/plugins/pronoundb/utils.ts
+++ b/src/plugins/pronoundb/utils.ts
@@ -38,7 +38,7 @@ async function bulkFetchPronouns(ids: string[]): Promise<PronounsResponse> {
params.append("ids", ids.join(","));
try {
- const req = await fetch("https://pronoundb.org/api/v1/lookup-bulk?" + params, {
+ const req = await fetch("https://pronoundb.org/api/v1/lookup-bulk?" + params.toString(), {
method: "GET",
headers: {
"Accept": "application/json"
diff --git a/src/plugins/uwuify.ts b/src/plugins/uwuify.ts
index 2cf0f76..5135c5a 100644
--- a/src/plugins/uwuify.ts
+++ b/src/plugins/uwuify.ts
@@ -31,14 +31,14 @@ function uwuify(message: string): string {
.split(" ")
.map(w => {
let owofied = false;
- let lowerCase = w.toLowerCase();
+ const lowerCase = w.toLowerCase();
// return if the word is too short - uwuifying short words makes them unreadable
if (w.length < 4) {
return w;
}
// replacing the words based on the array on line 29
- for (let [find, replace] of replacements) {
+ for (const [find, replace] of replacements) {
if (w.includes(find)) {
w = w.replace(find, replace);
owofied = true;
diff --git a/src/plugins/viewIcons.tsx b/src/plugins/viewIcons.tsx
index ca106ae..d747a03 100644
--- a/src/plugins/viewIcons.tsx
+++ b/src/plugins/viewIcons.tsx
@@ -49,7 +49,7 @@ export default definePlugin({
replace: (m, guild) => `_guild=${guild},${m}`
},
{
- match: /(?<=createElement\((.{1,5}),\{id:"leave-guild".{0,100}\,)(.{1,2}\.createElement)\((.{1,5}),null,(.{1,2})\)(?=\)\}function)/,
+ match: /(?<=createElement\((.{1,5}),\{id:"leave-guild".{0,100},)(.{1,2}\.createElement)\((.{1,5}),null,(.{1,2})\)(?=\)\}function)/,
replace: (_, menu, createElement, menuGroup, copyIdElement) =>
`${createElement}(${menuGroup},null,[` +
`_guild.icon&&${createElement}(${menu},` +