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

250
Views
Why do I get an error when I'm trying to change my Prefix in discord.js?

Whenever I execute the command. I get an error:

UnhandledPromiseRejectionWarning: SqliteError: database disk image is malformed

Here is the full code:

const db = require("quick.db");

module.exports = {
  name: "setprefix",
  description: "Set a server's prefix",

  async run(client, message, args) {
    if (!message.member.hasPermission("MANAGE_MESSAGES"))
      return message.channel.send("You don't have permission to use that.");

    if (!args[0]) return message.channel.send("Please provide a new prefix");

    if (args[1])
      return message.channel.send("The prefix can't have two spaces");

    db.set(`prefix_${message.guild.id}`, args[0]);

    message.channel.send(`Successfully set new prefix to **${args[0]}**`);
  }
};

When I leave it blank it does say "please provide a prefix" but an error occurs when I do enter a prefix. How do I fix this?

about 4 years ago · Juan Pablo Isaza
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!