Bots
A user your code logs in as. Get gateway events as they happen (messages, reactions, members, voice states) and act on them through the REST API.
Developers
Bots, slash commands, webhooks and apps. Grumble speaks the same API as Discord, so the libraries you already know work here too.
Already have a Discord bot?
Your bot's code can stay as it is. Change where it sends requests and where it connects, and it logs in, joins its servers and registers its slash commands. Here's what changes.
const { Client, GatewayIntentBits } = require("discord.js");
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent],
rest: { api: "https://grumble.gg/api" },});
client.on("messageCreate", (m) => {
if (m.content === "!ping") m.reply("pong 🐾");
});
client.login(process.env.GRUMBLE_TOKEN);
discord.js asks Grumble where its gateway is, so the API address is all it needs.
import discord, yarl
discord.http.Route.BASE = "https://grumble.gg/api/v10"discord.gateway.DiscordWebSocket.DEFAULT_GATEWAY = yarl.URL("wss://grumble.gg/gateway/")
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_message(message):
if message.content == "!ping":
await message.reply("pong 🐾")
client.run(os.environ["GRUMBLE_TOKEN"])
Set both. discord.py doesn't ask the server where its gateway is, so if you leave the second line out, your bot tries to log in to Discord with its Grumble token.
Tested with discord.js, discord.py, serenity, JDA and Discord.Net, directly and in encrypted servers. See how each one did, and what to change in each. Other libraries work the same way. Change the API address, and the gateway address if the library has its own.
Encrypted servers need the bridge. Grumble's servers are end-to-end encrypted and our servers never hold the keys, so through the API alone a bot gets their messages, names and command options still encrypted. The Grumble bridge fixes that. It's a small program that runs next to your bot, holds its keys on your machine, and serves your bot this same API with everything decrypted. Your bot points at the bridge instead. Run it with npx grumble-bridge.
Make a bot
Open the Developer Portal. In the Grumble app it's under Settings, and on the web it's at developers.grumble.gg, where you sign in with your Grumble account. Click New application and agree to the Developer Terms.
On the Bot tab, click Add a bot. Copy the token straight away, because it's only shown once. It's how your code logs in, so keep it secret.
On Add to a server, pick its permissions and one of your servers, or share its link so anyone can add it (if it's public).
What you can build
A user your code logs in as. Get gateway events as they happen (messages, reactions, members, voice states) and act on them through the REST API.
Global or per-server commands with typed options. People type / and pick yours, and your bot answers right away or defers and follows up.
Put buttons and menus on your bot's messages and open pop-up forms. Clicks and answers arrive as interactions your bot replies to.
Post alerts, feeds and build results into a channel from anywhere, with just a URL. In a forum channel, each post starts a new thread.
OAuth2 links with the bot and applications.commands scopes and exactly the permissions your bot needs.
Add /slack or /github to a webhook's URL, and anything that posts to a Slack webhook, or a GitHub repository's events, posts here.
Give your app an address and its commands and button presses arrive there, signed, with no gateway connection to keep open. Answer in the response.
Boxes with a coloured edge, sections with a picture or button beside them, galleries and separators, with the IS_COMPONENTS_V2 flag.
Requests, responses, events, permissions and rate-limit headers follow Discord's API v10, so its documentation applies here too.
https://grumble.gg/api/v10 (versions 6 to 10 are all accepted)wss://grumble.gg/gateway, also returned by GET /gateway/botAuthorization: Bot <token>npx grumble-bridge).451, so don't host a bot there (why).290008, and an upload of a known illegal file with 290002.Make one of these
Servers ask for these, and nobody's made them for Grumble yet. If you make one, or bring yours over, tell us and we'll point people to it. Grumble's own bots already do voice-time leaderboards, levels, tickets and reaction roles, and they're yours to copy.
A button to enter, a timer, and a fair draw announced at the end. Rerolls for winners who don't answer.
Messages that get enough of one reaction copied to a channel of the server's best moments.
People add their own birthday (just the day and month), and get a wish and a role on the day.
Someone messages the bot, and the server's team answers in a private thread, as one team, with notes and a log.
A post when a streamer goes live, a video goes up or a feed has something new. Webhooks make the posting easy.
Counting, trivia, word chains and question of the day: small games a server plays together, with scores.
Ask, share what you've made, and tell us what you'd build if Grumble had it, in Grumble Developers.
Join Grumble Developers