Raised This Month: $51 Target: $400
 12% 

Problem with the & sign


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Krystek.
Member
Join Date: May 2022
Old 02-09-2023 , 00:47   Problem with the & sign
Reply With Quote #1

HTML Code:
public SendHelp(id) {
        new message[128];
	formatex(message, charsmax(message), "content=<@&1029504517319954443>")
	GoRequest(id, WEBHOOK_HELP, "Handler_SendReason", GripRequestTypePost, message);	
}

public Handler_SendReason(const id){
	if(!is_user_connected(id))
		return;
}

public GoRequest(const id, const site[], const handler[], const GripRequestType:type, data[]){		
	new GripRequestOptions:options = grip_create_default_options();
	grip_options_add_header(options, "Content-Type", "application/x-www-form-urlencoded");
	
	new GripBody: body = grip_body_from_string(data);
	grip_request(site, body, type, handler, options, id);	
	
	grip_destroy_body(body);	
	grip_destroy_options(options);
}
I have such a code and everything would be great but when it is sent on discord it does not read the & sign..

The message looks like this <@ instead <@&1029504517319954443>

Last edited by Krystek.; 02-09-2023 at 00:50.
Krystek. is offline
zXCaptainXz
Member
Join Date: May 2017
Old 02-09-2023 , 13:46   Re: Problem with the & sign
Reply With Quote #2

I'm not sure but maybe you need to escape the & with ^,
Try this instead <@^&1029504517319954443>
zXCaptainXz is offline
Krystek.
Member
Join Date: May 2022
Old 02-09-2023 , 13:54   Re: Problem with the & sign
Reply With Quote #3

Quote:
Originally Posted by zXCaptainXz View Post
I'm not sure but maybe you need to escape the & with ^,
Try this instead <@^&1029504517319954443>
Then it returns me an error
HTML Code:
error 027: invalid character constant
Krystek. is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 02-09-2023 , 14:02   Re: Problem with the & sign
Reply With Quote #4

Quote:
Originally Posted by zXCaptainXz View Post
I'm not sure but maybe you need to escape the & with ^,
Try this instead <@^&1029504517319954443>
That's what i thought at first but when i saw it's about some web sh*t i decided not to say it since i know it couldn't be
AnimalMonster is offline
Krystek.
Member
Join Date: May 2022
Old 02-09-2023 , 14:06   Re: Problem with the & sign
Reply With Quote #5

According to client_print it returns fine
but not after sending
Krystek. is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 02-09-2023 , 14:51   Re: Problem with the & sign
Reply With Quote #6

Quote:
Originally Posted by Krystek. View Post
According to client_print it returns fine
but not after sending
It's possible that it might think that's an adress...
AnimalMonster is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-09-2023 , 23:08   Re: Problem with the & sign
Reply With Quote #7

Does it get encoded before sending? If not, maybe try manually encoding it? Not really sure what these grip functions are so I can't really check.
__________________
fysiks is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-10-2023 , 04:21   Re: Problem with the & sign
Reply With Quote #8

Have u tried escaping the symbol? No idea if this would work here but that's how it's done in HTML.

HTML Code:
"&amp;"
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Krystek.
Member
Join Date: May 2022
Old 02-10-2023 , 09:31   Re: Problem with the & sign
Reply With Quote #9

Quote:
Originally Posted by Napoleon_be View Post
Have u tried escaping the symbol? No idea if this would work here but that's how it's done in HTML.

HTML Code:
"&amp;"
Unfortunately, that doesn't work either.
Krystek. is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 02-10-2023 , 09:44   Re: Problem with the & sign
Reply With Quote #10

And have u tried wrapping the string in seperate quotation marks?

I'm not at home right now so i can't check how it's done correctly, but it should look something like this:

"content=^"<@&1029504517319954443>^""
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode