TypeError: Cannot read properties of undefined (reading 'setFooter')

11 Replies
d.js toolkit
d.js toolkit7mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
awh
awhOP7mo ago
awh
awhOP7mo ago
Paginator
const Discord = require('discord.js')
const { prefix } = require('../../../config.json')

module.exports = {
name: 'prefix',
aliases: ['setprefix', 'prefixset'],
run: async (client, message, args) => {

const guilddata = await client.database(message.guild.id)

const guildprefix = guilddata.Prefix

if (args[0] === 'set') {

if (!message.member.permissions.has(Discord.PermissionsBitField.Flags.ManageGuild)) {

return new client.embed(
message, `Permissions **ManageGuild** are required to run this command.`, 'warning'
)
}

if (!args[1]) {

return new client.help(
message,
{
command: 'prefix set',
description: 'Configure server prefix.',
aliases: 'None',
arguments: 'Prefix',
permissions: 'ManageGuild',
syntax: `${guildprefix}prefix set (text)`,
module: 'Configuration'
}
)
}

const prefixtext = args[1]

if (!prefixtext) {

return new client.embed(
message, `Missing a **Prefix**. Provide one and then run this command again.`, 'warning'
)
}

if (args[2]) {

return new client.embed(
message, `Server **Prefix** cannot contain **Spaces**.`, 'failure'
)
}

if (prefixtext.length > 3) {

return new client.embed(
message, `Server **Prefix** cannot contain more than **3 Characters**.`, 'failure'
)
}

if (guilddata.Prefix) {

guilddata.Prefix = prefixtext

await guilddata.save()

return new client.embed(
message, `Server **Prefix** has been set as \`${prefixtext}\`.`, 'success'
)

} else {

guilddata.Prefix = prefixtext

await guilddata.save()

return new client.embed(
message, `Server **Prefix** has been set as \`${prefixtext}\`.`, 'success'
)
}

} else if (args[0] === 'remove' || args[0] === 'delete' || args[0] === 'clear') {

if (!message.member.permissions.has(Discord.PermissionsBitField.Flags.ManageGuild)) {

return new client.embed(
message, `Permissions **ManageGuild** are required to run this command.`, 'warning'
)
}

if (guilddata.Prefix === prefix) {

return new client.embed(
message, `Couldn't find any **Configured Prefix** within this server.`, 'warning'
)

} else {

guilddata.Prefix = prefix

await guilddata.save()

return new client.embed(
message, `Server **Prefix** has been **Reset** to \`${prefix}\`.`, 'success'
)
}

} else {

return new client.embed(
message, `Guild prefix: \`${guildprefix}\``, 'default'
)
}
}
}
const Discord = require('discord.js')
const { prefix } = require('../../../config.json')

module.exports = {
name: 'prefix',
aliases: ['setprefix', 'prefixset'],
run: async (client, message, args) => {

const guilddata = await client.database(message.guild.id)

const guildprefix = guilddata.Prefix

if (args[0] === 'set') {

if (!message.member.permissions.has(Discord.PermissionsBitField.Flags.ManageGuild)) {

return new client.embed(
message, `Permissions **ManageGuild** are required to run this command.`, 'warning'
)
}

if (!args[1]) {

return new client.help(
message,
{
command: 'prefix set',
description: 'Configure server prefix.',
aliases: 'None',
arguments: 'Prefix',
permissions: 'ManageGuild',
syntax: `${guildprefix}prefix set (text)`,
module: 'Configuration'
}
)
}

const prefixtext = args[1]

if (!prefixtext) {

return new client.embed(
message, `Missing a **Prefix**. Provide one and then run this command again.`, 'warning'
)
}

if (args[2]) {

return new client.embed(
message, `Server **Prefix** cannot contain **Spaces**.`, 'failure'
)
}

if (prefixtext.length > 3) {

return new client.embed(
message, `Server **Prefix** cannot contain more than **3 Characters**.`, 'failure'
)
}

if (guilddata.Prefix) {

guilddata.Prefix = prefixtext

await guilddata.save()

return new client.embed(
message, `Server **Prefix** has been set as \`${prefixtext}\`.`, 'success'
)

} else {

guilddata.Prefix = prefixtext

await guilddata.save()

return new client.embed(
message, `Server **Prefix** has been set as \`${prefixtext}\`.`, 'success'
)
}

} else if (args[0] === 'remove' || args[0] === 'delete' || args[0] === 'clear') {

if (!message.member.permissions.has(Discord.PermissionsBitField.Flags.ManageGuild)) {

return new client.embed(
message, `Permissions **ManageGuild** are required to run this command.`, 'warning'
)
}

if (guilddata.Prefix === prefix) {

return new client.embed(
message, `Couldn't find any **Configured Prefix** within this server.`, 'warning'
)

} else {

guilddata.Prefix = prefix

await guilddata.save()

return new client.embed(
message, `Server **Prefix** has been **Reset** to \`${prefix}\`.`, 'success'
)
}

} else {

return new client.embed(
message, `Guild prefix: \`${guildprefix}\``, 'default'
)
}
}
}
my prefix command.
florentine
florentine7mo ago
what is your discord.js version? to confirm
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
duck
duck7mo ago
while you may be absolutely sure that that's the version you're using, it's important to actually confirm it for us given the number of times people will come through the support channels here mistaking their own version many will also just tag their posts incorrectly for various reasons doing this isn't an assumption you're stupid showing the output from npm ls discord.js is imo a relatively short and simple process that will ensure no time is wasted on a simple mistake
duck
duck7mo ago
yes, this confirms it thank you for cooperating
awh
awhOP7mo ago
cool ping if u can help me
souji
souji7mo ago
@awh stop being a dick to people and they might be more inclined to help
awh
awhOP7mo ago
what lol you clearly read nothing i said before i deleted just shutup you sound stupid being a dick because he asked the same question 40 times and i told him 41 times that the version of js im using is literally tagged on the channel
Want results from more Discord servers?
Add your server