How can I make an Events System through my Google Spreadsheets Macro? (HTTP)

I’m making a discord bot that will automatically rank people in the group discord based on their statistics in my game, Midnight Racing: Tokyo.

The current way that the game and the discord bot communicate is through a Google Spreadsheet macro (found here). I’d like to optimize the way I’m managing players’ ranks.

Here’s what I’m doing now:
As you can see, there is a table holding information about each player who is experienced or professional.

I’d like to create some kind of Events system that tells my discord bot whenever this table is updated by the roblox server. Unfortunately I don’t know enough about local hosts, Javascript (the Google macro works off this) or discord bots in general to be able to do anything like this on my own. Could anyone lend a hand?

A couple things to note:

  • I’m using “Discordia” by SinisterRectus (link)
  • I’m hosting the bot on a personal computer of mine

Thanks! I hope someone can help! Feel free to ask questions, I’m not sure I explained everything well.


It’s been a long time since I wrote the original macro script, so I am not at all familiar with the documentation. It should be possible to invoke a method when the table is updated. This would require changing the original code I wrote to include a web request, or something similar.

1 Like

You could probably use a Discord Webhook and send a request at the same time you update the table

1 Like

How could I invoke the bot to update itself by using a webhook?

Depends. Do you want it to display the updated table in a Discord channel?

No, I just want the bot to respond to an event and update the tables in it’s cache

So far what I’m working on is a private channel where the webhook posts, and then there’s a hidden command in the bot that will make it refresh it’s caches (so long as the message was posted in that hidden channel). What did you have in mind?

I was just thinking, if you wanted it to display the table, you could just send the table to Discord via the Webhook, but since you’re using a bot, I’m not sure. Don’t know much about js, sorry

The bot is actually written in lua using the Discordia module haha. Now that I think about it, I could actually forget about the Google side of it completely, and talk to the bot directly from roblox via the webhook. I might just have roblox studio tell the webhook to, for example, give a player a role in the server. Thanks for the help!

As for the Google Javascript stuff, it’s mostly API. I know Javascript as a language (I can read and write it) but I’m no expert at it. The thing that kills me is the Google API since I’m not familiar with it at all.

1 Like