You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
476 B
16 lines
476 B
|
2 years ago
|
## Get Today's Track Of The Day
|
||
|
|
|
||
|
|
```js
|
||
|
|
const TMIO = require('trackmania.io'),
|
||
|
|
client = new TMIO.Client();
|
||
|
|
|
||
|
|
client.totd.get(new Date()).then(async totd=>{
|
||
|
|
const map = await totd.map(),
|
||
|
|
author = await map.author();
|
||
|
|
|
||
|
|
// Map names aren't formatted by default (color codes for example), so we need to format them
|
||
|
|
const mapName = client.stripFormat(map.name);
|
||
|
|
|
||
|
|
console.log("Today's TOTD is called", mapName, "and it was created by", author.name);
|
||
|
|
});
|
||
|
|
```
|