Giter Site home page Giter Site logo

barkeep's Introduction

Barkeep

A bot to serve drinks

Setup

  1. pip install -r requirements.txt
  2. cp .env.example .env
    • Set TOKEN to your bot's token
    • Set SERVER_ID to your discord server id

barkeep's People

Contributors

erniemist avatar mattkershaw-cap avatar tinnyf avatar

Watchers

 avatar

barkeep's Issues

Simplify drinks

Goal

Simplify Drink.py.

Currently Drink.py stores the name and article of a drink separately and uses some logic to generate the appropriate article for the drink based on the entry in drinks.txt. The only usage of Drink then concatenates the article and name together, making this logic superfluous.

Solution

  1. Add the appropriate article to each entry in drinks.txt. This will be specified explicitly in the format article|name, or be a/an if no article is specified.
  2. Remove the Drink dataclass.
  3. Remove the hydrate method and just use the value from the file directly.
  4. Use the selected string for the drink directly in main.py instead of attempting to concatenate the article and name.

Extract server id

Goal

Enable separation of production and development environments by extracting the server id to an uncommitted file.

Solution

  • Create server_id.txt in both environments with the server id in.
  • In main.py read in the server id from a file in the Client setup_hook method.
  • Add README.md explaining this setup

Add workflow to run tests

Goal

Run all tests every time a branch is pushed so we don't accidentally break them without noticing

Solution

Add a github workflow that runs tests on push.

Upgrade to Discord v2

Goal

The existing code doesn't work with the discord.py v2.3.2 and needs upgrading.

Solution

  1. Add a requirements.txt specifying the discord.py version.
  2. Follow this guide to set up the discord bot.

Add Avalon to bot

#Goal

  • Distribute Avalon roles to users
    • Give users required information
  • Seating Order
  • Handle quests
    • Users vote approve/veto
    • Questers vote pass/fail
    • Output both outcomes once all required votes have received

#Solution

Roles we want

  • Good
  • Evil
  • Morgana
  • Percival
  • Merlin
  • Mordred
  • Assassin
  • Cleric
  • Troublemaker
  • Trickster
  • Oberon
  • Good Lancelot
  • Evil Lancelot

Role

  • Team
  • Info on startup
    • Get given list of people and what roles they are
    • Start Player
  • Name
  • Team it appears as if revealed (defaults to Team)
  • Team it appears as to Merlin (defaults to Team)
  • Hides from evil (default: no)

/Start Game

  • Clear previous game info
  • Distribute Roles
    • Make a list of everyone playing
    • Shuffle it
    • Display the list
    • Give everyone a role
    • Tell everyone their role and hidden info
    • store a list of players (as discord Member.ids?)

Quests
Persistent knowledge of current quest and its state handled by writing to a file (.JSON)

Proposal Phase

  • Quest Proposal is given
  • Ping players of game
  • Store Quest Proposal
    • Stored with Candidates, People who have voted
  • Electorate can become voters
  • When everyone has voted...
  • Either:
    • Ping everyone to say the quest has not been greenlit
    • Ping everyone to say the quest is a-go
  • Create and store a Quest
    • A quest has candidates and people who have voted
    • Thus the proposal needs to know who all is on the quest

Quest Phase

  • Candidates can become voters

  • Once candidates have voted:

    • Either:
      • Ping everyone to say how many success/failures have happened.
  • quest-create: creates a quest unless there's an active quest

  • quest-display: displays active quest if any

  • quest-vote-approval: creates a dialogue to vote on the current quest (approve/veto)

  • quest-vote-succeed: creates a dialogue to vote on the current quest (success/fail)

  • quest-close: forces current quest to close (use for mistakes)

  • game-create: starts a new game

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.