-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add /repel command to timeout users and delete recent mesages #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…sages from public channels
…s and cache on start)
const checkCanRepel = ({ | ||
commandUser, | ||
repelRole, | ||
}: { | ||
commandUser: GuildMember; | ||
repelRole: Role; | ||
}): { | ||
ok: boolean; | ||
message?: string; |
There was a problem hiding this comment.
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
};
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
const checkCanRepelTarget = ({ | ||
target, | ||
commandUser, | ||
botMember, | ||
}: { | ||
target: User | GuildMember; | ||
commandUser: GuildMember; | ||
botMember: GuildMember; | ||
}): { | ||
ok: boolean; | ||
message?: string; |
There was a problem hiding this comment.
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
…ed channels in message deletion function
… Promise.allSettled
No description provided.