awh
awh
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
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
28 replies
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
just shutup you sound stupid
28 replies
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
you clearly read nothing i said before i deleted
28 replies
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
what lol
28 replies
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
ping if u can help me
28 replies
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
cool
28 replies
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
28 replies
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
my prefix command.
28 replies
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
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'
)
}
}
}
28 replies
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
Paginator
28 replies
DIAdiscord.js - Imagine an app
Created by awh on 4/20/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'setFooter')
28 replies