Skip to content
◆ FootyBot/README.md·~/projects/footybot
● Discord bot

FootyBot

role year 2026

A Discord bot that posts live football scores as image cards, and ran a World Cup 2026 prediction game that 16 people on our server played.

TypeScriptdiscord.jsBunCanvasDocker
16
Players
579
Predictions
104
Matches covered
36
Exact scores called

Our Discord server has a sports channel, and people mostly talk football in it. FootyBot posts the live score straight into that channel. With the score right there in your face, talking about the match just happens on its own.

It follows the Premier League, the Champions League and, this summer, the World Cup. Every match gets a scoreboard card that keeps up with goals and cards as they happen, and the logos on the card change with the competition.

A goal going in on the simulator, the real World Cup bracket and the prediction podium.

The live scoreboard

The scoreboard is the heart of it. The bot checks live matches every 15 seconds, and when something happens it draws a new card with the score, the minute and every event so far. It isn't text in an embed. It's an actual image, drawn on a canvas, with the club crests and the competition badge.

A restart in the middle of a match can't post the same goal twice, and a finished match can't get two full-time cards. So the bot writes down what it has already posted and rebuilds that state when it starts up again.

FootyBot match card: Liverpool 2-1 Arsenal, live at 78 minutes, with goals by Salah and Wirtz, a Saka goal and a yellow card for Rice
A live Premier League card. Same layout for the World Cup, with flags instead of crests.

A prediction game for the World Cup

I wanted the World Cup to be a bit more fun to follow in the server, so I added a prediction game. Every matchday the bot posts a card per fixture with buttons for home, draw or away, plus an optional exact score.

The rules are short. The right result is 1 point, and the exact score adds 2 more. Picks lock at kickoff, not before. That keeps it simple and stops anyone from waiting to see how the first minutes go. After each matchday the bot posts a podium, and the weekly leader gets a role.

And people actually played. Sixteen of them, across all 104 matches.

16
Players
579
Predictions
36
Exact scores called
61%
Right result
prediction-scoring.ts
1export function scorePrediction(prediction: Prediction, match: TrackedMatch): number {
2 const finalOutcome = deriveOutcome(match);
3 if (prediction.outcome !== finalOutcome) return 0;
4
5 let points = OUTCOME_POINTS;
6 if (
7 prediction.scoreHome !== undefined &&
8 prediction.scoreAway !== undefined &&
9 prediction.scoreHome === match.homeScore &&
10 prediction.scoreAway === match.awayScore
11 ) {
12 points += EXACT_SCORE_BONUS;
13 }
14 return points;
15}
Prediction leaderboard with a podium for the top three and a ranked list below, showing points and correct picks
stack · 3 cards
01 / 03

A fake World Cup to test the real one

Preparing for the World Cup had one obvious problem: it only happens once. I couldn't see what a group table, a bracket or a podium would look like until real matches were played.

So I built a sandbox. It's a simulated tournament with the real 48 teams, all 104 fixtures, its own clock and FIFA's rules for ranking the third-placed teams. A small web dashboard lets me play a match, skip to the next day or post a preview of any canvas to a test channel.

It was mainly for testing how the canvases looked. But seeing them filled with a whole tournament's worth of data also gave me ideas for what I wanted the different canvases to look like.

The match simulator dashboard: a live Liverpool v Arsenal card, buttons for goals and cards, a list of match events and the World Cup sandbox controls
The simulator. Goal and card buttons up top, World Cup sandbox controls at the bottom.
gotcha

Some data you can't fake properly, and penalty shootouts were the big one. They're hard to test until a real knockout match goes to penalties. So during the tournament I had to fix how the bot counted pens, kept them apart from goals and caught the misses. I checked the scores the whole way through, so the leaderboard never got hit by it.

What's next

The World Cup is over, and FootyBot is back to the Premier League and the Champions League. We've talked about running the prediction game for the Prem too, but I don't know if we'll do it. It might come back for the Euros.