Skip to content
TORNLIFE More

API + Discord Bots?

Started by Satan [612696] on in API Development.

8 replies · 384 views · thread synced · 6 days ago · View on torn.com
About this thread

Posts archived: 9 / 9 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
9
Discussion span
→
People posting
4
Likes on archived posts
7
Authority score
67 / 100
Historical score
22 / 100
Story score
33 / 100
Engagement score
58 / 100

Most-liked replies

Satan [612696]

Has anyone setup a Discord bot to pull API requests? such as setting a bot to announce when a chain is starting, when a faction puts a bonus on my faction or when we start a territory war? (A War bot basically)
LouBaker [1162207]



I haven't seen the discord Bot but I have tried a IRC Bot on Slack similar Discord,

The first 2 or 3 messages worked at a reasonable time 3 to 5 seconds but this increased every time a new message was added, the delay just got longer upto 10 and 15 seconds and then was missing messages sent after that and often didn't responded at all. having to restart the browser each time.

i work on it for a few hours, gave up on the idea, Im sure there was a reason this was happening but couldn't work it out.

hope you have better luck.


Satan [612696]

would you be interested in working together to make a discord bot that can do something similar? perhaps your bot got slow because it was running off IRC servers?
Helcostr [1934501] Wiki Editor

I was working on a Discord bot for my faction earlier, as a quick report. It would also contain the ability to call faction members while offline (just so they can possibly hop on to dump extra hits before returning to normal life), track possible targets based on defensive and offensive hits hits (if your faction members failed a hit, and you are weaker, don't bother. This theoretically pairs well with the quick call stated earlier).

My platform I use is the Node.js language: for ease of setting up a discord library (discord.js).

So hi. Hope you don't mind me dropping in.
Helcostr [1934501] Wiki Editor

Speed getting slower and slower is probably related to something called rate limiting. This prevents the system from being overloaded (similar to how Torn requests for their API to be accessed 100 per 1 minute, or some number like that). I suggest slowing down your requests sent to the Slack API, or finding the amount of seconds/messages you have left to send within a period (probably a per second interval). Same goes for the Discord API.
LouBaker [1162207]

its wasn't like that.

i was making manual request for personal stats to the IRC Bot which did the API call and returned just one line of text back into slack

each time the message was sent the IRC bot received and returned message,

the returned message was getting bottle necked on slack somehow

I could text chat with the bot via the IRC, but messages sent by the BOT its self on command was failing.



EDIT:

but now iv just written this i think i know what the problem was. I was using the IRC /Describe command not the /Msg command.

maybe that was it.

will look into it later.