GithubHelp home page GithubHelp logo

tyrannasaurusbanks / leroy-discord-webhook Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 740 KB

Ugly javascript to automate google forms creation/summation & output to google sheets + discord.

JavaScript 100.00%
fantasy football auction draft discord leroy ff

leroy-discord-webhook's Introduction

Inspired by Google forms to discord.

What (words)

Ugly javascript which:

  • Automates creation of google forms for daily fantasty football auctions
  • Sends auction/form links, reminders & end summary/winners to a discord channel
  • Read/Writes auction state and team rosters/budgets to a google sheet.

What (pictures)

Screenshot 2021-05-08 at 15 33 48

Screenshot 2021-05-04 at 20 20 29

Screenshot 2021-05-04 at 20 22 11

Screenshot 2021-05-04 at 20 17 44

Screenshot 2021-05-04 at 20 20 46

Screenshot 2021-05-04 at 20 35 07

Why

Used for Casa Del Leroy Fantasy Football league to conduct daily Vickery blind-auctions for a slow Fantasy football draft. We were converting from redraft to dyansty & we thought we'd do something special for the startup auction whilst lock down was going on.

How

This section will be a guide for a Leroy on how to create form (any special formatting), how to attach the script, any options to toggle on form.

Form info

Daily auction are created from a auctions sheet. The nomination list needs to be in the following format:

| playerA | playerB | auction date - dd/mm/yyyy | form-url - this will be filled in by script |
| Tom Brady |	Cam Newton |	4/20/2020 |	https://docs.google.com/forms/d/<UID>/edit |

PlayerA and auction date a mandatory.

Running createWeeklyAuctionForms() will:

  • read all the auctions entries from a google sheet tab
  • filter out ones which already have a form (as evident by presence of a form-url)
  • create a form for playerA (and playerB if present)
  • attach a onSubmit() trigger to the form which will log bids as they come in (for audit purposes in case some jackass disputes)
  • attach a datetime trigger to close & summarise the auction at a set time
  • submit a dummy $1 bid in place of the person who nominated the players
  • post a link of all auctions created to discord.

We run this once a week:

  • we take nominations in a free form on Sunday day
  • format them into 1 or 2 player per-day in the auctions sheet
  • run the script to create auctions for the coming week.

End of day summaries

The timer trigger assigned to the forms at creation are scheduled to run the function endDailyAuctions() on the day which auction finishes. It will read the auctions list, filter out any not ending today (the date the script is running), and will order the bids, find a winner, and send a summary to discord.

It' all write results to a separate tab in th summary spreadsheet in the following format:

| user |	player |	bid |	time |	win |
| [email protected]	| Justin Jackson|	1	| 4/16/2020	| |

Summary note for the auction

A receipt of your form submission will be sent to the specified email address.
You will need a valid email to bid - please use the same email for every auction - this will allow us to track budgets.

Live budgets can be found here: <link to google sheet>

Auction Rules:
- Starting budget is $10,000.
- The auction will close at 9pm GMT, at which point the form will lock.
- You can edit your bids as many times as you want.
- You need to draft a full roster (15 players) but it doesn't have to be a valid starting lineup.
- As soon as you have 15 players, your draft ends.                                   

Auction Format:
- Auctions are conducted using the Vickery Method.
- Bids are blind & sealed.
- The highest bidder wins but the price paid is the second-highest bid.
- Nominations are effectively a $1 bid from the nominating-team.

Auction Technical Details:
- Bids should be whole numbers - decimals will be rounded down.
- Max bid = remaining budget - num players needed to complete roster + 1
- If you bid more than your 'max bid' then your bid will be struck off. 
- If you win both auctions but cannot afford both players then the highest bid will take priority and your bids from the other player auction(s) will be stuck off.
- If you win both auctions with equal bids, the first listed auction will take priority.

Auction Results:
- Full results (who bid what) will be send to the Leroy Discord channel & draft summary spread sheet after auction closes.
- If you don't want to bid on a player, leave the player's box empty.
- If you don't want to bid on any players, don't even need to submit the form.

Auction Tie Breakers
- In the event of equal bids, earliest bid wins.```

Useful

This was super useful: https://leovoel.github.io/embed-visualizer/

leroy-discord-webhook's People

Contributors

tyrannasaurusbanks avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.