Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fajnyCreeper committed Nov 30, 2019
1 parent 4fbbaa2 commit a55ce9e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
# SEContestCommands
Chat commands for StreamElements' Contests

## Credentials
* Create file called `SEContestChatCommands.credentials.php`
* The file will contain three variables
* `$key` - random string, that is used in URL
* `$channel` SE Account ID that you can find [here](https://streamelements.com/dashboard/account/channels)
* `$bearer` SE JWT Token that you can find [here](https://streamelements.com/dashboard/account/channels) (After clicking "Show secrets")


## Request
This will explain all possible variables
* `key` - user generated string from
* `action` - action, that the API should do (start, close, draw bets)
* `name` - name of bets (used with action _"start"_)
* `duration` - duration of bets in minutes (used with action _"start"_)
* `options` - options to bet, separated by space (underscore used as space) (used with action _"start"_)
* `winner` winning option (used with action _"draw"_)

## Chat commands
Examples are using base command `!bets`
```
!bets start <Bets_title> <Duration> <1st_option> ... <10th_option>
!bets close
!bets draw <Winning_option>
```

### Request on API
This will show example body of StreamElements command
```
${customapi.example.com/SEContestChatCommands.php?key=my_key&action=${pathescape ${1}}&name=${pathescape ${2|${1}}}&duration=${pathescape ${3|${1}}}&options=${pathescape ${4:|${1}}}&winner=${pathescape ${2:|' '}}}
```

0 comments on commit a55ce9e

Please sign in to comment.