-
Notifications
You must be signed in to change notification settings - Fork 3
feat: replace latex-to-unicode with @devhub-io/latex-to-unicode
#35
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
Changes from all commits
28cde9d
6e708d4
40ebf0d
f14b95f
6023f08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,7 +14,7 @@ const COOLDOWN_SECONDS = 3; | |||||||
| const USER_COOLDOWNS = new Map(); | ||||||||
|
|
||||||||
| export default async (client: Client, message: Message) => { | ||||||||
| if (!message || !message.guild || message.author?.bot) return; | ||||||||
| if (!message || !message.guild || message.author.bot || !client.user) return; | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing optional chaining from Confidence: 4/5 Suggested Fix
Suggested change
Restore the optional chaining operator ( Prompt for AICopy this prompt to your AI IDE to fix this issue locally: |
||||||||
|
|
||||||||
| if ( | ||||||||
| process.env.NODE_ENV?.toLowerCase() === "dev" && | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,10 +1,18 @@ | ||||||||
| import type { Client, Message } from "discord.js"; | ||||||||
| import data from "../../../config.json" with { type: "json" }; | ||||||||
| import askai from "../../commands/ai/askai.ts"; | ||||||||
| import type { CommandCallbackOpts } from "../../types/command.ts"; | ||||||||
|
|
||||||||
| const { devs } = data; | ||||||||
|
|
||||||||
| export default async (client: Client, message: Message) => { | ||||||||
| if (message.author.bot) return; | ||||||||
| if (!client.user) return; | ||||||||
| if (!message || !message.guild || message.author.bot || !client.user) return; | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The guard clause accesses Confidence: 4/5 Suggested Fix
Suggested change
Use optional chaining ( Prompt for AICopy this prompt to your AI IDE to fix this issue locally: |
||||||||
|
|
||||||||
| if ( | ||||||||
| process.env.NODE_ENV?.toLowerCase() === "dev" && | ||||||||
| !devs.includes(message.author.id) | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code calls Confidence: 4/5 Suggested Fix
Suggested change
Add a type check to ensure Prompt for AICopy this prompt to your AI IDE to fix this issue locally: |
||||||||
| ) | ||||||||
| return; | ||||||||
|
|
||||||||
| if (!message.mentions.has(client.user)) return; | ||||||||
|
|
||||||||
|
|
||||||||
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.
The code calls
devs.includes()without verifying thatdevsis actually an array. If thedevsproperty is missing, undefined, or not an array in the config, this will throw a runtime error:TypeError: devs.includes is not a function.Confidence: 4/5
Suggested Fix
Add a type check to ensure
devsis an array before calling.includes(). This prevents runtime errors if the config is malformed or missing thedevsproperty.Prompt for AI
Copy this prompt to your AI IDE to fix this issue locally: