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)
API + Discord Bots?
Started by Satan [612696] on in API Development.
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
- LouBaker [1162207]
· 1 likes ·
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 …
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)
no but i started working on one recently
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.
would you like to work on one together? perhaps we can share notes/code?
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?
what language are you working in?
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.
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.
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.