DiscordWordle - A bot for discord to store and track Wordle scores

DiscordWordle

Go Report Card Actions Status

A bot for discord to store and track Wordle scores.

Usage

Mention the bot using @BotName help to see full list of commands: usage image

To add a score just mention the bot followed by pasting the output you get from the Wordle Share button. The bot will store this score in a database and let you know if it worked.

Invite this bot to your Discord Server

Use this Discord link to invite Discordle to your server: https://discord.com/api/oauth2/authorize?client_id=929646986125250601&permissions=84032&scope=bot

This bot requests the following permissions:

  • Send Messages
  • Embed Links
  • Read Message History
  • Mention Everyone
  • Add Reactions

Deploy your own bot

This project is configured to run on the free-tier of heroku. All you need is an application token from Discord.

  1. Go to https://discordapp.com/developers/applications and create a new application.
  2. Provide a name. The name of the application will be used as the bot's name on Discord.
  3. Setup bot. Click on the Bot tab in the left menu, then click the Add Bot button.
    • Choose if you want this bot to be "Public" where anyone with the link can invite it to a different discord server
  4. Copy the Bot Token by clicking the Copy button under "Token".
  5. Use this token as the DISCORD_TOKEN when creating a Heroku deployment with the button below.

Deploy

Invite your own bot to a server

  1. Visit https://discordapp.com/developers/applications and select the bot application.
  2. Build a link to invite the bot. Click OAuth2 in the left-hand menu.
  3. Under the "Scopes" section check the bot checkbox.
  4. Under "Bot Permission" check the following boxes:
    • Send Messages
    • Embed Links
    • Read Message History
    • Mention Everyone
    • Add Reactions
  5. Above back in the "Scopes" section Copy the generated URL.
  6. Paste the URL link into the browser, and pick the Discord server you want the bot to join.
Comments
  • Bot not registering entries

    Bot not registering entries

    It seems if someone posts their Wordle score incorrectly, resulting in the bot not registering the results, if they then repost it correctly, the bot doesn’t pick them up. Attached the most recent example of this:

    F9161331-18CF-4C0F-AAEE-7639F5893953

  • Add commands for enabling/disabling quips to the help message

    Add commands for enabling/disabling quips to the help message

    The users on my server wished to disable the quips. I was able to find the command through this Github issue, but less technical users might not find this, so it would be good to add the quip enable and quip disable to the help message.

  • Prevent users from editing past days

    Prevent users from editing past days

    The Wordle site doesn't have a way for you to go back in time, so the Discord bot should mirror that functionality.

    Prevent updates or submissions for Wordles completed before today.

    btw: Great bot, thanks for this community add!

  • Disable/ Delete Quips?

    Disable/ Delete Quips?

    Firstly, thank you very much for creating this bot, it's fantastic and adds that extra competitive element to our daily wordle results, major kudos!

    Secondly, apologies, I didn't really want to raise this as an "issue", but can't see another way to ask the question and have worked through everything (even tried amending the quips to blank text). We have a large number of people on our server, and would like the option to disable or delete specific quips if possible, is this feature available or something that could be added down the line, please?

    Many thanks in advance!

  • SUGGESTION: Interpolate the scoreboard with something to show missing entries

    SUGGESTION: Interpolate the scoreboard with something to show missing entries

    Right now the scoreboard looks something like this when people miss entries:

    Player1      [4, 5, 2]   38      
    Player2      [6, 2, 4]   35      
    Player3      [3, 3, 6]   33         
    Player4      [4, 3]      25      
    Player5      [5, 3]      20   
    

    It would be useful if it could be updated to show something like this:

    Player1      [4, 5, 2]   38      
    Player2      [6, 2, 4]   35      
    Player3      [3, 3, 6]   33         
    Player4      [-, 4, 3]   25      
    Player5      [5, -, 3]   20   
    

    Having a quick look at the queries, perhaps something like this would do it (I haven't actually looked up the table structure...)?

    -- name: GetScoresByServerId :many
    with max_game_week as (select max(game_id / 7) game_week
                           from wordle_scores
                                    inner join nicknames n2 on wordle_scores.discord_id = n2.discord_id
                           where n2.server_id = $1
    )
    select n.nickname,
           coalesce(json_agg(guesses order by s.game_id), "-")             guesses_per_game,
           json_agg((7 - s.guesses) ^ 2 order by s.game_id) points_per_game,
           count(distinct game_id)                          games_count,
           sum((7 - s.guesses) ^ 2)                         total
    from wordle_scores s
             inner join nicknames n on s.discord_id = n.discord_id
             inner join max_game_week g on g.game_week = s.game_id / 7
    where n.server_id = $1
    group by n.nickname
    order by sum((7 - s.guesses) ^ 2) desc;
    
  • Allow collection of Wordle Share blocks without mentioning the bot

    Allow collection of Wordle Share blocks without mentioning the bot

    Uses a pretty specific regex that checks all messages for the Wordle…\d+ \d/6\n share block that has to have a new line at the end which is expected if it was pasted from the Wordle Share button.

    Exact regex:

    var dataExp = regexp.MustCompile(fmt.Sprintf(`Wordle (?P<game_id>\d+)\s(?P<guesses>\d+|%s)/6\n`, noSolutionResult))
    

    This will match bad @mentions followed by the share block:

    @randomName Wordle 200 X/6
    
    ⬛⬛⬛⬛⬛
    ⬛⬛⬛⬛🟩
    ⬛⬛⬛⬛🟩
    ⬛⬛⬛⬛🟩
    ⬛⬛⬛⬛🟩
    ⬛⬛⬛⬛🟩
    

    This will not match the phrase Wordle 200 X/6 in casual conversation since there is no trailing newline, and the bot isn't mentioned.

    He Tom, I got Wordle 200 X/6 today. Really tough puzzle
    
  • Better error handling and logging

    Better error handling and logging

    The bot was dying due to issues when user input failed to match the defined regex for quips and Wordle scores. Some conditional logic will resolve the root issue, and better logging will make it easier to debug future issues.

  • The random reply doesn't seem very random

    The random reply doesn't seem very random

    Current solution uses Postgres order by random() limit 1 which does give different results when repeating the query multiple times. However it seems that the same seed is being used/restarted based on a high number of repeats in the Discord servers.

    Find a round robin load balancer approach to increase the variety in quip replies.

  • Pad missing days with dashes in scoreboard

    Pad missing days with dashes in scoreboard

    Implementation for #22

    Before:

    Name   Guesses              Total   
    1      [1, 1, 1, 1, 1, 1]   216     
    2      [2, 2, 2, 2, 2]      125     
    3      [3, 3, 3, 3]         64      
    4      [4, 4, 4]            27      
    5      [5, 5]               8       
    6      [6]                  1 
    

    After:

    Name   Guesses         Total   
    1      [1 1 1 1 1 1]   216     
    2      [2 2 2 2 2 -]   125     
    3      [3 3 - - 3 3]   64      
    4      [4 - - - 4 4]   27      
    5      [- - - - 5 5]   8       
    6      [- - - - - 6]   1 
    

    Code explanation: I tried a SQL-only solution, but the left wasn't returning null rows/values like I needed for the coalesce() operator needed to work. Instead, I had to pull the list of possible games into the app and iterate through each one and choose to display the number if it's defined, otherwise using - placeholder.

    Not as pretty as I wanted since I had to add two new layer of loops, and even the return format from the database [{"217" : 5}, {"218" : 5}, {"219" : 6}] isn't the ideal shape of a flat dictionary {"271": 5, "218": 5, "219": 6} so I had to repack that data in the new dashDisplayForMissingScores method.

  • Allow users on a server to delete quips, including the starting set of quips

    Allow users on a server to delete quips, including the starting set of quips

    • [ ] Refactor the inside_joke = false starter quips to be cloned over to inside_joke = true, server_id = m.GuildId so they can be deleted server by server
    • [x] List existing quips to get a quip.id to used in delete command.
    • [x] Expose @Discordle quip delete <ID> command that removes it from the quips table for that server
  • Disable/Enable quips on an individual server

    Disable/Enable quips on an individual server

    @Discordle quip disable - Turn off quip responses, the bot will continue to add emojis to the request if it understood the input
    @Discordle quip enable - Turn quip responses back on if previously disabled
    

    Add two new commands to insert/delete rows in disable_quips.server_id table that gets checked before trying to find a hilarious quip to respond with.

  • Use this code to track scores for other games similar to Wordle

    Use this code to track scores for other games similar to Wordle

    Hi, I am trying to tweak this bot to work for a different wordle like game, it uses different colo emojis and has a different name

    Is there a way to make that happen somehow? I'm a huge newbie when it comes to coding but I use python

    Thank you!

  • Enhancement idea: Import all old scores

    Enhancement idea: Import all old scores

    • many of us are adding this bot to our server after already having played Wordle for a while we have a ton of old results that aren't in the bot
    • since the results are all stored locally: might there be a way to view them, copy them, paste them to the bot, and have it parse them into our results history somehow?

    thanks :)

  • Is it possible to listen for Wordle scores without requiring @ mentioning the bot?

    Is it possible to listen for Wordle scores without requiring @ mentioning the bot?

    Great bot, thanks for creating it. Would it be possible for the bot to listen for wordle scores without requiring users to remember to @ mention the bot, or is this a limitation of the way bots work in discord?

Natalya The Discord Wordle Bot (Heroku)
Natalya The Discord Wordle Bot (Heroku)

DiscordWordle A bot for discord to store and track Wordle scores. Usage Mention the bot using @BotName help to see full list of commands: To add a sco

Jan 17, 2022
Diswordle - A Discord Wordle bot written in Go

discordle A Discord Wordle bot written in Go. Uses my own Go package, wordle. In

Nov 7, 2022
Wordle Discord Bot With Golang

Wordle Discord Bot Early on in my Golang journey, a curious little game called W

Feb 5, 2022
discord bot that plays music in a voice channel discord

Music discord bot by serje3 Description A bot written in the Golang language plays music on your server's voice channel on Discord. It can be built an

Nov 17, 2021
A simple Discord bot developed for the Bedrock Gophers discord server.

Bedrock Gopher A simple Discord bot developed for the Bedrock Gophers discord server. Click here to invite the bot to your guild. You will also need t

Mar 12, 2022
Feline-bot - Feline Bot for Discord using Golang

Feline Bot for Discord Development This bot is implemented using Golang. Feature

Feb 10, 2022
Bot-template - A simple bot template for creating a bot which includes a config, postgresql database

bot-template This is a simple bot template for creating a bot which includes a c

Sep 9, 2022
Discord-dl: a tool to archive discord channels

discord-dl discord-dl is a tool to archive discord channels. I think it's safe t

May 18, 2022
Discord-notif - Send notifications to discord in Your pipelines or scripts
Discord-notif - Send notifications to discord in Your pipelines or scripts

discord-notif Send notifications to discord in Your pipelines or scripts install

Dec 15, 2022
Discord-finder - The back-end for retrieving information about people on discord
Discord-finder - The back-end for retrieving information about people on discord

About This is the backend application for Discord Finder, it allows you to retrive information about people on discord just like the discord lookup we

Jan 4, 2022
Wipe-discord - TUI application to erase Discord messages
Wipe-discord - TUI application to erase Discord messages

wipe-discord Terminal user interface (TUI) application to delete Discord message

Aug 21, 2022
A discord bot that watches for tiktok URL's and automatically uploads the corresponding video to the channel

TikiTok Bot A Discord bot that watches for TikTok URLs and sends a message to the channel with the corresponding video attached Click to invite the bo

Jul 28, 2022
A Discord Bot written in Go. Provides some fun commands and utility.

asuka About Asuka is a project to finally learn Golang and get comfortable with the language while exploring many different concepts in programming. A

Jan 7, 2022
A Discord bot that automatically retrieves ELO ratings for Age of Empires 4 and gives users custom roles.

AOE 4 ELO Bot This is a Discord bot that automatically retrieves ELO ratings for Age of Empires 4 and gives users custom roles. Uses the public API fo

May 13, 2022
Genpc - Discord bot for automating Numenera (and eventually other system) tables

GenPC Discord bot for automating Numenera (and eventually other system) tables.

Feb 16, 2022
A Discord bot for managing ephemeral roles based upon voice channel member presence.
A Discord bot for managing ephemeral roles based upon voice channel member presence.

ephemeral-roles A Discord bot for managing ephemeral roles based upon voice channel member presence. Quickstart Click on the Ephemeral Roles logo head

Dec 19, 2022
Bot used for https://discord.gg/rflutterdev

FlutterDoc A bot offering exactly what we need in The r/FlutterDev Discord Server that Dyno can't offer us. Quick search patterns that can be embedded

Dec 8, 2022
An easy-to-use discord bot written in go

Discord Bot An easy-to-use discord bot template written in golang using discordgo. This template was written for learning golang. It will be updated a

Jan 23, 2022
An extension for discordgo to create a Discord bot quickly using the Builder pattern.

botbuilder An extension for discordgo to create a Discord bot quickly using the Builder pattern. Example usage: package main import ( "log" "os"

Oct 12, 2022