I am trying to create a voting channel where the YAGPDB bot will automatically react "👍" and "👎" to every message posted in that particular channel. And people will be able to react only one of them. Can someone advise on how to do it?
I was able to write the code this far:
{{addMessageReactions nil $.Message.ID ":thumbsup:" ":thumbsdown:"}}
On the Role Command category under Role Commands, just set it to Mode: Single
Related
I have a bot, and I want to use it to send a animated emoji.
I have the emoji ID, <:rgb_lego:993606148580184154>
but whenever I make it send the message, it just says
Pong! 🏓 The round trip took 76ms. ⚡:rgb_lego:
what am I doing wrong?
It depends on what server (guild) you sent it and how exactly you do it.
Guess you need to check & fetch the requested custom emojie from server and then sent it.
You might wanna check Discord.js docs for that. But if I remember it correctly, emojies should be accessed by bot via:
client.guild.emojis.[methodName] via GuildEmojiManager
The second problem could be relevant to the server, where you want to sent it, doesn't have the required emojie, so in that case it has been delivered as a text ref, not an emojie itself or the bot account doesn't have premium features required for using emojies or so on.
I want to change my bot's nickname which do not need to put in some thing like client.on("ready" or "message"
So far I've tried:
client.user.setNickname()
client.setNickname()
I've seen someone having a bot which changes its avatar and nickname continuously and I have no idea about their algorithm. (When I click the bot to view its profile it didn’t display anything)
If you want to have a look at the bot: https://discord.gg/pz8S2hrRnf
#server-bridge
You cannot set the nickname on the user property, but you can on a GuildMember.
As #Zsolt Meszaros said, you would have to use <Guild>.me.setNickname()
See more details at the docs here.
I am trying to match bot's embed color and it's role color. So far I found only this solution, but instead of a user's role color I want bot's color:
.setColor(message.member.displayHexColor)
I was trying to target the bot with message.author.bot but that doesn't work either.
I think that message.guild.me.displayHexColor is what you are looking for. guild.me returns bot user as a member of a current guild.
Technically, a bot is also a 'user' but at the very least a member of the server; context is important here.
Do you pick a member specifically or only when they do a command?
If it's the former, you can try the same thing you did with
.setColor(message.member.displayHexColor)
but choose the bot as member instead
So im working on a discord bot, and working on a command where it mentions a user. For example: -fakekick #user and the bot would say User has been kicked I've read through the docs and found a few sites but I couldn't really understand it as I just started discord js a few days ago. Thanks
To get the user object of a mentioned user, you can very simply use the mentions extension of the message object. We can very simply use it in order to define our user, and later on, mention him in a future message. That can be done very simply as so:
const user = message.mentions.users.first(); // Would get the first mentioned user's object
message.channel.send(`${user} has been kicked!`); // To mention a user, you simply need to mention his user object.
So I have only found answers to this question for discord.js with commando which won't work with just discord.js
I want to limit an automated reaction to any attachment send in one channel. (And only in that one channel.) So doing it with roles won't work.
Kind regards Per.
If you want that a command can only be done in a certain channel you can check if the id of the channel were the message was sent is the id you have stored to allow the command to be done
if(message.channel.id === 'id of channel'){
//code of command
}