#help
1 messages · Page 1 of 1 (latest)
remove ownerId in line 7
line 26 (await guild.fetchOwner()).user.tag
@frigid night
ok
Documentation suggestion for @frigid night:
<:_:874569335308431382> Guild#fetchOwner()
Fetches the owner of the guild. If the member object isn't needed, use [Guild#ownerId](<https://discord.js.org/#/docs/discord.js/stable/class/Guild?scrollTo=ownerId>) instead.
read that
@lone night value: \``${(await guild.fetchOwner()).user.tag}````,
^^^^^
SyntaxError: Unexpected identifier
getting error
use
https://srcb.in/JJ9s6SMNf9 @lone night correct?
i alr say him before but he till send like others
getting error
Can I speak here other language?
i'm asking what is error
not the code
huh
In where?
value: `\`\`\`${(await guild.fetchOwner()).user.tag}\`\`\``,
^^^^^
SyntaxError: Unexpected identifier
In this thread
what language want u say?
use js \` 1 only
Russian, how he does
Emm up to you
yea
it is
i think the problem is not in " "
just the code
help
Try to define it before add fields
ok
no dude
It's not about this `
its in the code
the line you sent me
does await works in field value?
@lone night
Did you tried my way?
work
console.log(await guild.fetchOwner())
^^^^^
SyntaxError: missing ) after argument list
@mint timber
Not log, define const owner = await guild.fetchOwner();
ok
const owner = await guild.fetchOwner()
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
@mint timber
thx but it still showing just id @mint timber
Hm
@mint timber help meh
Send again
owner.user.tag
ok
yes
OOOOO TY
how u know
Id
o sorry
Its not russian
so??
Its mongolian
oh
I can know all
Wait
okk
can u help him first? i still eating
yall best ❤️
You are trying to get number of text channels or all of it?
number of
.size add it
{
name: 'Нийт ангилал',
value: `\`\`\`${channels.cache.filter((c) => c.type === 'GUILD_CATEGORY')}\`\`\``,
inline: true,
},
{
name: 'Нийт текст суваг',
value: `\`\`\`${channels.cache.filter((c) => c.type === 'GUILD_TEXT')}\`\`\``,
inline: true,
},
{
name: 'Нийт дуут суваг',
value: `\`\`\`${channels.cache.filter((c) => c.type === 'GUILD_VOICE')}\`\`\``,
inline: true,
},
{
name: 'Нийт мэдээллийн суваг',
value: `\`\`\`${channels.cache.filter((c) => c.type === 'GUILD_NEWS')}\`\`\``,```
but in tutorial video it works without .size xD
djs v?
13
Of tutorial
but it working fine with .size
13
yeah xD
tyt ty ❤️
But you'll get all cached channels, thats mean if no one send message into channel after bot starts it won't be added to cache
Sorry, I don't worked with buttons
oke it's ok before i want try if someone press his profile will add to database
And which help do you need? Working with database?
Or click interaction doesn't works well?
I click interaction it send msg but it didnt update
to my db
You are using mongo?
You can?
Send code
Its sends msg.channel.send({ content: You successfully registered!, Try \c!help` for more information!`})?
Yes
hm
db.collection.findOneAndUpdate( filter, update, options )
collection what its do?
OH YA I FORGET
thx to remind
?
Hmm?
/home/sku14k/skune/commands/setnick.js:40
await message.author.setNickname(nickNeme)
^
TypeError: message.author.setNickname is not a function
at Object.execute (/home/sku14k/skune/commands/setnick.js:40:28)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
I'm getting this error
I wanted to make set self nick and set mentioned member's nick
You need to get member
yes
Author returns user
Like if i type
why u use message.author
!setnick [Nickname] - It changes my nickname
!setnick [@MentionMember] [Nickname] - It changes mentioned member's nickname
I wanted this
await mentionedMember.setNickname(nickNeme)
u need use u declare
mentionedMember.setNickname
But I didn't mentioned any member in that line
so make
It should change my nick name if I didn't mention member
I thought it would change my nickname
Wdym?
he want if he didnt tag anyone will change his name
I want this
message.member will return author ad member
but he defined the perms change nicname
message.mentions.members.first() will return mentioned
Not that
he meant
if he didnt tag anyone for !setnick
his nick change
Guys I want this xD
Just check
<:_:874569296821501952> Permissions (extends BitField)
Data structure that makes it easy to interact with a permission bitfield. All [GuildMember](<https://discord.js.org/#/docs/discord.js/stable/class/GuildMember>)s have a set of permissions in their guild, and each channel in the guild may also have [PermissionOverwrites](<https://discord.js.org/#/docs/discord.js/stable/class/PermissionOverwrites>) for the member that override their default permissions.
If there waz a mention
Try to fix
not ask people to fix
i get it
make 2 perms
CHANGE_NICKNAME, MANAGE_NICKNAMES
but that will ned 2
so u can change ur own name
remove else line 20
like
if the before is
if(!..)
later if u use else it become if(..)
if (!message.member.permissions.has('CHANGE_NICKNAME')) {
const banError = new MessageEmbed()
.setColor('#679ad8')
.setDescription(`\`\`\`Танд setnick команд ашиглах permission байхгүй байна.\`\`\``)
.setFooter({ text: '© 2022 14K' })
return message.channel.send({ embeds: [banError] }).then(m => { setTimeout(async () => { await m.delete(); await message.delete() }, 15000) })
}
if (!message.guild.me.permissions.has('MANAGE_NICK')) {
const permsEmbed = new MessageEmbed()
.setColor('#679ad8')
.setDescription(`\`\`\`Надад setnick командыг ажиллуулах permission байхгүй байна.\`\`\``)
.setFooter({ text: '© 2022 14K' })
return message.channel.send({ embeds: [permsEmbed] }).then(m => { setTimeout(async () => { await m.delete(); await message.delete() }, 15000) })
}
like this?
i removed else
what
so do i have to delete top one?
ye
/home/sku14k/skune/commands/setnick.js:34
await message.author.setNickname(nickNeme)
^
TypeError: message.author.setNickname is not a function
at Object.execute (/home/sku14k/skune/commands/setnick.js:34:28)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
getting this error again
message.author to what?
do i have to add try { }. and catch? @lone night
i alr say before
bruhhh
@frigid night
ok
/home/sku14k/skune/commands/setnick.js:34
await mentionedMember.setNickname(nickNeme)
^
TypeError: Cannot read properties of undefined (reading 'setNickname')
at Object.execute (/home/sku14k/skune/commands/setnick.js:34:29)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
still getting xD
remove (nickNeme)
ur args can't be same remember
then remove (nickNeme)
Don't make advance command if you can't the basic one @frigid night !
im confused
/home/sku14k/skune/commands/setnick.js:33
await mentionedMember.setNickname(nickName)
^
TypeError: Cannot read properties of undefined (reading 'setNickname')
at Object.execute (/home/sku14k/skune/commands/setnick.js:33:29)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
still getting error
remove dont replace?
@mint timber try help him i tired alr
i alr said REMOVE THE (nickName)
/home/sku14k/skune/commands/setnick.js:33
await mentionedMember.setNickname
^
TypeError: Cannot read properties of undefined (reading 'setNickname')
at Object.execute (/home/sku14k/skune/commands/setnick.js:33:29)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
removed
but still getting
wtf
here
declare mentionedMember
home/sku14k/skune/commands/setnick.js:34
await mentionedMember.setNickname
^
TypeError: Cannot read properties of undefined (reading 'setNickname')
at Object.execute (/home/sku14k/skune/commands/setnick.js:34:29)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
getting error
pls help
@lone night 🥺
Hmm
@frigid night
im stucked
const member = message.member
const nick = args[0]
if(message.mentions.members.first()){
member = message.mentions.members.first()
nick = args[1]
}
And then cgange members nickname to name
@mint timber
/home/sku14k/skune/node_modules/discord.js/src/rest/RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Missing Permissions
at RequestHandler.execute (/home/sku14k/skune/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/sku14k/skune/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async GuildMemberManager.edit (/home/sku14k/skune/node_modules/discord.js/src/managers/GuildMemberManager.js
:279:15)
at async Object.execute (/home/sku14k/skune/commands/setnick.js:33:7) {
method: 'patch',
path: '/guilds/931949236898103366/members/285098453808447490',
code: 50013,
httpStatus: 403,
requestData: {
json: { nick: 'a', communication_disabled_until: undefined },
files: []
}
}
code here
Your bot have not permssions to change name
Bot have admin perms
and have manage nickname perms
Idk
@mint timber
home/sku14k/skune/node_modules/discord.js/src/rest/RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Missing Permissions
at RequestHandler.execute (/home/sku14k/skune/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/sku14k/skune/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async GuildMemberManager.edit (/home/sku14k/skune/node_modules/discord.js/src/managers/GuildMemberManager.js
:279:15) {
method: 'patch',
path: '/guilds/931949236898103366/members/285098453808447490',
code: 50013,
httpStatus: 403,
requestData: {
json: { nick: 'b', communication_disabled_until: undefined },
files: []
}
}
I'm stucked @mint timber
The code changing other user's nickname but not changing my nickname and giving me error
bot's role is highest
have all permissions
but still giving me errors
He can't change owners nickname
oh why
oh
does it changed
in v12
bot was changing my nickname
nvm
how to make this can change mentioned user's nickname and author's nickname
wdym?
is this correct
like if type
!setnick [Nickname] - It changes my nickname
!setnick [@Mention Member] [Nickname] - It changes mentioned member's nickname
nvm i made it
hi
/home/sku14k/skune/node_modules/discord.js/src/rest/RequestHandler.js:350
throw new DiscordAPIError(data, res.status, request);
^
DiscordAPIError: Missing Permissions
at RequestHandler.execute (/home/sku14k/skune/node_modules/discord.js/src/rest/RequestHandler.js:350:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/sku14k/skune/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
at async GuildMemberManager.edit (/home/sku14k/skune/node_modules/discord.js/src/managers/GuildMemberManager.js
:279:15) {
method: 'patch',
path: '/guilds/931949236898103366/members/285098453808447490',
code: 50013,
httpStatus: 403,
requestData: {
json: { nick: 'a', communication_disabled_until: undefined },
files: []
}
}
I'm getting this error when I try to change my nickname
Does it means bot owner can't change their nickname by their bots?
or is it means server owner's can't change their nickname by bot?
oh it's bot cant change server owner's nickname
so how to add if bot's role lower than owner's can't run the command?