Skip to content

Commit

Permalink
Merge pull request #16 from komotok/patch-1
Browse files Browse the repository at this point in the history
Update messageCreate.ts - Remove old references
  • Loading branch information
Noxturnix authored Jan 7, 2024
2 parents 8d36b2e + a42a682 commit baf5815
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/event/messageCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export default (message: Message) => {
// Message is sent to guild
if (message.member) {
let messageCommandTriggered = false;
let messageAuthorIsDev = false;
let messageAuthorIsStaff = false;
let messageAuthorIsAdmin = false;

// Check message author role level
message.member.roles.cache.map((role) => {
if (roleId.devRoleIds.includes(role.id)) messageAuthorIsDev = true;
if (roleId.staffRoleIds.includes(role.id)) messageAuthorIsStaff = true;

Check failure on line 32 in src/event/messageCreate.ts

View workflow job for this annotation

GitHub Actions / code-check

Property 'staffRoleIds' does not exist on type '{ devRoleIds: string[]; adminRoleIds: string[]; }'.
if (roleId.adminRoleIds.includes(role.id)) messageAuthorIsAdmin = true;
});

Expand All @@ -53,8 +53,8 @@ export default (message: Message) => {
messageCommandTriggered = true;

if (
!(messageCommand.isDevCommand || messageCommand.isAdminCommand) ||
(messageCommand.isDevCommand && (messageAuthorIsAdmin || messageAuthorIsDev)) ||
!(messageCommand.isStaffCommand || messageCommand.isAdminCommand) ||

Check failure on line 56 in src/event/messageCreate.ts

View workflow job for this annotation

GitHub Actions / code-check

Property 'isStaffCommand' does not exist on type 'MessageCommand'.
(messageCommand.isStaffCommand && (messageAuthorIsAdmin || messageAuthorIsStaff)) ||

Check failure on line 57 in src/event/messageCreate.ts

View workflow job for this annotation

GitHub Actions / code-check

Property 'isStaffCommand' does not exist on type 'MessageCommand'.
(messageCommand.isAdminCommand && messageAuthorIsAdmin)
) {
let commandArgs = trimmedMessage
Expand All @@ -68,7 +68,7 @@ export default (message: Message) => {
args: commandArgs,
matchedCommand: command,
fromBot: message.author.bot,
isDev: messageAuthorIsDev,
isStaff: messageAuthorIsStaff,

Check failure on line 71 in src/event/messageCreate.ts

View workflow job for this annotation

GitHub Actions / code-check

Type '{ message: Message<boolean>; args: string[]; matchedCommand: string; fromBot: boolean; isStaff: boolean; isAdmin: false; }' is not assignable to type 'MessageCommandFunctionCall'.
isAdmin: messageAuthorIsAdmin
};

Expand Down Expand Up @@ -98,9 +98,9 @@ export default (message: Message) => {

if (messageLowerNoEmoji.includes(containString.toLowerCase())) {
if (
!(messageContain.isDevContain || messageContain.isAdminContain) ||
(messageContain.isDevContain && (messageAuthorIsAdmin || messageAuthorIsDev)) ||
(messageContain.isAdminContain && messageAuthorIsAdmin)
!(messageContain.isStaffContain || messageContain.isAdminContain) ||

Check failure on line 101 in src/event/messageCreate.ts

View workflow job for this annotation

GitHub Actions / code-check

Property 'isStaffContain' does not exist on type 'MessageContain'.
(messageContain.isStaffContain && (messageAuthorIsAdmin || messageAuthorIsStaff)) ||

Check failure on line 102 in src/event/messageCreate.ts

View workflow job for this annotation

GitHub Actions / code-check

Property 'isStaffContain' does not exist on type 'MessageContain'.
(messageContain.isAdminContain && messageAuthorIsStaff)
) {
containFunction = messageContain.fn;

Expand All @@ -114,7 +114,7 @@ export default (message: Message) => {
message,
matchedContain: containString,
fromBot: message.author.bot,
isDev: messageAuthorIsDev,
isStaff: messageAuthorIsStaff,

Check failure on line 117 in src/event/messageCreate.ts

View workflow job for this annotation

GitHub Actions / code-check

Type '{ message: Message<boolean>; matchedContain: string; fromBot: boolean; isStaff: boolean; isAdmin: false; }' is not assignable to type 'MessageContainFunctionCall'.
isAdmin: messageAuthorIsAdmin
};

Expand Down

0 comments on commit baf5815

Please sign in to comment.