This is the last of a four-part series on writing a Discord "slash" command in Ruby using Google Cloud Functions. In previous parts, we created a Discord command that displays a short Scripture passage, and implemented it in a webhook. In this part, we show how to split a longer passage across multiple messages, by triggering a second Function that makes Discord API calls. It will illustrate how to use Google Cloud Pub/Sub to run background jobs in Cloud Functions, combining an event architecture with the Discord API to implement a more complex application. Read More ›
This is the third of a four-part series on writing a Discord "slash" command in Ruby using Google Cloud Functions. In previous parts, we deployed a Discord app to Google Cloud Functions, and added a command to a server using the Discord API. In this part, we actually implement the command, calling an external API and displaying results in the channel. It will illustrate how to respond to commands, and how to handle secrets such as API keys in production. Read More ›
This is the second of a four-part series on writing a Discord "slash" command in Ruby using Google Cloud Functions. In the previous part, we set up a Discord application and deployed its webhook to Google Cloud Functions. In this part, we investigate how to add a command to a Discord channel. It will illustrate how to authenticate and interact with the Discord API, how to use it to add a command to a Discord server, and demonstrate some nice tools for invoking these tasks from the command line. Read More ›
This is the first of a four-part series on writing a Discord "slash" command in Ruby using Google Cloud Functions. In this part, we cover setting up a Discord bot, deploying a webhook to Cloud Functions, and validating webhook requests from Discord using the Ruby ed25519 library. At the end of this part, we'll have a working webhook that Discord recognizes, but that doesn't yet actually implement a command. Read More ›
This is the intro to a four-part series on writing a Discord "slash" command. I recently spent a weekend experimenting with the Discord API and writing a command in Ruby for my church's Discord server. These articles step through the process, including setting up Discord integration, deploying the implementation to Cloud Functions, handling secrets and auth, and setting up an event-driven architecture. Read More ›
This article explores the difference between Ruby's instance_eval and class_eval methods, and takes a peek into the depths of the Ruby execution context. Read More ›
We take a look at some of the design decisions and trade-offs involved in bringing Ruby support to Google Cloud Functions. Read More ›
We Ruby developers use Rake and Rakefiles for many of our build, test, and deployment scripts. Yet Rake has always felt a bit clumsy, and that shouldn't be a surprise. It was actually not designed for most of what we use it for. Would a different tool work better? Read More ›