STEEMPUNK-NET REST API and Discord Bot Extension

Words
175
Reading
1 min
Listen
Play
9y

STEEMPUNK-NET

I created a new feature for our new STEEMPUNK-NET Discord Bot and developed a REST API for the STEEMPUNK-NET.

New Features

  • What feature(s) did you add?

A complete REST API for the STEEMPUNK-NET.

This API was also built directly into the Discord Bot. When a player registers at STEEMPUNK-NET, the Discord Bot gets this through the REST API. The new player will be posted on the #battle-news channel (Issue: https://github.com/pcsg/steempunknet-discord-bot/issues/2)

  • How did you implement it/them?

The new REST API:

// get all usernames in spn
https://www.steempunk.net/api/spn/v1/fighters

// get a user (api/spn/v1/fighters/{username}/)
https://www.steempunk.net/api/spn/v1/fighters/dehenne

// get spn stats
https://www.steempunk.net/api/spn/v1/stats

// battles (api/spn/v1/battles/{battleId}/)

// get a specific battle
https://www.steempunk.net/api/spn/v1/battles/14083

// get the newest battle
https://www.steempunk.net/api/spn/v1/battles?limit=1

// get the 10 newest battles
https://www.steempunk.net/api/spn/v1/battles?limit=10

// get the 10 oldes battles
https://www.steempunk.net/api/spn/v1/battles?limit=10&orderType=ASC

// get the battles between two dates
https://www.steempunk.net/api/spn/v1/battles?dateFrom=2018-01-01&dateTo=2018-01-31

// get the battles between two dates combined with order and limit
https://www.steempunk.net/api/spn/v1/battles?dateFrom=2018-01-01&dateTo=2018-01-31&orderField=challengeTime&orderType=DESC&limit=2

The implementation of the REST API into the Bot can you find in the following pull request:

https://github.com/pcsg/steempunknet-discord-bot/commit/fa977f6fd69af33689fabc26d7e50ed8a25dc173

The result in the Discord chat looks like:

SPN User


To all my follower, you will receive more news in the STEEMPUNK-NET weekly News. To all developers, i hope you have more ideas about what to do with the REST API. I wish you a lot of fun. :-)

The bot is now getting more and more extended and gets also game extension. If you miss certain things, just let me know.



Posted on Utopian.io - Rewarding Open Source Contributors

STEEMPUNK-NET REST API and Discord Bot Extension | Ecency