leogomezz4t / PyTextNow_API

Python texting API utilizing TextNow API
MIT License
67 stars 41 forks source link

Multiple lines #32

Closed gobuster closed 3 years ago

gobuster commented 3 years ago

When I try to send something like this

client.send_sms(number, "hi\n") or client.send_sms(number, """hi hi""") I get an error Is this supposed to happen? Or can you just not use multiple lines in a message.

SilverStrings024 commented 3 years ago

You should be able to use any string as the message. Have your tried assigning the multiline string as a variable then using the variable instead? (Just as a test to make sure it's not just the function call)

gobuster commented 3 years ago

You should be able to use any string as the message. Have your tried assigning the multiline string as a variable then using the variable instead? (Just as a test to make sure it's not just the function call)

Yes I have still got the same error

SilverStrings024 commented 3 years ago

You should be able to use any string as the message. Have your tried assigning the multiline string as a variable then using the variable instead? (Just as a test to make sure it's not just the function call)

Yes I have still got the same error

Alright, what's the traceback? Put the error in dpaste.org and post it here.

gobuster commented 3 years ago

You should be able to use any string as the message. Have your tried assigning the multiline string as a variable then using the variable instead? (Just as a test to make sure it's not just the function call)

Yes I have still got the same error

Alright, what's the traceback? Put the error in dpaste.org and post it here.

https://dpaste.org/2L7i

leogomezz4t commented 3 years ago

We have actually had this issue before.

SilverStrings024 commented 3 years ago

You should be able to use any string as the message. Have your tried assigning the multiline string as a variable then using the variable instead? (Just as a test to make sure it's not just the function call)

Yes I have still got the same error

Alright, what's the traceback? Put the error in dpaste.org and post it here.

https://dpaste.org/2L7i Looks like either your sid or the request was just straight out denied by text now. Try using auth_reset and giving it your sid again

leogomezz4t commented 3 years ago

For now you have to use \\n instead of \n but stay tuned its going to be patched in the next update

gobuster commented 3 years ago

You should be able to use any string as the message. Have your tried assigning the multiline string as a variable then using the variable instead? (Just as a test to make sure it's not just the function call)

Yes I have still got the same error

Alright, what's the traceback? Put the error in dpaste.org and post it here.

https://dpaste.org/2L7i Looks like either your sid or the request was just straight out denied by text now. Try using auth_reset and giving it your sid again

I have tried that when I first got the error

SilverStrings024 commented 3 years ago

For now you have to use \\n instead of \n but stay tuned its going to be patched in the next update

That's not what he's talking about. He thinks multi-line strings won't work.

You should be able to use any string as the message. Have your tried assigning the multiline string as a variable then using the variable instead? (Just as a test to make sure it's not just the function call)

Yes I have still got the same error

Alright, what's the traceback? Put the error in dpaste.org and post it here.

https://dpaste.org/2L7i Looks like either your sid or the request was just straight out denied by text now. Try using auth_reset and giving it your sid again

I have tried that when I first got the error

I didn't notice this. do what Leo said and escape the forward slash change client.send_sms(text, "test\ntest") to client.send_sms(text, "test\\ntest")

leogomezz4t commented 3 years ago

No multiline strings also won't work at the moment either.

SilverStrings024 commented 3 years ago

No multiline strings also won't work at the moment either.

Seriously?! Why

leogomezz4t commented 3 years ago

I actually didn't know they didn't work until a couple weeks ago so I'm including it in the next update. The way the request sends has to have the \n be in the string instead of an actual newline.

SilverStrings024 commented 3 years ago

I actually didn't know they didn't work until a couple weeks ago so I'm including it in the next update. The way the request sends has to have the \n be in the string instead of an actual newline.

hmmm weird. alright