STEEMPUNK-NET REST API and Discord Bot Extension

in #utopian-io6 years ago (edited)

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

Sort:  

This is such a great addition to the server. :)

Wunderbar!

Thank you. A little more and we can talk in German :P

Jetzt wäre das nicht lustig? lol

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Battle News? That's awesome idea... This made me remember about SteemPunk, battled you now~

Hey @dehenne I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x