Skip to content

Commit

Permalink
Merge pull request #145 from GreepTheSheep/develop
Browse files Browse the repository at this point in the history
v3.2.2
  • Loading branch information
GreepTheSheep committed Jun 14, 2023
2 parents dcfcd45 + 15fe3ec commit 12354de
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at https://greep.gq/discord. All
reported by contacting the project team at https://greep.fr/discord. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!typings/
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div align="center">

[![Logo](https://raw.githubusercontent.com/GreepTheSheep/node-trackmania.io/main/docs/graphic/image.svg)](https://tmio.greep.gq/#)
[![Logo](https://raw.githubusercontent.com/GreepTheSheep/node-trackmania.io/main/docs/graphic/image.svg)](https://tmio.greep.fr/#)

[![NPM](https://nodei.co/npm/trackmania.io.png?downloads=true&stars=true)](https://npmjs.org/trackmania.io)

[![npm](https://img.shields.io/npm/v/trackmania.io?logo=npm)](https://npmjs.com/trackmania.io)
[![GitHub release](https://img.shields.io/github/v/release/GreepTheSheep/node-trackmania.io?logo=github)](https://github.com/GreepTheSheep/node-trackmania.io/releases/latest)

[![Trackmania.io API Status](https://img.shields.io/website?down_message=Offline&label=Trackmania.io%20API&up_message=Online&url=https%3A%2F%2Ftrackmania.io)](https://trackmania.io)
[![Discord](https://img.shields.io/discord/570024448371982373?label=Discord&logo=discord)](https://greep.gq/discord)
[![Discord](https://img.shields.io/discord/570024448371982373?label=Discord&logo=discord)](https://greep.fr/discord)

[![npm](https://img.shields.io/npm/dw/trackmania.io?logo=npm)](https://npmjs.com/trackmania.io)
[![NPM](https://img.shields.io/npm/l/trackmania.io)](LICENSE)
Expand Down Expand Up @@ -41,7 +41,7 @@ API keys for trackmania.io are not mandatory, but can be used to increase the ra
---
## Documentation

Documentation and examples are available on [this website](https://tmio.greep.gq/#/docs)
Documentation and examples are available on [this website](https://tmio.greep.fr/#/docs)

---
## Contributing
Expand All @@ -51,13 +51,12 @@ Please see the [CONTRIBUTING.md file](CONTRIBUTING.md)
---
## Discussion

If you want to talk about this project or just for saying hi, Join the [Project's Discord Server](https://greep.gq/discord), in the #node-tmio channel
If you want to talk about this project or just for saying hi, Join the [Project's Discord Server](https://greep.fr/discord), in the #node-tmio channel

---
## Projects that use this Trackmania.io library

- [discord-trackmania.io](https://github.com/GreepTheSheep/discord-trackmania.io) by [@GreepTheSheep](https://github.com/GreepTheSheep)
- [The backend of the Random Map Challenge](https://github.com/tm-rmc/backend) by [@GreepTheSheep](https://github.com/GreepTheSheep)
- [state-trackmania-bot](https://github.com/allanjacob/state-trackmania-bot) by [@allanjacob](https://github.com/allanjacob)

Add yours here by opening a PR!
Expand All @@ -68,8 +67,10 @@ Add yours here by opening a PR!
There are a few other implementations of the Trackmania.io API, these are:

- Python: [py-tmio](https://github.com/NottCurious/py-tmio) by [@NottCurious](https://github.com/NottCurious)
- C# (.NET): [TrackmaniaIo.ApiClient](https://github.com/snixtho/TrackmaniaIo.ApiClient) by [@snixtho](https://github.com/snixtho)

Add yours here by opening a PR!

---
## Thanks

Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### This folder contains the configuration file for building the JSDoc, which is used to create the documentation for the website.

## **[View the website](https://tmio.greep.gq/)**
## **[View the website](https://tmio.greep.fr/)**

[View the source code of the website](https://github.com/GreepTheSheep/node-trackmania.io-website/)

[View the JSDoc Output](https://github.com/GreepTheSheep/node-trackmania.io/tree/docs)
[View the JSDoc Output](https://github.com/GreepTheSheep/node-trackmania.io/tree/docs)
79 changes: 34 additions & 45 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trackmania.io",
"version": "3.2.1",
"version": "3.2.2",
"description": "Node.js inplementation of Trackmania Live services (trackmania.io)",
"main": "src/index.js",
"types": "typings/index.d.ts",
Expand All @@ -26,14 +26,14 @@
},
"homepage": "https://tmio.greep.gq/",
"dependencies": {
"luxon": "^3.0.1",
"luxon": "^3.3.0",
"node-fetch": "2.6.7"
},
"devDependencies": {
"@discordjs/docgen": "0.11.1",
"dotenv": "16.0.1",
"dotenv": "16.1.4",
"eslint": "7.31.0",
"mocha": "10.0.0",
"typescript": "4.7.4"
"mocha": "10.2.0",
"typescript": "5.1.3"
}
}
13 changes: 13 additions & 0 deletions src/structures/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,19 @@ class PlayerMeta {
else return null;
}

/**
* The mastodon profile link of the player, if the player has one, otherwise null
* @type {string}
*/
get mastodon(){
if (this.player._data.meta && (this.player._data.meta.mastodon && this.player._data.mastodon != "")) {
let mastodonDomain = this.player._data.meta.mastodon.substring(this.player._data.meta.mastodon.indexOf('@')+1),
mastodonHandle = this.player._data.meta.mastodon.substring(0, this.player._data.meta.mastodon.indexOf('@'));
return "https://"+mastodonDomain+"/@"+mastodonHandle;
}
else return null;
}

/**
* The display URL of the player
* @type {string}
Expand Down
1 change: 0 additions & 1 deletion test/players.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ describe("Players", function(){
it("Greep", async function(){
const player = await tmioClient.players.get("greep");
assert.equal(player.id, "26d9a7de-4067-4926-9d93-2fe62cd869fc", "Wrong account ID");
assert.equal(player.zone[0].name, "Yonne");
assert.equal(player.meta.inNadeo, false);
assert.equal(player.meta.inTMIOTeam, false);
});
Expand Down

0 comments on commit 12354de

Please sign in to comment.