Skip to content

feat: add /repel command to timeout users and delete recent mesages#11

Merged
hmd-ali merged 17 commits into
mainfrom
feat/repel
Oct 19, 2025
Merged

feat: add /repel command to timeout users and delete recent mesages#11
hmd-ali merged 17 commits into
mainfrom
feat/repel

Conversation

@hmd-ali
Copy link
Copy Markdown
Contributor

@hmd-ali hmd-ali commented Oct 17, 2025

No description provided.

@hmd-ali hmd-ali requested a review from wiktoriavh October 17, 2025 17:38
@hmd-ali hmd-ali changed the title Feat/repel feat: add /repel command to timeout users and delete recent mesages Oct 18, 2025
Comment thread .env.example
Comment thread .env.example Outdated
Comment thread src/commands/moderation/cache-messages.ts Outdated
Comment on lines +33 to +41
const checkCanRepel = ({
commandUser,
repelRole,
}: {
commandUser: GuildMember;
repelRole: Role;
}): {
ok: boolean;
message?: string;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you create a type for this function instead of having it be inline?

example:

type Foo = ({ bar: string; }) => boolean;

const foo: Foo = ({ bar }) => {
  // stuff
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it need to be a type in this case? the type won't be reused anywhere else

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's for readability, it's alright if it's not being reused.

Comment on lines +52 to +62
const checkCanRepelTarget = ({
target,
commandUser,
botMember,
}: {
target: User | GuildMember;
commandUser: GuildMember;
botMember: GuildMember;
}): {
ok: boolean;
message?: string;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here for the function type

Comment thread src/commands/moderation/repel.ts Outdated
Comment thread src/commands/moderation/repel.ts
Comment thread src/commands/moderation/repel.ts
Comment thread src/util/cache.ts Outdated
Comment thread src/util/commands.ts
wiktoriavh
wiktoriavh previously approved these changes Oct 18, 2025
@hmd-ali hmd-ali merged commit d0a845b into main Oct 19, 2025
1 check passed
@wiktoriavh wiktoriavh deleted the feat/repel branch October 19, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants