Skip to content

Commit

Permalink
Renames the hyperlink rule tolink
Browse files Browse the repository at this point in the history
  • Loading branch information
PolariTOON committed Apr 14, 2024
1 parent 49a7cef commit 0cd3a20
Show file tree
Hide file tree
Showing 14 changed files with 72 additions and 77 deletions.
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ $ export SHICKA_RECORD_DEFAULT_CHANNEL=<your-record-default-channel-here>
$ export SHICKA_REFUSAL_DEFAULT_CHANNEL=<your-refusal-default-channel-here>
$ export SHICKA_VERIFICATION_DEFAULT_CHANNEL=<your-verification-default-channel-here>
$ export SHICKA_VERIFICATION_VERIFIED_ROLE=<your-verfication-verified-role-here>
$ export SHICKA_HYPERLINK_DEFAULT_ALERT_ACTION_CHANNEL=<your-hyperlink-default-alert-action-channel-here>
$ export SHICKA_HYPERLINK_DEFAULT_EXEMPT_CHANNELS=<your-hyperlink-default-exempt-channels-here>
$ export SHICKA_HYPERLINK_DEFAULT_EXEMPT_ROLES=<your-hyperlink-default-exempt-roles-here>
$ export SHICKA_HYPERLINK_REACTION_EMOJI=<your-hyperlink-reaction-emoji-here>
$ export SHICKA_HYPERLINK_OVERRIDE_RULES_CHANNEL=<your-hyperlink-override-rules-channel-here>
$ export SHICKA_LINK_DEFAULT_ALERT_ACTION_CHANNEL=<your-link-default-alert-action-channel-here>
$ export SHICKA_LINK_DEFAULT_EXEMPT_CHANNELS=<your-link-default-exempt-channels-here>
$ export SHICKA_LINK_DEFAULT_EXEMPT_ROLES=<your-link-default-exempt-roles-here>
$ export SHICKA_LINK_REACTION_EMOJI=<your-link-reaction-emoji-here>
$ export SHICKA_LINK_OVERRIDE_RULES_CHANNEL=<your-link-override-rules-channel-here>
$ export SHICKA_RULE7_DEFAULT_ALERT_ACTION_CHANNEL=<your-rule7-default-alert-action-channel-here>
$ export SHICKA_RULE7_DEFAULT_EXEMPT_CHANNELS=<your-rule7-default-exempt-channels-here>
$ export SHICKA_RULE7_DEFAULT_EXEMPT_ROLES=<your-rule7-default-exempt-roles-here>
Expand Down Expand Up @@ -132,6 +132,6 @@ $ npm start

### Rules

- `hyperlink` flags messages which contain a hyperlink as such in the given channel (set to `$SHICKA_HYPERLINK_DEFAULT_ALERT_ACTION_CHANNEL` by default) except when posted in any of the given exempted channels (set to `$SHICKA_HYPERLINK_DEFAULT_EXEMPT_CHANNELS` by default), when posted by non-administrator members having any of the given exempted roles (set to `$SHICKA_HYPERLINK_DEFAULT_EXEMPT_ROLES` by default) or when posted by administrator members
- `link` flags messages which contain a hyperlink as such in the given channel (set to `$SHICKA_LINK_DEFAULT_ALERT_ACTION_CHANNEL` by default) except when posted in any of the given exempted channels (set to `$SHICKA_LINK_DEFAULT_EXEMPT_CHANNELS` by default), when posted by non-administrator members having any of the given exempted roles (set to `$SHICKA_LINK_DEFAULT_EXEMPT_ROLES` by default) or when posted by administrator members

- `rule7` flags messages which violate the rule 7 as such in the given channel (set to `$SHICKA_RULE7_DEFAULT_ALERT_ACTION_CHANNEL` by default) except when posted in any of the given exempted channels (set to `$SHICKA_RULE7_DEFAULT_EXEMPT_CHANNELS` by default), when posted by non-administrator members having any of the given exempted roles (set to `$SHICKA_RULE7_DEFAULT_EXEMPT_ROLES` by default) or when posted by administrator members
12 changes: 6 additions & 6 deletions src/compilations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import departureCompilation from "./compilations/departure.js";
import emojiCompilation from "./compilations/emoji.js";
import gateCompilation from "./compilations/gate.js";
import helpCompilation from "./compilations/help.js";
import hyperlinkCompilation from "./compilations/hyperlink.js";
import leaderboardCompilation from "./compilations/leaderboard.js";
import linkCompilation from "./compilations/link.js";
import missionCompilation from "./compilations/mission.js";
import outfitCompilation from "./compilations/outfit.js";
import patchCompilation from "./compilations/patch.js";
Expand Down Expand Up @@ -44,8 +44,8 @@ type Departure = typeof departureCompilation;
type Emoji = typeof emojiCompilation;
type Gate = typeof gateCompilation;
type Help = typeof helpCompilation;
type Hyperlink = typeof hyperlinkCompilation;
type Leaderboard = typeof leaderboardCompilation;
type Link = typeof linkCompilation;
type Mission = typeof missionCompilation;
type Outfit = typeof outfitCompilation;
type Patch = typeof patchCompilation;
Expand All @@ -64,7 +64,7 @@ type Trailer = typeof trailerCompilation;
type Update = typeof updateCompilation;
type Verification = typeof verificationCompilation;
type Verify = typeof verifyCompilation;
type Compilation = About | Application | Apply | Approval | Approve | Arrival | Bear | Chat | Count | Departure | Emoji | Gate | Help | Hyperlink | Leaderboard | Mission | Outfit | Patch | Patching | Posting | Raw | Record | Refusal | Refuse | Roadmap | Rule7 | Soundtrack | Store | Tracker | Trailer | Update | Verification | Verify;
type Compilation = About | Application | Apply | Approval | Approve | Arrival | Bear | Chat | Count | Departure | Emoji | Gate | Help | Leaderboard | Link | Mission | Outfit | Patch | Patching | Posting | Raw | Record | Refusal | Refuse | Roadmap | Rule7 | Soundtrack | Store | Tracker | Trailer | Update | Verification | Verify;
const about: About = aboutCompilation;
const application: Application = applicationCompilation;
const apply: Apply = applyCompilation;
Expand All @@ -78,8 +78,8 @@ const departure: Departure = departureCompilation;
const emoji: Emoji = emojiCompilation;
const gate: Gate = gateCompilation;
const help: Help = helpCompilation;
const hyperlink: Hyperlink = hyperlinkCompilation;
const leaderboard: Leaderboard = leaderboardCompilation;
const link: Link = linkCompilation;
const mission: Mission = missionCompilation;
const outfit: Outfit = outfitCompilation;
const patch: Patch = patchCompilation;
Expand Down Expand Up @@ -113,8 +113,8 @@ export type {
Emoji,
Gate,
Help,
Hyperlink,
Leaderboard,
Link,
Mission,
Outfit,
Patch,
Expand Down Expand Up @@ -148,8 +148,8 @@ export {
emoji,
gate,
help,
hyperlink,
leaderboard,
link,
mission,
outfit,
patch,
Expand Down
17 changes: 0 additions & 17 deletions src/compilations/hyperlink.ts

This file was deleted.

17 changes: 17 additions & 0 deletions src/compilations/link.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type {Link} from "../dependencies.js";
import type {Localized} from "../utils/string.js";
import {link} from "../definitions.js";
import {compileAll} from "../utils/string.js";
type HelpWithChannelsLocalizations = Localized<(groups: Link["helpWithChannels"]) => string>;
type HelpWithoutChannelsLocalizations = Localized<(groups: Link["helpWithoutChannels"]) => string>;
type LinkCompilation = {
helpWithChannels: HelpWithChannelsLocalizations,
helpWithoutChannels: HelpWithoutChannelsLocalizations,
};
const helpWithChannelsLocalizations: HelpWithChannelsLocalizations = compileAll<Link["helpWithChannels"]>(link["helpWithChannels"]);
const helpWithoutChannelsLocalizations: HelpWithoutChannelsLocalizations = compileAll<Link["helpWithoutChannels"]>(link["helpWithoutChannels"]);
const linkCompilation: LinkCompilation = {
helpWithChannels: helpWithChannelsLocalizations,
helpWithoutChannels: helpWithoutChannelsLocalizations,
};
export default linkCompilation;
22 changes: 11 additions & 11 deletions src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import departureDefinition from "./definitions/departure.json" assert {type: "js
import emojiDefinition from "./definitions/emoji.json" assert {type: "json"};
import gateDefinition from "./definitions/gate.json" assert {type: "json"};
import helpDefinition from "./definitions/help.json" assert {type: "json"};
import hyperlinkDefinition from "./definitions/hyperlink.json" assert {type: "json"};
import leaderboardDefinition from "./definitions/leaderboard.json" assert {type: "json"};
import linkDefinition from "./definitions/link.json" assert {type: "json"};
import missionDefinition from "./definitions/mission.json" assert {type: "json"};
import outfitDefinition from "./definitions/outfit.json" assert {type: "json"};
import patchDefinition from "./definitions/patch.json" assert {type: "json"};
Expand Down Expand Up @@ -166,19 +166,19 @@ type Help = {
help: Localized<string>,
reply: Localized<string>,
};
type Hyperlink = {
ruleName: string,
ruleReason: string,
helpWithChannels: Localized<string>,
helpWithoutChannels: Localized<string>,
};
type Leaderboard = {
commandName: string,
commandDescription: Localized<string>,
help: Localized<string>,
reply: Localized<string>,
link: Localized<string>,
};
type Link = {
ruleName: string,
ruleReason: string,
helpWithChannels: Localized<string>,
helpWithoutChannels: Localized<string>,
};
type Mission = {
commandName: string,
commandDescription: Localized<string>,
Expand Down Expand Up @@ -327,7 +327,7 @@ type Verify = {
reply: Localized<string>,
noPermissionReply: Localized<string>,
};
type Definition = About | Application | Apply | Approval | Approve | Arrival | Bear | Chat | Count | Departure | Emoji | Gate | Help | Hyperlink | Leaderboard | Mission | Outfit | Patch | Patching | Posting | Raw | Record | Refusal | Refuse | Roadmap | Rule7 | Soundtrack | Store | Tracker | Trailer | Update | Verification | Verify;
type Definition = About | Application | Apply | Approval | Approve | Arrival | Bear | Chat | Count | Departure | Emoji | Gate | Help | Leaderboard | Link | Mission | Outfit | Patch | Patching | Posting | Raw | Record | Refusal | Refuse | Roadmap | Rule7 | Soundtrack | Store | Tracker | Trailer | Update | Verification | Verify;
const about: About = aboutDefinition;
const application: Application = applicationDefinition;
const apply: Apply = applyDefinition;
Expand All @@ -341,8 +341,8 @@ const departure: Departure = departureDefinition;
const emoji: Emoji = emojiDefinition;
const gate: Gate = gateDefinition;
const help: Help = helpDefinition;
const hyperlink: Hyperlink = hyperlinkDefinition;
const leaderboard: Leaderboard = leaderboardDefinition;
const link: Link = linkDefinition;
const mission: Mission = missionDefinition;
const outfit: Outfit = outfitDefinition;
const patch: Patch = patchDefinition;
Expand Down Expand Up @@ -376,8 +376,8 @@ export type {
Emoji,
Gate,
Help,
Hyperlink,
Leaderboard,
Link,
Mission,
Outfit,
Patch,
Expand Down Expand Up @@ -411,8 +411,8 @@ export {
emoji,
gate,
help,
hyperlink,
leaderboard,
link,
mission,
outfit,
patch,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ruleName": "hyperlink",
"ruleName": "link",
"ruleReason": "Flags messages which contain a hyperlink as such in the given channels",
"helpWithChannels": {
"en-US": "I flag messages which contain a hyperlink as such in $<channelMentions>",
Expand Down
8 changes: 4 additions & 4 deletions src/dependencies.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import type DepartureDependency from "./dependencies/departure.js";
import type EmojiDependency from "./dependencies/emoji.js";
import type GateDependency from "./dependencies/gate.js";
import type HelpDependency from "./dependencies/help.js";
import type HyperlinkDependency from "./dependencies/hyperlink.js";
import type LeaderboardDependency from "./dependencies/leaderboard.js";
import type LinkDependency from "./dependencies/link.js";
import type MissionDependency from "./dependencies/mission.js";
import type OutfitDependency from "./dependencies/outfit.js";
import type PatchDependency from "./dependencies/patch.js";
Expand Down Expand Up @@ -44,8 +44,8 @@ type Departure = DepartureDependency;
type Emoji = EmojiDependency;
type Gate = GateDependency;
type Help = HelpDependency;
type Hyperlink = HyperlinkDependency;
type Leaderboard = LeaderboardDependency;
type Link = LinkDependency;
type Mission = MissionDependency;
type Outfit = OutfitDependency;
type Patch = PatchDependency;
Expand All @@ -64,7 +64,7 @@ type Trailer = TrailerDependency;
type Update = UpdateDependency;
type Verification = VerificationDependency;
type Verify = VerifyDependency;
type Dependency = About | Application | Apply | Approval | Approve | Arrival | Bear | Chat | Count | Departure | Emoji | Gate | Help | Hyperlink | Leaderboard | Mission | Outfit | Patch | Patching | Posting | Raw | Record | Refusal | Refuse | Roadmap | Rule7 | Soundtrack | Store | Tracker | Trailer | Update | Verification | Verify;
type Dependency = About | Application | Apply | Approval | Approve | Arrival | Bear | Chat | Count | Departure | Emoji | Gate | Help | Leaderboard | Link | Mission | Outfit | Patch | Patching | Posting | Raw | Record | Refusal | Refuse | Roadmap | Rule7 | Soundtrack | Store | Tracker | Trailer | Update | Verification | Verify;
export type {Dependency as default};
export type {
About,
Expand All @@ -80,8 +80,8 @@ export type {
Emoji,
Gate,
Help,
Hyperlink,
Leaderboard,
Link,
Mission,
Outfit,
Patch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ type HelpWithChannelsGroups = {
channelMentions: () => string,
};
type HelpWithoutChannelsGroups = {};
type HyperlinkDependency = {
type LinkDependency = {
helpWithChannels: HelpWithChannelsGroups,
helpWithoutChannels: HelpWithoutChannelsGroups,
};
export type {HyperlinkDependency as default};
export type {LinkDependency as default};
Binary file removed src/emojis/hyperlink.png
Binary file not shown.
1 change: 0 additions & 1 deletion src/emojis/hyperlink.svg

This file was deleted.

Binary file added src/emojis/link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/emojis/link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
AutoModerationRuleCreateOptions,
} from "discord.js";
import type {Localized} from "./utils/string.js";
import hyperlinkRule from "./rules/hyperlink.js";
import linkRule from "./rules/link.js";
import rule7Rule from "./rules/rule7.js";
type AutoModerationRuleData = Omit<AutoModerationRuleCreateOptions, "exemptChannels" | "exemptRoles" | "actions"> & {
exemptChannels?: string[],
Expand All @@ -24,7 +24,7 @@ type Rule = {
execute(execution: AutoModerationActionExecution): Promise<void>;
describe(autoModerationRule: AutoModerationRule): Localized<(groups: {}) => string>;
};
const hyperlink: Rule = hyperlinkRule;
const link: Rule = linkRule;
const rule7: Rule = rule7Rule;
export type {Rule as default};
export type {
Expand All @@ -33,6 +33,6 @@ export type {
AutoModerationRuleData,
};
export {
hyperlink,
link,
rule7,
};
Loading

0 comments on commit 0cd3a20

Please sign in to comment.