Discord.js embeds not showing users correctly - discord

EDIT: Apparently it's a client-side issue so not really an issue with the code
I have an application system but the user name/tag doesn't show up right sometimes
is there any way I could fix this or is it a discord issue?
It only works with some members plus it makes it a bit inconvenient to find the user that submitted the application
Sometimes it looks like this (which is wrong)
and sometimes it looks like this
I would do something like
// Create our application, we will fill it later
const application = new MessageEmbed()
.setTitle("New Application")
.setDescription(`This application was submitted by ${member}/${member.user.tag}`)
.setColor("#ED4245");
but that feels like something very stupid to do and probably would get killed by someone who has more knowledge than me with bots šŸ˜‚

TL;DR : Using approach you thought of is absolutely fine and this only happens when a user isn't available to the guild or hasn't occured to the individual seeing the channel before
Usually if the user hasn't been seen before ( condition like channel access and unavailable to that guild may also apply ) by the individual viewing the channel the ID may show as is like in your case, that is due to discord maintaining only users ever seen by the individual ( this is client side not from Discord itself) to overcome this you may just add the username of the individual at the top of the application
<member>.user.tag
As you answered yourselves! Not to worry though! That's what a smart developer would think of!
Please make sure that if the user has a nickname it's a better approach to use <#!userID>, explained here in <#userID> vs. <#!userID>, discord.js auto-parses that mention for you so in your case it's probably just one of the cases I mentioned above for which the user remains uncached at client side.

You can get the discord user id and tag the user by using
<#insert user id here>

Related

Automatically send messages as current user in discord

I'm new to discord.js but I would like to understand. Is it possible to achieve a functionality that would send message as my current user?
I mean for example I'm normal user on a discord server and I want to send randomly some jokes every day once. But this should happen from my current user, which has the discord name.
I know I can have a bot created and registered, but this is another approach I think.
My questions are: Is this achievable with discord.js or not really? Is this functionality achiavable at all? And where do I begin?
Thanks for any help.
It is possible. It's just like making a discord BOT. But rather than making a bot application and using its token, you just use YOUR token.
This is purely for educational purposes only, and you shouldn't use it for anything else. Everything is possible, especially with discord.js.
What you are describing is a "self-bot", and is against the Terms of Service. As such, it is not supported.
Discord has made an announcement regarding self-bots before.
Here is a relevant excerpt:
Automating normal user accounts (generally called "self-bots") outside
of the OAuth2/bot API is forbidden, and can result in an account
termination if found.

Copy Reactions To Discord Messages

We made a mistake on our Discord server by using a free tool for managing roles. I won't mention it by name. The tool doesn't allow us to edit the original embed that contains all of the emojis and associated roles. As well, Discord doesn't seem to allow you to edit another user's messages, even if you own the server. And that makes good sense.
So what we're left with is creating a new roles message that looks like the old one and adding the reactions to it. However, we don't want everyone to have to go back and redo their reactions since moving the message wouldn't do anything to their existing roles. We still want to be able to see who reacted to the original message, and preferably be able to transfer the original reactions. I would like to know if it is possible to copy the old reactions over to the new message. I kind of think that Discord won't allow it in keeping with the model that you can't do something that a user would do for themselves. But I thought I would ask here first.
Our server management bot is built using JDA and runs on a Linux server.
No it's not possible to transfer over Discord reactions to a different message.
Use better botsite that can edit embed message or bot message
you can create here: https://botghost.com/?invite=981659393298923621
Go to embed builder and try to make a new post there and read how to edit bot post that you posted using this botghost

How can I program a bot to check to see if a user is on a specific website?

I have an official Discord server for a game and I want this bot to check to see if the user is on the game's website; if they are, they are given the role 'Currently Playing'; and when they come off the site, the role is removed.
I don't know if this is possible, but this would be extremely useful for so many people.
I don't think it will be possible without asking for more information, by design. It would be a privacy issue if you could.
Theoretically you could do it by having them type their username for the game or steam or whatever into the chat like
/gamebot #myusername
Now your bot could read that and now associate the discord account with the gamer account. You would then need an API from the game that's shows who is active and the bit can now know.
My interpretation of this question is that
If a player is on OnYourWebsite.com
It would say in their roles playing OnYourWebsite
This wouldn't really be possible unless you own the website or you are developing it. You could do this by using the Discord API this will let you create a discord sign in option.
Correct me if I am wrong,
but to directly check if a User is on a Website, you need the UserĀ“s IP address.
And you canĀ“t get a MemberĀ“s IP address on Discord.
Another way could be rich presence, I know there are Rich Presences for Websites like YouTube, but I donĀ“t know how they work.
Here is an example:
https://github.com/PreMiD/PreMiD
You need to install a Addon and install a program.
In this case, the Server Members would have to install a Addon and download a Programm , which you would have to program.
But, I dont know more about this topic.
This is all I have got.
(I would have commented this, but I donĀ“t have enough reputation.)

Facebook Messenger bot: 1st interaction different to subsequent for same command?

Does anyone know if it's possible to return a different message etc to the chat user if it's the very first time they are interacting with the bot?
For instance, if a user says "hello" (or anything) for the very first time, the bot might respond with, "Hello there!"
If a user says hello some time later, the bot might respond with "Hello, again!"
Looking through the developer docs I'm struggling to find an answer: https://developers.facebook.com/docs/messenger-platform
For context, I'm also using the https://api.ai service.
One way to accomplish this is to set up a "get started" button:
https://developers.facebook.com/docs/messenger-platform/messenger-profile/get-started-button
This might also be helpful:
https://developers.facebook.com/docs/messenger-platform/messenger-profile/greeting-text
(But I haven't used it myself, so I'm not sure what it does.)
Also, as already mentioned, you can store user data in your own database, and send a greeting message if you can't find the user there already.
This would currently not be possible with API.ai out of the box, you'd have to build a custom webhook that would save the user id to database and check it on new session.
As a (very) hacky workaround you could try outputting a context after the first hello and each and every other intent you use inputs and outputs that context, essentially remembering the user has talked to the bot via a 'permanent' context.

Facebook Messenger: Is it Possible to Initiate Chat With Parameters?

Back in the day Facebook used to let you define URLs that were something like http://facebook.com/send_a_message/user/55/pre_fill/Hi there. When you clicked that link Facebook would open up its Messenger with a "Hi there" message ready to be sent to user 55.
But then Facebook decided that "pre-filling" was bad, and outlawed it across all their APIs. Now there are a bunch of different ways to initiate a Messenger chat session, but they all amount to "start a chat with user 55", not "start a chat with user 55 using some information".
The thing is, I'd like to somehow pass information along with the link. For instance, I might want to have three different links on three different pages, and I want my chatbot to be able to respond differently based on which page the user came from. Since I can't "pre-fill" a message (eg. "Hello, I just came from page A"), I'm wondering if there is any other way to pass auxiliary information.
TLDR
I'm wondering if there's any way I can possibly provide a user with a link that, when they click it, starts up a chat session with my chatbot user, and somehow passes information to it. Using an intermediate proxy (ie. having the link go to my server, and then have my server start the chat somehow) would work, but only if I can associate the information with the user (ie. it doesn't help to know "page A" if I can't associate that with the user once they start chatting).
After researching further it would appear that the answer to my question is no: there is currently no way to pass-along supplemental information.
But here's the good news: when I filed a bug about this (which it turns out I should have filed as a feature request, sorry Facebook) I got a response saying something to the effect of "we couldn't tell you that we are currently developing this, even if we were", which I'm going to optimistically choose to interpret as a sign hope means that this functionality may be coming in the future.

Resources