Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

323
Views
TypeError: interaction.options.getString is not a function

I am making a command to enable and disable events and when choosing any options it returns

TypeError: interaction.options.getString is not a function

I dont know why it does this as ive used interaction.options.getString before like how i did below and it works fine

Code:

module.exports = {
    name: 'settings',
    description: 'Toggle Certain Functions',
    timeout: 5000,
    category: 'general',
    options: [
        {
            name: 'action',
            description: 'Action to perform',
            type: 3,
            required: true,
            choices: [
                {
                    name: 'show',
                    value: 'action_show',
                },
                {
                    name: 'enable',
                    value: 'action_enable',
                },
                {
                    name: 'disable',
                    value: 'action_disable',
                },
            ],
        },
        {
            name: 'module',
            description: 'Module to toggle',
            type: 3,
            required: true,
            choices: [
                {
                    name: 'all',
                    value: 'module_all',
                },
                {
                    name: 'premium',
                    value: 'module_starboard',
                },
                {
                    name: 'logging',
                    value: 'module_logging',
                },
            ],
        },
    ],

    run: async (client, interaction) => {
        const actions = interaction.options.getString('action');
        const modules = interaction.options.getString('module');

        if (actions === action_show) {
            if (modules === module_all) {
        // CODE
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

What version of DiscordJS are you on? Some older versions use different options systems.

You can update your version by running:

npm i discord.js@latest

or

yarn upgrade discord.js
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!