-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wiki isn't a Constructor #32
Comments
Try converting all the Wiki is not a class anymore. It is a function which returns an object with other functions. Also, to help remember this, I normally would use lower case when using and requiring. var wiki = require('wikijs');
wiki().search('hello')... |
Did what you told me, but now it says wiki isn't a function ._.
|
Try |
Thanks it worked Finally :D |
Great! |
I was trying to build a bot that gets from wiki a simple summary about the User Search.
Everything is good, but gives a error saying Wiki isnt Constructor. Whats that?.
{ var Wiki = require('wikijs'); var term = args.join(' '); if (!term) { msg.channel.sendMessage("Please Enter a Term to Search for it in the Wiki."); return; } msg.channel.sendMessage(":mag_right: Searching for your Term..").then(m => { new Wiki().search(term, 1).then(function(data) { new Wiki().page(data.results[0]).then(function(page) { page.summary().then(function(summary) { var sumText = summary.toString().split('\n'); var continuation = function() { var paragraph = sumText.shift(); msg.channel.sendMessage(paragraph); console.log(paragraph); console.log(sumText); if (paragraph) { m.edit(paragraph); msg.channel.sendMessage(paragraph); msg.channel.sendMessage(sumText); } msg.channel.sendMessage(paragraph); }; continuation(); }); }); }, function(err) { m.edit(err); }); }) };
Thank you if you helped ^^
The text was updated successfully, but these errors were encountered: