mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-14 17:13:03 -04:00
more eslint
This commit is contained in:
parent
350e7b0a6a
commit
36f4478a4f
13 changed files with 39 additions and 19 deletions
|
@ -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";
|
||||
|
|
|
@ -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\)}/,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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},` +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue