| 112 | } |
| 113 | |
| 114 | pub async fn get_user_info(self) -> Result<Response> { |
| 115 | trace!("Requesting user info..."); |
| 116 | let url = &self.conf.sys.urls.graphql; |
| 117 | let mut json: Json = HashMap::new(); |
| 118 | json.insert("operationName", "a".to_string()); |
| 119 | json.insert( |
| 120 | "query", |
| 121 | "query a { |
| 122 | user { |
| 123 | username |
| 124 | isCurrentUserPremium |
| 125 | } |
| 126 | }" |
| 127 | .to_owned(), |
| 128 | ); |
| 129 | |
| 130 | Req { |
| 131 | default_headers: self.default_headers, |
| 132 | refer: None, |
| 133 | info: false, |
| 134 | json: Some(json), |
| 135 | mode: Mode::Post, |
| 136 | name: "get_user_info", |
| 137 | url: (*url).to_string(), |
| 138 | } |
| 139 | .send(&self.client) |
| 140 | .await |
| 141 | } |
| 142 | |
| 143 | /// Get daily problem |
| 144 | pub async fn get_question_daily(self) -> Result<Response> { |