David Martínez-Rubio bio photo

David Martínez-Rubio

  G. Scholar LinkedIn Github e-Mail

I made a Telegram bot in 2017 for playing Codenames in a group chat. The basic idea is simple: add the bot to a group, start a game, let people join teams, assign one spymaster (hint giver) per team, and then play the whole board directly from Telegram.

Codenames board in English inside Telegram

The part that made it especially fun for me was using different word lists. That meant we could play regular Codenames in several languages, and then other completely random decks.

The best example is the TV Tropes deck with ~25k tropes that there were back then. Instead of guessing “apple” or “tower”, you can end up trying to connect things like “Abandoned Hospital Awakening”, “Accidental Hero”, or whatever absurdly specific trope appeared on the board. I also gathered a math deck, which makes for a bizarre game: suddenly you saw yourself giving a clue like “compact 3” which weirdly made a lot of sense.

Codenames board using a TV Tropes deck inside Telegram
Codenames board using a math deck inside Telegram

The bot flow is built around the fact that Codenames has public and private information. Everyone sees the public board in the group. Spymasters receive the annotated board privately, showing which words belong to which team, which words are innocent bystanders, and which word is the assassin. For that to work, spymasters first have to talk to the bot in private with /start, so Telegram allows the bot to message them.

A game goes roughly like this:

  1. Someone starts a group game with /newgame.
  2. Players join teams with /join n, where n is the index of the group.
  3. Spymasters join teams with /spymaster n.
  4. The group can choose a deck with /setdeck.
  5. The group starts the board with /codename.
  6. Spymasters receive the full answer key privately.
  7. The current spymaster gives a clue with /hint word number.
  8. Guessers use /guess word or /guess k, where k is the index of the word.
  9. Teams can /pass, and the bot advances turns. Otherwise, the bot has the logic of letting the team do n+1 guesses.

There are some nice tweaks that you can do. It supports more than the standard two teams. The default game has two teams, 25 words, and 8 words per team, but you can tweak it to play in one team, more words, etc. Also, a player can be playing several simultaneous games in different groups and select a group game in their private chat, ask for the word list again, etc. The public board updates after each guess, showing revealed words with team markers and leaving unrevealed words numbered.