Issue with JSON encoding in Embed message/interaction reply in Discord.js v14

I am currently utilizing Discord.js version 14.8, which was developed in typescript. Here is a snippet from my package.json file:

  "dependencies": {
    "@discordjs/rest": "^1.1.0",
    "@supabase/supabase-js": "^2.25.0",
    "@types/node": "^18.7.14",
    "discord.js": "14.8.0",
    "dotenv": "^16.0.2",
    "express": "^4.18.2",
    "fs": "^0.0.1-security"
  },
  "devDependencies": {
    "@types/express": "^4.17.17",
    "typescript": "^4.9.5"
  },
  "overrides": {
    "discord-api-types": "0.37.20"
  }

I'm running into issues with my /help command and even regular commands like !help. Below is the code snippet for the /help command:

import { SlashCommandBuilder, ChannelType, TextChannel, EmbedBuilder } from "discord.js"
import { getThemeColor } from "../functions";
import { SlashCommand } from "../types";

const command : SlashCommand = {
    command: new SlashCommandBuilder()
    .setName("help")
    .setDescription("Shows bot information")
    ,
    execute: interaction => {
        // Code implementation here
    },
    cooldown: 30
}

export default command

The error message I'm receiving is as follows:

this is the error:
// Error details here

Interestingly, the /ping command is functioning perfectly fine:

import { SlashCommandBuilder, ChannelType, TextChannel, EmbedBuilder } from "discord.js"
import { getThemeColor } from "../functions";
import { SlashCommand } from "../types";

const command : SlashCommand = {
    command: new SlashCommandBuilder()
    .setName("ping")
    .setDescription("Displays bot ping/latency")
    ,
    execute: interaction => {
        // Code implementation here
    },
    cooldown: 30
}

export default command

Answer №1

The problem has been resolved in Discord.js version 14.10.2

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is preventing me from being able to use object spread results in TypeScript casting?

Uniqueness in Question My inquiry was not aimed at identifying the type or class name of an object. Rather, it delved into the concept of "casting" an object to a specific type, which arose from a misconception about TypeScript and its functionality. This ...

Using ion-list with multiple *ngFor loops

I am trying to combine data from two arrays, "subtitles" and "title", into an ion-list so that each ion-item displays a title on top of a subtitle. How can I achieve this? In my .ts file: items = [ 'Email', 'Phone Number', 'Add ...

Methods for resolving a ViewStyle typescript issue in react native

Trying to pass a width parameter into StyleSheet is causing an error like this: <View style={styles.children(width)}>{children}</View> Here's how I'm trying to use it: const styles = StyleSheet.create({ modalContent: { flex: ...

I'm having trouble incorporating TypeScript into my React useState hooks. Can someone help me troubleshoot?

I've been encountering challenges when trying to integrate Typescript into my React code, especially with the useSate hooks. I've dedicated several days to researching how to resolve this issue, but I'm uncertain about what should be passed ...

I'm currently working on building a fresh window with Tauri 1.2, combining the powers of Rust, React, and Typescript. However, I've encountered a few

Utilizing Tauri's WindowBuilder in Rust, I attempted to create a new window. Despite successfully generating a blank window, I encountered challenges: The inability to display any content on the window The failure to close the window Being relativel ...

Downloading fonts from Google Fonts is always a struggle when using Next.js

After initializing a fresh Next.js project using create-next-app, I managed to successfully launch it with npm run dev. However, an issue arises every time Next.js boots up, displaying the following error: FetchError: request to https://fonts.gstatic.com/ ...

Typescript - any of the types imported from a module

Currently, my code looks like this: import * as Types from '../schema/types'; and I'm looking to achieve something along the lines of: let a: Types; This would signify that a should be one of the various types exported from the file types. ...

Retrieving document attributes from a Mongoose Model with the help of Typescript

Incorporating Typescript with Mongoose, my aim is to retrieve properties from a Model. Taking the illustrated UserModel as an example import mongoose, { Schema } from 'mongoose'; const userSchema: Schema = new mongoose.Schema({ _id: mongoos ...

Expand the data retrieved from the database in node.js to include additional fields, not just the id

When creating a login using the code provided, only the user's ID is returned. The challenge now is how to retrieve another field from the database. I specifically require the "header" field from the database. Within the onSubmit function of the for ...

Having trouble with Angular 2 @input binding?

Parent module: import {NgModule} from '@angular/core'; import {SharedModule} from "app/shared/shared.module.ts"; import {HeaderComponent} from './header.component'; import {UserinfoComponent} from './userinfo.component'; imp ...

What is the best way to include a TypeScript property within a JavaScript code?

I am currently attempting to utilize a typescript property known as this.data with the assistance of the executescript() method from the InAppBrowser plugin. However, I am encountering an issue where the property is returning undefined instead of 'tes ...

export keyword in TypeScript disassociates the interface implementation from a class

Currently, I am facing an issue with my files. I have a .ts file that contains a class declaration, and a .d.ts file that contains an interface declaration. An example from the .ts file: class A { constructor() { this.name = "Jo"; } } A ...

Transform an array of Boolean values into a string array containing only the values that are true

Suppose we have an object like the following: likedFoods:{ pizza:true, pasta:false, steak:true, salad:false } We want to filter out the false values and convert it into a string array as shown below: compiledLikedFoods = ["pizza", "steak"] Is t ...

Encountering a 405 HTTP error in Angular8 app when refreshing the page

Currently, I am working on a project using Angular8 and .NET Core 3.0 in Visual Studio. Everything is running smoothly except for one issue that arises when I press F5 on a page with a form. The error message that pops up reads: Failed to load resource: ...

Can you explain the significance of Angular 2 hashtags within a template?

Currently exploring Angular 2 and stumbled upon the following code: <input #searchBox (keyup)="search(searchBox.value)" Surprisingly, it works! Despite its functionality, the significance of #searchBox eludes me. Extensive research in the documentati ...

Leveraging the power of react-hook-form in combination with the latest version 6 of @mui

When using MUI v5 date pickers, I utilized the following method to register the input with react-hook-form: <DatePicker ...date picker props renderInput={(params) => { return ( <TextField {...params} ...

My reselect function seems to be malfunctioning - I'm not receiving any output. Can anyone help me

I'm looking to implement reselect in my code to retrieve the shopping cart based on product ids. Here's my reselect.ts file: import { createSelector } from "reselect"; import { RootState } from "../store"; export const shopp ...

Encountering an issue during the initialization of the Google Passportjs

I recently made the switch from JavaScript to TypeScript in my server project and I'm currently tidying up some code. I decided to combine my Google Passport OAuth stuff and login routes into a single file, but it seems like I've broken something ...

Provide details on the final parameters

After creating my discord.js bot, I had the idea to implement a translator feature. To achieve this, I need to extract the last argument from incoming messages. client.on("message", async (message, args) => { if (message.content.startsWith(` ...

Tips for effectively utilizing URLSearchParams in Angular 5 HttpClient's "get" function

When working with Angular 4.2, I used the Http service and made use of the get method by passing in a URLSearchParams object as the search parameter: this.http.get(url, {headers: this.setHeaders(), search: params}) Now I am looking to upgrade to Angular ...