fakeyou.js is a powerful Node.js module that allows you to interact with the FakeYouAPI easily.
- Login or use your token
- Search models
- Make TTS requests
- LeaderBoard
- Edit client user
- Get all data from an entity
const FakeYou = require('fakeyou.js');
const fy = new FakeYou.Client({
token: 'anOptionalSecretToken',
usernameOrEmail: 'anOptionalCoolUsernameOrEmail',
password: 'anOptionalSuperSecretPassword'
});
await fy.start(); //required
let models = fy.searchModel('mario');
models.first();
await fy.makeTTS('mario', 'A cool text to speech');
//or
let model = fy.searchModel('mario').first();
if(model) {
await model.request('A cool text to speech');
}
let lb = await fy.leaderboard();
lb.getPosition(3, true);
await fy.user.edit({
description: 'Another **random** user in FakeYou',
twitter: null,
github: 'a-cool-username',
ttsVisibility: false
});
await fy.models.fetch('TM:7wbtjphx8h8v');
//or
await fy.fetchUser('acoolusername');
//or
let result = fy.results.cache.get('TR:tn7gq96wg6httvnq91y4y9fka76nj');
if(result) {
await result.fetch()
}