im not entirely sure how it is now, but basically:

  • bot should not poll. use socket.io to listen for message count increases, and then load messages to see if theres something to respond to. yes this is more requests to handle a single action, but this avoids having to poll the server.

  • bot should only be triggerable by @ mentions. eg. “@mrseeks tell me a joke” or something. this also helps you avoid the whole linking/unlinking system since the bot would be immediately globally available

    • but please keep it to only responding to comments for now!

there might be other stuff from the full rules list that i am forgetting, but those two are the most important.

So the polling thing i did in a rush, it's going to be removed and replaced with a socket.io message listener in a day or so (if that's okay — if not, shut down the bot by running “!shutdown” on @lankybox01/wall)

And the bot will never ever send any actual posts or comments, it will only reply to comments on walls.

And i am going to change the prefix to @mrseeks

thank you

sounds good! i think the socket.io part could be a bit confusing/difficult at first, but it will definitely also result in the bot being much faster than polling.

wait does that mean another admin must've verified me?

probably mis-click when banning you.

btw heres some code to connect to socket.io

// io would be from socket.io-client
const socket = io("https://api.wasteof.money", {
  auth: {
    token: "abcdefg this is my token abcdefg",
  },
});

socket.on('updateMessageCount', (newCount)=>{
  // check if the count is higher
  // get the most recent unread messages
  // for all the most recent messages, act upon comment_mentions/wall_comment_mentions
  // you might even want to mark messages as read once they've been acted upon. thats up to you though
})

thank you

where do i get my token

See more replies
View all comments