Skip to content

Instantly share code, notes, and snippets.

@AamuLumi
Last active May 8, 2016 13:31
Show Gist options
  • Save AamuLumi/9b62175cba353937fd97b6589274bb32 to your computer and use it in GitHub Desktop.
Save AamuLumi/9b62175cba353937fd97b6589274bb32 to your computer and use it in GitHub Desktop.
Prochaine fois, je te transforme en composant React.
// En fait, y'a aucune raison de mettre du JSX, mais Jean déteste ça.
import {
Trainee,
CEO
} from 'Promyze';
import {
Brain
} from 'human-features';
import Facebook from 'facebook';
import {
AamuLumi
} from 'gods';
class JeanBatista extends Trainee {
constructor() {
this.beard = true;
this.cycle = true;
this.brain = new Brain().populate({
ideas: [
'Stream[ON]', 'Overwatch',
'Hearthstone'
],
currentMood: Brain.Mood.NoProblemCurrently,
think : undefined
});
this.smile = undefined;
this.on('view-facebook-message', (author) => {
if (author.name === AamuLumi.getFullName()) {
this.brainState(
'omg il est trop con ce con',
Brain.Mood.WTF
);
}
});
}
askForHolidays() {
return new Promise((success, failed) => {
CEO.on('response-holiday', (isOk) => {
this.smile = isOk;
isOk ? success() : failed();
});
});
}
canGoToArdeche() {
this.askForHolidays().then(() => {
this.sendMessageOnFacebook(
'ok les copains mes congés sont passés :)))'
);
}).catch(() => {
this.sendMessageOnFacebook(
'bon bah pas de vacances pour moi désolé :((('
);
});
}
sendMessageOnFacebook(msg) {
Facebook.authenticate(this).send(msg).end();
}
brainState(think, mood) {
this.brain.populate({
think : think,
mood : mood
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment