/LFGBot

(2023) Looking For Group / Inhouse Discord bot

Primary LanguageElixir

🎮 LFG Bot 🤖

LFG = "Looking For Group" or "Looking For Game"

A Discord bot for organizing in-house 5v5 matches of Counter-Strike, Valorant, Overwatch, etc

One user starts a group, and 9 other users click the "join" button to be placed on a team.

Teams are shown in the bot's message, and can be shuffled by the group leader.

Screenshots

Startup Message

the discord bot's startup message, with a button underneath labelled 'new group'

Empty Teams

a discord message showing a group with two empty teams, and buttons to leave/join or control the session underneath

Full Teams

a discord message showing a group with 10 players split between two teams, and buttons to leave/join or control the session underneath

Dev & Contributing

Project is open for contributions!

The bot is written in Elixir and uses the Nostrum library to interact with Discord.

The core data layer is using the Ash framework and is backed by a PostgreSQL database (definitely overkill, but the official Ash SQLite integration wasn't available yet!).

The production instance is deployed on Fly.io.

Things you'll need in order to contribute
  • Elixir
  • A PostgreSQL database
  • A Discord developer app for testing your changes locally
    • Learn about app development here
    • Create an app here
  • An environment variable on your system called LFG_NOSTRUM_TOKEN
    • Once you've made an app in the Discord developer portal (see section above), you can get your token from the settings page in the "Bot" section, under the "Build-A-Bot" header.
    • Copy the token and set yourself an environment variable named LFG_NOSTRUM_TOKEN
    • Keep your token secret!
  • A Discord server for testing your changes
    • It's recommended to use a personal server for this, just in case
    • Once you've made an app in the Discord developer portal (see section above), you can add that bot to your server by:
      • Getting your client ID from the OAuth2 section
      • Substituting your client ID in this URL: https://discord.com/api/oauth2/authorize?client_id=<YOUR_CLIENT_ID_HERE>&permissions=53687158848&scope=bot
      • Opening that URL in your browser

Unless I've missed something, after all this, you should be able to run the elixir application and interact with the bot in your testing server.


Repo Points of Interest


Diagrams