Skip to content

Commit

Permalink
Merge pull request #61 from Mickhat/Mickhat-patch-4
Browse files Browse the repository at this point in the history
Update message.ts
  • Loading branch information
Mickhat authored Dec 30, 2023
2 parents 7dc3365 + 8cdd4c9 commit 07c8a78
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/listeners/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ import {
} from "discord.js"
import { ILogger } from "../logger/logger"

// Function to handle the :kekw: reaction
async function kekwReact(msg): Promise<void> {

Check failure on line 13 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / build-and-push-image (18.x)

'kekwReact' is defined but never used

Check failure on line 13 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / build-and-push-image (18.x)

Missing space before function parentheses

Check failure on line 13 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / docker (18.x)

'kekwReact' is defined but never used

Check failure on line 13 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / docker (18.x)

Missing space before function parentheses
const kekwEmojiId = '1185517935905734796'; // The ID of the :kekw: emoji

Check failure on line 14 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / build-and-push-image (18.x)

Extra semicolon

Check failure on line 14 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / docker (18.x)

Extra semicolon
const kekwEmoji = msg.guild?.emojis.cache.get(kekwEmojiId);

Check failure on line 15 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / build-and-push-image (18.x)

Extra semicolon

Check failure on line 15 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / docker (18.x)

Extra semicolon

if (kekwEmoji && msg.content.includes(`<:${kekwEmoji.name}:${kekwEmoji.id}>`)) {

Check failure on line 17 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / build-and-push-image (18.x)

Invalid type "any" of template literal expression

Check failure on line 17 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / build-and-push-image (18.x)

Invalid type "any" of template literal expression

Check failure on line 17 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / docker (18.x)

Invalid type "any" of template literal expression

Check failure on line 17 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / docker (18.x)

Invalid type "any" of template literal expression
// More varied random chance
if (Math.random() < 0.3) { // Adjust the probability as needed
await msg.react(kekwEmoji);

Check failure on line 20 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / build-and-push-image (18.x)

Extra semicolon

Check failure on line 20 in src/listeners/message.ts

View workflow job for this annotation

GitHub Actions / docker (18.x)

Extra semicolon
}
}
}

function isGreeting (msg: string): boolean {
const greetings = ["hallo", "hi", "hey", "moin", "moin moin", "servus", "guten morgen", "guten tag", "guten abend", "wuhu", "nabend"]
const msgLower = msg.toLowerCase()
Expand Down

0 comments on commit 07c8a78

Please sign in to comment.