Comments (10)
@iswanj Go for it
from youpin-bot.
This repo still uses console
a lot. So, I think you can disable it in .eslintrc
for now. We may refactor it later.
from youpin-bot.
@supasate I'll take this
from youpin-bot.
@supasate I found lint issue in messenger.js
. There is lint rule for no-console
, so I can dissable lint warn for these specific lines. or is there any other solution ?
if (!error && response.statusCode === 200) {
console.log('Successfully sent generic message ' +
`with id ${body.message_id} to recipient ${body
body.recipient_id}`);
} else {
console.error('Unable to send message.');
console.error(response);
console.error(error);
}
from youpin-bot.
refreshToken() {
// TO-DO: Call /token/auth/refresh instead
const app = feathers()
.configure(hooks())
.configure(rest(this.uri).superagent(request))
.configure(authentication());
new Promise((resolve, reject) => {
app.authenticate({
type: 'local',
'email': this.username,
'password': this.password
}).then(result => {
this.token = app.get('token');
resolve(this);
}).catch(error => {
console.log(error);
reject(error);
});
});
}
Inside refreshToken function, getting an eslint warn for "no-new" ( Do not use new for side effects ). So I'm gonna ignore "no-new" rull, any thoughts...?
from youpin-bot.
Also found another error "Fatal Parsing error: Unexpected token" on
let context = await (conversation.getContext(userid));
on this line
from youpin-bot.
@iswanj The "no new for side effect" warning is there because wrapping the call to app.authenticate
in a promise is useless (as app.authenticate already returns a Promise, plus the resulting promise is unused). The code could be written like this:
app.authenticate({
type: 'local',
'email': this.username,
'password': this.password
}).then(result => {
this.token = app.get('token');
}).catch(error => {
console.log(error);
});
from youpin-bot.
@iswanj For parsing error of await, you can eslint-disable-line
.
The reason is we use asyncawait
which async
and await
are functions that take another functions as arguments. (They just make them look alike keywords but they are, literally, functions).
That's different from async
and await
in ES7 which are keywords.
Therefore, eslint expects the following ES7 format:
onMessaged: async (event) => {
...
await conversation.getContext(userid)
}
We may refactor it later when we move to ES7.
from youpin-bot.
@supasate I think eslint-disable-line
is working for the rules only.
from youpin-bot.
You're right. So, I think we can left it unless we find a workaround.
from youpin-bot.
Related Issues (20)
- Use a proper framework to handle i18n strings HOT 1
- Implement refresh token when token expires
- Stop asking for a location if a photo can provide EXIF location HOT 1
- Report a problem (skip the menu/choices) if the first message is a photo HOT 2
- Remove duplicate tags HOT 6
- [Feature] Suggest similar pins
- Create dev environment for testing HOT 1
- Create secret love from Auntie YouPin <3 HOT 1
- Test API's video upload routing
- Test 3rd-party app API KEY
- Chosen categories should not reappear in the category list HOT 3
- Create unit tests HOT 4
- Add contributing guideline
- Create state diagram of chat flow. HOT 2
- More neutral voice to the bot's speech HOT 1
- Bot is too persistent when user gave description too short HOT 1
- Change pin URL
- Mapping Facebook bot's and YouPin's user
- Discussion: Ask user's contact email and mobile HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from youpin-bot.