Repository for the Bott the Pigeon Discord bot.

Bott The Pigeon

Monorepo for the Discord Bot "Bott The Pigeon" (Or Scott the Pigeon). It is written entirely in Golang, using the Discord API, and is cloud-native, using the AWS SDK wherever possible. Currently this is a super simple stack running on an ec2 t2.micro on-demand instance, with IAM access to SSM Parameter Store to get the bot credentials. It starts up and shuts down with the instance, and supports full CI/CD using CodePipeline (The very boilerplate-y .yml files will give you an idea). Oh - feature-wise, it just spits out a message when you tag it, but obviously that will change.

Usage Info:

  • Just do a go build or a go run main.go, if you have the AWS access keys (or you use your own and configure similar resources), it'll work.
  • Obviously this uses AWS programmatic access (And it uses it to get the Discord token, too), so you'll need access keys locally if you want anything to work. You can always hook this up to your own AWS account, with your own bots - it'll work exactly the same (provided you either change the Parameter path of /btp/, or use it). But if you need access keys to Scott's resources, contact me.
  • The application is run in test mode by default. If you want to run using the production bot, use the --prod flag.
    • "Test mode" refers to using the replica application specifically built for feature testing in development.

Branch Structure:

'release' serves as the default branch - what is typically 'main' or 'master'. This is arguably an unusual pattern, but the default branch should, generally, be kept in a buildable state. By extension, it makes sense for the branch that is most likely to be buildable to be the branch that is actually built using CI. 'dev' is the main branch for development. There are feature branches, but generally the intention is for this project to be as simple as possible, in line with how Go operates. Using just these two branches in general makes understanding the repository much easier.

Project Hierarchy:

This is the logical hierarchy, according to how Go sees it. The directories within the repository should imitate this - perhaps with the exception of the main package, in the root. Each of these should be fairly self-explanatory - capitalised are the modules that should be used as entrypoints to the application. Obviously, this is very much subject to change as feature additions and therefore architectural considerations emerge.

  • Module: Bott-The-Pigeon
    • Package: MAIN
    • Package: AWS-Utils (This is completely generic AWS stuff, like session init. Things like getting something from a specific ARN on a particular AWS service should be written within the context of the logic it is used in - probably the Bot-Utils handlers. Otherwise 90% of the application would be inside AWS-Utils, which doesn't make as much sense as it all being within the context of the bot itself.)
      • Package: Session
      • Package: AWSEnv
    • Package: Bot-Utils (Most stuff should go here - any specific features that the bot offers, basically, which is most of the application.)
      • Package: Init
      • Package: Handlers
        • Package: On-Message-Handlers (Since many different kinds of events can occur based on a message being sent.)
    • Package: TESTS

Naming Conventions:

Golang naming conventions are pretty interesting with regards to capitalisation and camel casing, but follow those. Additionally, folders and files should be lower-case and hyphenated. We can use _* to indicate some sort of functional distinction, such as _test for test files, so ensure hyphens are instead used for word spacing. For example, bot-utils/on-message. Packages should match the folder structure - packages cannot contain hyphens, so should simply be an un-hyphenated version of the folder name. A bit ugly, but any possible ambiguity is removed by the folder name.

TODO

Comments
  • Bot commands work when sent mid-message

    Bot commands work when sent mid-message

    Bot commands still work even if they are placed in the middle of a message - this could definitely raise many issues in future (one possible example is malformed 'todo' strings in GitHub). Bot commands should only work when placed at the start of the message, verbatim, and with the command prefix.

  • GIFs come back from random image command as .jpg files

    GIFs come back from random image command as .jpg files

    Objects returned from the random pigeon image command are always called "pigeon.jpg". This is okay, but it also seems to mean that GIFs don't work.

  • All HTTP request/responses should be their own structures

    All HTTP request/responses should be their own structures

    Related to #9.

    HTTP requests can sometimes just be a set of strings. The compiler doesn't know which string goes where, so if passed in the wrong order, not fun, obviously.

    Therefore all requests and responses should be defined as structs (although responses should only capture the fields that they NEED - no point using response data we don't want).

  • Genericise OnTodo HTTP code for quicker calls in future

    Genericise OnTodo HTTP code for quicker calls in future

    All HTTP code (including request, response read, and ideally header adding and parsing too) from OnTodo should be genericised and placed in its own "http-utils" package. As it is now, simple HTTP requests take 100+ LOC to perform; it's too much work.

  • Add CloudWatch logging for log preservation

    Add CloudWatch logging for log preservation

    Given I am a member of a Discord server with this bot When the bot throws an error Then I will be notified of the error with an associated error GUID.

    Given I am a developer of the Discord bot When the bot throws an error Then I will be able to use the error GUID from the message to search the error which will have been logged in CloudWatch So that the developer can diagnose bugs more easily.

  • Interface for posting change requests to GH project

    Interface for posting change requests to GH project

    Given I am a member of a Discord server with this bot When I type >todo (change request) followed by a requested change Then the application will post the suggestion as a card in the "To Do - Suggestions" column of the Bott The Pigeon project board So that developers will be informed of what suggestions have been made for the bot's development.

  • Bot can be tagged for help

    Bot can be tagged for help

    Given I am a member of a Discord server with this bot When I tag the bot for help (i.e., @Bott The Pigeon !support) Then the bot will respond with a list of commands and their use So that everyone knows how to use the bot.

  • Random image from S3 should be attachment

    Random image from S3 should be attachment

    Currently, the random image selected from the pigeon-pics S3 bucket is embedded, not added as an attachment to the message. Embedding looks uglier (and isn't really standard) in Discord, plus it promotes the use of an expiring auth token, which means images will disappear after a period of time. Currently, this is five minutes - but any period of time isn't ideal.

  • Patch Gorilla websocket dependency vulnerability

    Patch Gorilla websocket dependency vulnerability

    The version of Gorilla websocket that the Discord Go API requires by default is version 1.4.0 - versions < 1.4.1 are flagged by GitHub as a security vulnerability. Look into this at least, and patch if possible and appropriate to do so.

  • Update start script to restart application on deploy

    Update start script to restart application on deploy

    The start script currently starts a new process for every deployment made to the EC2 instance. It does update the code, but existing processes need to be killed so that duplicate outputs from the bot application aren't produced.

  • Host a basic Discord bot

    Host a basic Discord bot

    Given I am a member of a Discord server with this bot When I tag the bot in a channel Then the bot will respond in that channel with a message So that everyone knows the bot is working.

    Note: The message can be anything. Probably a funny message.

  • Bot can be asked for a random game suggestion

    Bot can be asked for a random game suggestion

    "Ask Scott what we can play and he picks out a random game we can play together (he's dumb tho so we might not always choose what he picks)"

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 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
Bot para o discord escrito em Golang durante o workshop ministrado na Codecon 2021

Codecon Bot Bot para o discord escrito em Golang durante o workshop ministrado na Codecon 2021 Primeiramente no arquivo main.go coloque o TOKEN do bot

Oct 4, 2021
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
morko discord bot with go

Commands Command Description commands Lists commands google Fetches a Google image help Describes the usage of the command. ping Ping

Oct 19, 2021
An easy-to-use discord bot template written in golang using discordgo

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

Oct 30, 2021
Pulseline Discord bot

Pulseline Discord bot Currently used in the FreeBSD Discord server to relay incoming GitHub web-hook events to a desired channel, showing information

Nov 21, 2022
Discord Bot written in Go. Created for 'Intro to Golang', Fall 21

goDiscordBot Discord Bot written in Go. Created for 'Intro to Golang', Fall 21 Session where we coded the bot (goes over setup steps): https://gdsc.co

Nov 3, 2021
A bot connect line to discord
A bot connect line to discord

Line2Discord (L2D) How to use See quickstart.md features Line --> Discord Message Image File Video Voice... Discord --> Line Message Image File Video

Jul 1, 2022