Author Topic: @customjsonapi@ fails if variabel URL contains comma  (Read 2932 times)

0 Members and 1 Guest are viewing this topic.

dorrBaume

  • Youngling
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
  • Twitch Name: dorrbaume
@customjsonapi@ fails if variabel URL contains comma
« on: January 06, 2016, 12:42:17 PM »
Hi all
I'm running "Closed Beta - Revision 0.8.7.0"

BUG:
If the first agrument of the @customjsonapi@ contains a variabel (for example @points@) that contains a comma -> the @customjsonapi@ fails and the URL is returned in Chat.

BACKGROUND:
I have a PHP file running on my website that should be called from Deepbot.
In order to calculate a result it needs information about the user like @points@ and @user@.
My only way to send these information is via GET-params in the URL. So my command looks like this:
Quote
@customjsonapi@[http://example.com/twitch/event/add.php?c=dorrbaume&u=@user@&p=@points@&e=eventname,result]
The problem is, that @points@ use comma as thousands digit what also marks the end of the URL for the @customjsonapi@

RECOMMENTATION:
This happens to me since the 0.8.6.0 Update
It seems you parse the values of the variabels into the URL-string before you run the @customjsonapi@.
But somehow this worked in earlyer versions of DeepBot.
I guess you need to distinguish the two @customjsonapi@ parameters first, and parse the URL-string after that.

Or you could add a new variable for points without thousands digit for calculations.
But it's a quick fix because variabels like @target@ could still cause problems.

PS:
My biggest problem is that Deepbot reveals the dynamic URL if the command fails.
Everybody in Chat can klick it and can confuse my PHP script.
I would like to see that Deepbot keeps the parameters of @customjsonapi@ as a secret, even if it fails.

TheRealAlixe

  • Knight
  • ***
  • Posts: 106
  • Karma: +5/-2
    • View Profile
    • Ninetales.us
  • Twitch Name: TheRealAlixe
Re: @customjsonapi@ fails if variabel URL contains comma
« Reply #1 on: January 08, 2016, 10:34:15 PM »
Hi all
I'm running "Closed Beta - Revision 0.8.7.0"

BUG:
If the first agrument of the @customjsonapi@ contains a variabel (for example @points@) that contains a comma -> the @customjsonapi@ fails and the URL is returned in Chat.

BACKGROUND:
I have a PHP file running on my website that should be called from Deepbot.
In order to calculate a result it needs information about the user like @points@ and @user@.
My only way to send these information is via GET-params in the URL. So my command looks like this:
Quote
@customjsonapi@[http://example.com/twitch/event/add.php?c=dorrbaume&u=@user@&p=@points@&e=eventname,result]
The problem is, that @points@ use comma as thousands digit what also marks the end of the URL for the @customjsonapi@

RECOMMENTATION:
This happens to me since the 0.8.6.0 Update
It seems you parse the values of the variabels into the URL-string before you run the @customjsonapi@.
But somehow this worked in earlyer versions of DeepBot.
I guess you need to distinguish the two @customjsonapi@ parameters first, and parse the URL-string after that.

Or you could add a new variable for points without thousands digit for calculations.
But it's a quick fix because variabels like @target@ could still cause problems.

PS:
My biggest problem is that Deepbot reveals the dynamic URL if the command fails.
Everybody in Chat can klick it and can confuse my PHP script.
I would like to see that Deepbot keeps the parameters of @customjsonapi@ as a secret, even if it fails.



Ummmm you must be running 0.8.6.0 as 0.8.7.0 hasnt been released yet
Twitter: @TheRealAlixe | Web: Ninetales.us | Twitch: @TheRealAlixe | Discord: join

dorrBaume

  • Youngling
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
  • Twitch Name: dorrbaume
Re: @customjsonapi@ fails if variabel URL contains comma
« Reply #2 on: May 09, 2016, 03:44:41 AM »
Is this bug going to be fixed someday?
You could simply add a variable like @intpoints@ that outputs "12345" instead of "12,345" and the @customjsonapi@ won't break anymore.

But i would really appreciate if you could manage to let the @customjsonapi@ ignore "," as a separator als long as it's part of a variable value.

TheNumbLock

  • Advisor
  • Councilor
  • **
  • Posts: 4776
  • Karma: +137/-5
    • View Profile
  • Twitch Name: TheNumbLock
Re: @customjsonapi@ fails if variabel URL contains comma
« Reply #3 on: May 10, 2016, 03:26:11 AM »
Is this bug going to be fixed someday?
You could simply add a variable like @intpoints@ that outputs "12345" instead of "12,345" and the @customjsonapi@ won't break anymore.

But i would really appreciate if you could manage to let the @customjsonapi@ ignore "," as a separator als long as it's part of a variable value.

A custom command variable will be added. The variable is: @intpoints@
Old Name: RepentGamingTV
Twitch: Here

Need help ASAP?
Join Deepbot's Discord: Discord.Deepbot.tv
Deepbot's Twitter: @DeepSupport