Git Product home page Git Product logo

challonge-rs's Introduction

challonge-rs

Crates badge CI Documentation MIT licensed

Client library for the Challonge REST API.

Usage

  1. Log in to Challonge with Challonge::new.
  2. Call API methods to interact with the service.

Documentation

Challonge API documentation.

Features

  • default - uses rustls backend for reqwest.
  • default-tls - uses default-tls backend for reqwest.

Examples

See the examples directory in the source tree.

challonge-rs's People

Contributors

canndrew avatar iddm avatar jmgao avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

challonge-rs's Issues

Fully implement structures

Some fields of structures are not implelemented due to the lack of information on the api.challonge.com web-site or due to the lack of time :)

Tournament:
    // category: ??,
    // <signup-cap nil="true"/>
    // <start-at nil="true"/>    
    // <started-checking-in-at nil="true"/>
    // <state>underway</state>

    // <tie-breaks type="array">
    // <tie-break>match wins vs tied</tie-break>
    // <tie-break>game wins</tie-break>
    // <tie-break>points scored</tie-break>
    // </tie-breaks>

    // <subdomain nil="true"/>
    // <sign-up-url nil="true"/>

Match:
    // attachment_count: ,
    // group_id: ,
    // location: 
    // scheduled_time:
    // underway_at: 

Rewrite the library

  • Use serde crate.
  • Use reqwest crate.
  • Update dependencies.
  • User serde's own deserialisation mechanisms instead of custom methods (struct::decode and the util.rs).
  • Provide more user-friendly interface.
  • Write an online-book.

Can't build openssl v0.7.14

I am working on a project. Until yet, I didn't use challonge-rs. But after adding challonge = "0.4" to my project's dependencies, I get the following error when building the project: error: failed to run custom build command for 'openssl v0.7.14'. This error disappears when I remove challonge from my dependencies.
I was wondering if you had a fix for this issue.

Improve send file in attachment usability

At this moment it needs Vec<u8>. To provide more usability it is better to make some helper-method which takes a file path or web link to avoid reading data manually.

match round can be negative

I got this response from match index get request:

[
  {
    "match": {
      "id": 358485473,
      "tournament_id": 14250816,
      "state": "open",
      "player1_id": 226125204,
      "player2_id": 226125203,
      "player1_prereq_match_id": null,
      "player2_prereq_match_id": null,
      "player1_is_prereq_match_loser": false,
      "player2_is_prereq_match_loser": false,
      "winner_id": null,
      "loser_id": null,
      "started_at": "2024-03-15T12:38:49.140-07:00",
      "created_at": "2024-03-15T12:38:49.052-07:00",
      "updated_at": "2024-03-15T12:38:49.140-07:00",
      "identifier": "A",
      "has_attachment": false,
      "round": 1,
      "player1_votes": null,
      "player2_votes": null,
      "group_id": null,
      "attachment_count": null,
      "scheduled_time": null,
      "location": null,
      "underway_at": null,
      "optional": false,
      "rushb_id": null,
      "completed_at": null,
      "suggested_play_order": 1,
      "forfeited": null,
      "open_graph_image_file_name": null,
      "open_graph_image_content_type": null,
      "open_graph_image_file_size": null,
      "prerequisite_match_ids_csv": "",
      "scores_csv": ""
    }
  },
  {
    "match": {
      "id": 358485474,
      "tournament_id": 14250816,
      "state": "pending",
      "player1_id": 226125205,
      "player2_id": null,
      "player1_prereq_match_id": null,
      "player2_prereq_match_id": 358485473,
      "player1_is_prereq_match_loser": false,
      "player2_is_prereq_match_loser": false,
      "winner_id": null,
      "loser_id": null,
      "started_at": null,
      "created_at": "2024-03-15T12:38:49.057-07:00",
      "updated_at": "2024-03-15T12:38:49.057-07:00",
      "identifier": "B",
      "has_attachment": false,
      "round": 2,
      "player1_votes": null,
      "player2_votes": null,
      "group_id": null,
      "attachment_count": null,
      "scheduled_time": null,
      "location": null,
      "underway_at": null,
      "optional": false,
      "rushb_id": null,
      "completed_at": null,
      "suggested_play_order": 2,
      "forfeited": null,
      "open_graph_image_file_name": null,
      "open_graph_image_content_type": null,
      "open_graph_image_file_size": null,
      "prerequisite_match_ids_csv": "358485473",
      "scores_csv": ""
    }
  },
  {
    "match": {
      "id": 358485475,
      "tournament_id": 14250816,
      "state": "pending",
      "player1_id": null,
      "player2_id": null,
      "player1_prereq_match_id": 358485474,
      "player2_prereq_match_id": 358485473,
      "player1_is_prereq_match_loser": true,
      "player2_is_prereq_match_loser": true,
      "winner_id": null,
      "loser_id": null,
      "started_at": null,
      "created_at": "2024-03-15T12:38:49.063-07:00",
      "updated_at": "2024-03-15T12:38:49.063-07:00",
      "identifier": "E",
      "has_attachment": false,
      "round": -1,
      "player1_votes": null,
      "player2_votes": null,
      "group_id": null,
      "attachment_count": null,
      "scheduled_time": null,
      "location": null,
      "underway_at": null,
      "optional": false,
      "rushb_id": null,
      "completed_at": null,
      "suggested_play_order": 3,
      "forfeited": null,
      "open_graph_image_file_name": null,
      "open_graph_image_content_type": null,
      "open_graph_image_file_size": null,
      "prerequisite_match_ids_csv": "358485474,358485473",
      "scores_csv": ""
    }
  },
  {
    "match": {
      "id": 358485476,
      "tournament_id": 14250816,
      "state": "pending",
      "player1_id": null,
      "player2_id": null,
      "player1_prereq_match_id": 358485474,
      "player2_prereq_match_id": 358485475,
      "player1_is_prereq_match_loser": false,
      "player2_is_prereq_match_loser": false,
      "winner_id": null,
      "loser_id": null,
      "started_at": null,
      "created_at": "2024-03-15T12:38:49.070-07:00",
      "updated_at": "2024-03-15T12:38:49.070-07:00",
      "identifier": "C",
      "has_attachment": false,
      "round": 3,
      "player1_votes": null,
      "player2_votes": null,
      "group_id": null,
      "attachment_count": null,
      "scheduled_time": null,
      "location": null,
      "underway_at": null,
      "optional": false,
      "rushb_id": null,
      "completed_at": null,
      "suggested_play_order": 4,
      "forfeited": null,
      "open_graph_image_file_name": null,
      "open_graph_image_content_type": null,
      "open_graph_image_file_size": null,
      "prerequisite_match_ids_csv": "358485474,358485475",
      "scores_csv": ""
    }
  },
  {
    "match": {
      "id": 358485477,
      "tournament_id": 14250816,
      "state": "pending",
      "player1_id": null,
      "player2_id": null,
      "player1_prereq_match_id": 358485476,
      "player2_prereq_match_id": 358485476,
      "player1_is_prereq_match_loser": false,
      "player2_is_prereq_match_loser": true,
      "winner_id": null,
      "loser_id": null,
      "started_at": null,
      "created_at": "2024-03-15T12:38:49.076-07:00",
      "updated_at": "2024-03-15T12:38:49.076-07:00",
      "identifier": "D",
      "has_attachment": false,
      "round": 3,
      "player1_votes": null,
      "player2_votes": null,
      "group_id": null,
      "attachment_count": null,
      "scheduled_time": null,
      "location": null,
      "underway_at": null,
      "optional": false,
      "rushb_id": null,
      "completed_at": null,
      "suggested_play_order": 5,
      "forfeited": null,
      "open_graph_image_file_name": null,
      "open_graph_image_content_type": null,
      "open_graph_image_file_size": null,
      "prerequisite_match_ids_csv": "358485476",
      "scores_csv": ""
    }
  }
]

however, it is stored in a struct with u64: https://github.com/iddm/challonge-rs/blob/7262d145d7f7fafe2ca7d57c5e86927d179e9da9/src/matches.rs#L223C1-L225C20

this causes a crash

thread 'main' panicked at /Users/tommy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/challonge-0.5.4/src/matches.rs:280:55:
called `Option::unwrap()` on a `None` value

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.