Fixing Noah's project package and removing Words.json from the cache
This commit is contained in:
16
src/utilties/discord/regex_matching.ts
Normal file
16
src/utilties/discord/regex_matching.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Guild } from "discord.js";
|
||||
import { SQLCommon } from "../storage/interfaces";
|
||||
|
||||
export async function getRegexesForGuild(db: SQLCommon, guild: Guild): Promise<any[]> {
|
||||
return db.getAllParameterized(
|
||||
"SELECT * FROM message_regexes WHERE server_snowflake = ?",
|
||||
[guild.id]
|
||||
)
|
||||
}
|
||||
|
||||
export async function getRoleExclusionSnowflakesForGuild(db: SQLCommon, guild: Guild): Promise<string[]> {
|
||||
return (await db.getAllParameterized(
|
||||
"SELECT role_snowflake FROM message_regex_no_role_check WHERE server_snowflake = ?",
|
||||
[guild.id]
|
||||
)).map((o) => (o as any).role_snowflake)
|
||||
}
|
||||
Reference in New Issue
Block a user