Custom API so i dont get limited to 400 characters per link

Hey i was seeing if there was any way i could make a custom api for night bot to randomly pick off so i dont get limited to the 400 character limit that goes with paste bin and night bot

this is what ive made so far for my custom !fact command
!commands edit !Fact $(eval a="$(urlfetch ht tps://".split(","); b="$(urlfetch ht tps://".split(","); c="$(urlfetch h ttps://".split(","); d="$(urlfetch ht tps://".split(","); e="$(urlfetch ht tps://".split(","); f="$(urlfetch ht tps://".split(","); g=a.concat(a); g[Math.floor(Math.random() * (c.length-1))]:wink:

thank you in advance

Put all your random facts into a single Paste, and use a single json urlfetch to read off the Paste:

!commands edit !fact $(eval a=`$(urlfetch json`.split(`,`);a[Math.floor(Math.random()*(a.length-1))])

yeab but with this link with over 120 facts its just comes back to the same response it gave me before saying over 400 characters

!commands edit !fact $(eval a=$(urlfetch json ht tps://,);a[Math.floor(Math.random()*(a.length-1))])

The end of each line in your new paste has a semicolon instead of a comma, so you have to use a semicolon instead of a comma in the split() function. I fixed the command response.

!commands edit !fact $(eval a=`$(urlfetch json`.split(`;`);a[Math.floor(Math.random()*(a.length-1))])

thank you this has had me scratching my head for a while

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.