gobridge / gopher Goto Github PK
View Code? Open in Web Editor NEWSlack bot for Gophers slack https://invite.slack.golangbridge.org
License: Apache License 2.0
Slack bot for Gophers slack https://invite.slack.golangbridge.org
License: Apache License 2.0
When a user posts a text message with a snippet of code, the code in the playground website includes also the text message ( i guess it should include only the snippet of code ).
Here an example:
For debugging purposes
If someone posts a link to golang playground, we should comment with the body of the message for easy access for everyone, even though everyone can run it in browser, maybe this can be done if it's less than N lines or something, and it can be collapsed by default if it's longer, or maybe don't do at all if it's long?
The check if a message is sent directly to the bot isn't working currently.
Channel ID for Gopher is hard coded, but differs for each users direct message.
Currently gopher posts the whole message which lead to playground entries much like this one https://play.golang.org/p/GzGXTenSHSJ.
Which doesn't help anybody
The #golang-newbies channel posted this recently:
@gopher books
❓
@gopher books
Gopher App - {list of recommended books}
Proposed initial Books list:
bot.go:247
Add proposed books list to the botEventTextToResponse map under the books key in the same format as recommended blogs is formatted
I'd be more than happy to submit this as a cr with the above implementation
Add a simple command to define a word. There should be an API gopher can hit somewhere or an easy link it can return. Will update if I find something for either.
I was using the keyword buffalo
and a automatic reaction was being added. This got crazy annoying. I don't see the value this adds at all.
I referenced this a lot as I learned go. Should we add it to @gopher newbie resources
? Some key idioms it mentions include avoiding stuttering package/type, capitalize initialisms, early return from the error case code branch
https://github.com/golang/go/wiki/CodeReviewComments
Issue to track the idea so it's not lost. Haven't noodled too far on it. Standard library only, or also https://godoc.org cached packages? ¯_(ツ)_/¯
The idea is to enable the ability to select a section of messages to be archived. As it stands right now much of the knowledge shared and discovered in the slack is very easy to lose. It would be useful to the community to be able to take a chain of messages, archive them off 'somewhere', and then have them be searchable by topic.
Some ideas that have been discussed would be to link to two messages and have gopher take and archive all messages between the two. Another idea that was proposed would be to implement archival of message threads, though there are some problems like file attachments and moderation that make this a challenging solution.
I frequently find myself pasting example links from github to demonstrate something I've written or point out something in #reviews. Less frequently I find myself editing my slack posts to replace https://github.com/therealplato/shortlink/blob/master/config.go#L10
with https://github.com/therealplato/shortlink/blob/b4821cb7375cc6afaae61ebd6515c71a5fd32635/config.go#L10
.
The latter link is preferable if future searchers are trying to understand the point of discussion, as the former link will probably point to different code soon. Gopher could help me catch any links I forget to permalink myself.
Something like:
var GithubCode = regexp.MustCompile(`https://github.com/[^/]/[^/]/blob/master/[^ ]*#L[L0-9\-]+`)
var HasPermalink = regexp.MustCompile(`blob/[0-9a-f]{32}`)
...
if GithubCode.MatchString(msg) {
link := GithubCode.FindString(msg)
if !IsPermalink.MatchString(msg) {
// permalink := acquirePermalink(msg)
bot.ReplyDM(msg, "I saw you linked %s, which looks like it's pointing to specific code on a branch or tag. It's not unusual for those refs to eventually point to different code, so this link might not be useful to gophers who read this later. If you'd like the link to work in the future, press `y` on that page and edit the new link.", link)
}
Preemptively yes, regex are relatively difficult to read and debug, I find them great for rapid prototyping though :)
Do you think the more usable search history is worth the annoyance costs of getting DM's from gopher?
if I send a message containing code, it creates a go playground link, but imaging if I sent only this in a message:
package main
import (
"encoding/json"
"log"
"os"
)
func getCodes(filename string) []SomeName {
zcodes := make([]SomeName, 0)
file, err := os.Open(filename)
if err != nil {
log.Fatal(err)
}
err = json.NewDecoder(file).Decode(&zcodes)
if err != nil {
log.Fatal(err)
}
return zcodes
}
func main() {
getCodes("a-name.out")
}
it creates link like: https://play.golang.org/p/ItueVksYOs9
Notice, there's still ``` in the source code, this needs to be improved, and only the code should be present inside the editor 🙂
@theckman asked around and found that threads are a challenging UX for screen reader users.
Gopher could respond in threads, something like:
Hi, I noticed you posted a thread. Vision impaired gophers are likely to miss the content because it's difficult to navigate threads with screen readers. Please post in <channel> if this conversation is relevant to other gophers.
xkcd:ballmer
xkcd:ballmerpeak
xkcd:ballmer peak
should all alias to
xkcd:323
Title says it all
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.