dcsan / gitterbot Goto Github PK
View Code? Open in Web Editor NEWGitterBot / gitter chatbot with Wiki integration, and more!
Home Page: https://gitter.im/dcsan/gitterbot
GitterBot / gitter chatbot with Wiki integration, and more!
Home Page: https://gitter.im/dcsan/gitterbot
eg
^bonfire mutations
set the current bonfire topic inside the bot
if bonfire room, send a detailed message with options
if mainchats, just send a short info message
we have [four] hints.
hint
will show a hint.comments
will show user commentsseed
will remind you about the javascripton response from about
api call.
bot-0 (err): SyntaxError: Unexpected end of input
bot-0 (err): at Object.parse (native)
bot-0 (err): at IncomingMessage.<anonymous> (/home/freecodecamp/www/gitterbot/nap/lib/utils/HttpWrap.js:30:33)
bot-0 (err): at emitNone (events.js:72:20)
bot-0 (err): at IncomingMessage.emit (events.js:166:7)
bot-0 (err): at endReadableNT (_stream_readable.js:889:12)
bot-0 (err): at doNTCallback2 (node.js:430:9)
bot-0 (err): at process._tickCallback (node.js:344:17)
bot-0 (err): connect.multipart() will be removed in connect 3.0
bot-0 (err): visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
bot-0 (err): connect.limit() will be removed in connect 3.0
@BerkeleyTrue it would be great if you could add links to the rooms
scan all text input
when a user mentions a bonfire by name
open a subtle prompt directing them to the room about that bonfire
people often type like:
@terabyte thanks, will check out the readme
that should be picked up / filtered in the same way as normal thanks @xx
use a regex to match in the whole input.
we may have to add another part to the "parseInput" section to handle these
any ideas why the call to the userinfo api would sometimes take > 2000ms? and sometimes not...
i have an Async test in there but i think the done()
is in the right place.
"use strict";
var expect = require("chai").expect;
var HttpWrap = require("../lib/utils/HttpWrap.js"),
Utils = require("../lib/utils/Utils"),
TestHelper = require("./TestHelper");
function clog(msg, obj) {
Utils.warn("HttpWrapSpec>", msg, obj);
}
// "no-unused-expressions": [0]
// var showInfo = function(input, bot, blob) {
// clog("showInfo", blob);
// expect(blob.about.username).to.equal("berkeleytrueX");
// };
describe("HttpWrap", function () {
it("should load user info", function(done) {
// var input = TestHelper.stubInput;
// var bot = "dummyBot";
var name = "berkeleytrue";
var apiPath = '/api/users/about?username=' + name;
HttpWrap.getApi(apiPath, function(apiResult) {
console.log(apiResult);
expect(apiResult.about.username).to.equal("berkeleytrue");
expect(apiResult.about.github).to.equal("http://github.com/BerkeleyTrue");
// expect(apiResult.about.bio).to.include("something");
done();
});
});
});
very simple first feature to respond to hello world
differently from just hello
could be possible, and this would then open an edit page directly for the user with their discussion thread.
they could then review it.
count not find receiver for %s
should be could not
when a user helps you in the chat, enable a way to give that user some karma
console.log(x)
will print stuff out that messes up the log view, and its hard to find where the method is.
try using arguments.caller or the stack to see where the method was called from and add that.
its confusing whether to use find (search) or help(wiki page)
these could be merged
eg help js
find all titles with js
in them
if more than one, show a list
if exactly one then show that entry right away
if its not an exact match it should still return options eg
help ternary
should match js ternary
currently help just looks for an exact filename
ideally we could do some kind of fuzzy search for misspellings, and also rank the results, but that's way out.
search
should deep search the content of all the articles, not just the titles.
find
just looks at titles
some users have wiki content material
this could be formatted and "stepped through"
https://github.com/Rafase282/My-FreeCodeCamp-Code
https://github.com/luishendrix92/My-FreeCodeCamp-Path/wiki/Bonfire:-Factorialize-a-number
https://github.com/luishendrix92/My-FreeCodeCamp-Path/wiki/Bonfire:-Check-for-Palindromes
git update to latest wiki data
based on incoming topic=X
link
to stop a user spamming with commands over and over.
circleCI ?
I don't see any bio info coming back from the API
request:
{ host: 'beta.freecodecamp.com',
port: 80,
path: '/api/users/about?username=quincylarson' }
response:
{ about: { username: 'quincylarson', github: '', browniePoints: 137 } }
if you send karma to multiple people
ideally the calls to send karma should be refactored as they currently rely on returning their message.
simple fix: instead just use an async bot.says()
so the messages can go out and control flow will continue to the next send event.
better fix maybe to create a single message like
dc sends karma to @user1 and @user2
if multiple users
https://github.com/gitterHQ/realtime-client
https://developer.gitter.im/docs/faye-endpoint
so we can get other user events, like being pinged with a DM
@QuincyLarson can you send me login info for the camperbot account? I'll need to authenticate it with gitter etc.
i'll make a ticket just in case...
sending thanks to an unknown user gives this error
showInfo { error:
{ name: 'Error',
status: 401,
message: 'Authorization Required',
statusCode: 401,
code: 'AUTHORIZATION_REQUIRED' } }
when the wiki is updated, we can get a gollum event
however, we should only respond to this one event at a time so we don't get two github pulls happening at the same time
helpbot you can ask questions and it will answer on various topics, a little bit like unix man pages but for javascript
madness lies here
http://eslint.org/docs/rules/strict
every link should have a URL, so goto the room specified
if there is one announce the topic
ie disable the reverse logic to look up a room from the topic.
I confirmed you can't double send to the same user, but this makes it a bit hard to test as i can only use each user once.
would be great to have a way to reset the log so I can resend
or add a secret force:true option for testing, to ignore the log check
for DMs so each chat can have its own topic and context, history independent of the others
[ Anyone know | can someone tell me how to | How do I ]
[ type code in the editor | .... ]
search for these FAQs and the bot can send a nice hint
maybe you're looking for this article? [how to enter code]
@QuincyLarson can you give me access to FCC main repo?
so i can read/write the wiki files from a local checkout.
it maybe best to setup the wiki content in a separate repo so we can allow edit/commit rights on that without changing permissions for main FCC repo, then you can allow other editors to check out the files locally and edit, not just via the browser UI.
there are other ways to fork wikis
https://gist.github.com/larrybotha/10650410
add an image and a bit more info
allows users to type in [keywords] like this to have an auto glossary come out
scan the user input for words surrounded by [ ]
lookup in the KBase a response
emit back just the first line of that entry
and use an indent >
before the bot reply to make it indented
user:
You should read up on [undefined] some more.
bot:
> **undefined** A primitive value automatically assigned to variables that have just been declared or to formal arguments for which there are no actual arguments. [more info](https://github.com/freecodecamp/freecodecamp/wiki/undefined)
this will show up like
@QuincyLarson can you have someone edit the cheatsheet material for the bot?
eg this
http://ricostacruz.com/cheatsheets/react.html
is available in .md source here:
https://github.com/rstacruz/cheatsheets/issues
and many more
https://github.com/rstacruz/cheatsheets
to use common code to show about the user
Topic Specific Help chats
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.