Currently I'm trying to make a Ban Command which has Buttons to determine if a User should be banned or not. However, it now sets the Author and User as 'undefined' even though a User has been provided.
(Side Note, there's no Error showing up in the Console)
Since the Code is pretty big, I decided to make a hastebin. Link: https://www.toptal.com/developers/hastebin/enolimecir.js
I've looked at your code and as you can see at your line 26 - 31 (.setDescription), thats where the undefined came from.
.setDescription(`**User:** ${user.user.mention}\n**Moderator:** ${message.author.mention}\n**Reason:** ${reason}`)
user.user.mention will not work at all because you have already defined the user but you defined a user again at the second user".user".mention, instead do it like this:
**User:** <#${user.id}>
and at the second undefined which is the moderator who requested the ban message.author.mention the message.author is correct but the .mention isn't, so what you're going to do instead is:
**Moderator:** <#${message.author.id}>
Related
I've been trying to import a constant with an user id from another file for a while but it shows up as undefined. Basically I want to use the user that this constant gets
const user = interaction.options.getUser("target");
in another file, the "target" here is the user that the slash command author is mentioning when using a slash command, I want to use it in a button handler to be specific, and use it in this
.setDescription(`${interaction.user} has given a like to ${user} `)
but I can't seem to figure out how to get the user that the constant obtains as all I've tried so far has resulted in "undefined" showing up and not the user. any help is appreciated
So you can do this. The first block of code is for the embed that has the buttons and is simple.
.setFooter({
text: `${user.id}`
})
This block will go in your interaction.isButton() section for the code that works when they click the button to confirm
const member = interaction.guild.members.cache.get(interaction.message.embeds[0].footer.text)
console.log(member)
I want that my NAO-robot (Version 6) uses another name than NAO, when someone asks "What is your name?". I already changed it's name in the settings, but it doesnt use it by the voice recognition.
The basic channel's content is probably generic and might not adapt to your robot's actual name. But by making a small app reacting on the same trigger sentence, you might be able to override the current behavior.
So I recently updated discord.js to v12 and I started fixing the code where it was throwing errors. I noticed that the users presence needed to be fixed although when I corrected it from {message.users.presence.game || 'null...'} to {message.presence.activities ||'null...'} the 'null...' does not show if a user does not have a presence like it should do, instead it shows a blank line. Could this be because im missing something in the message.presence.activities? or have I set it incorrectly?. Here is an image of a user without status and an image of a user with a status
When message.presence.activities is empty it will display a blank line because in javascript empty arrays are still true, to get it to display 'null...' you should change it to:
message.presence.activities.length ||'null...'
The .length will check if the array contains any elements.
Umbraco uses angularJS as based library and backoffice totally developed on it. The reason telling first is to tell that I have a field on which URL regular expression applied. If someone entered invalid url like below image
it shows error as need.
But if a user try to remove whole text by selecting it and removing at once. It still keep appearing the error like this
However, if a user erase text one by one like this
then the validation error removed and user need to click on button to see error again.
I would to know how screen 3 state can be achievable when user remove all text together? Its really annoying behavior for a user to remove text character one by one to refresh the state of the field. Screen 3 state should be applied on screen 2.
Can anybody tell me how it can fix or achievable? Right now, it seems like a default behavior.
Looking forward to hear from you guys. Suggestions will be much appreciatable.
Regards o
I've looked into this issue. This seems to be a product bug.
When you remove whole text at once, newValue is an empty string and the code responsible for resetting error messages doesn't run. If you have access to the umbraco code, you can easily fix it by removing highlighted check:
I've taken a reCaptcha plugin from this guy
(github link of the plugin)
I've entered the following code form in my view:
[form creation]
[table]
[inputs]
[/table]
echo $this->Recaptcha->show(array('theme' => 'white'));
echo $this->Recaptcha->error();
[/form]
I've followed the steps suggested, and the reCaptcha window appears properly, but no matter what I enter in the captcha, it never gets verified and I always receive the 'message' field of beforeValidate (I've set it to "You've entered a wrong message" etc).
I'm not even sure how to debug it to see at which point it fails. Even if I just replace all the code in checkRecaptcha function with "return true" to try and skip the validation with the keys and just see if the rule itself is correct, it still remains the same, and I'm generally not getting any of the specific incorrect-captcha-sol messages that I read around.
Am I correct to assume that the only code I need inside my controller function (assuming I've already included the component and helper in the controller) is Configure::load('Recaptcha.key'); and no further manual validation checks?
(unfortunately I can't link you my whole project due to rights)
I had a similar issue. Try removing the 2 response and challenge field lines in the component and overwrite them with these:
$controller->$modelClass->set('recaptcha_response_field',
$controller->request->data['recaptcha_response_field']);
$controller->$modelClass->set('recaptcha_challenge_field',
$controller->request->data['recaptcha_challenge_field']);