Comments (4)
Could you clarify the problem you are facing?
In one of the examples available, you can see one with a call directly to nlopes/slack's RTM.
package main
import (
"log"
"github.com/nlopes/slack"
"github.com/shomali11/slacker"
)
func main() {
bot := slacker.NewClient("<YOUR SLACK BOT TOKEN>")
bot.Command("upload <word>", "Upload a word!", func(request *slacker.Request, response slacker.ResponseWriter) {
word := request.Param("word")
channel := request.Event.Channel
bot.RTM.SendMessage(bot.RTM.NewOutgoingMessage("Uploading file ...", channel))
bot.Client.UploadFile(slack.FileUploadParameters{Content: word, Channels: []string{channel}})
})
err := bot.Listen()
if err != nil {
log.Fatal(err)
}
}
from slacker.
Yes sure, slack.MsgOptionAttachments
coupled with SendMessageContext
isn't possible at the moment because it tries to compare your vendored nlopes/slack with the one I'm using.
for{
attachment := slack.Attachment{
Pretext: "Humans don't have memory",
Title: watcher.Server,
Text: "hello world",
Color: color,
}
attachments = append(attachments, attachment)
}
bot.Client.SendMessageContext(context.Background(), request.Event.Channel, slack.MsgOptionAttachments(attachments...))
from slacker.
Could you put together a PR that solves this issue? I would gladly review it
from slacker.
This was solved by #23 / e68b061
from slacker.
Related Issues (20)
- How to retrieve raw payload / get the team_id? HOT 1
- How can get channel name from MessageEvent? HOT 1
- Create releases for Slacker HOT 2
- Allow ability to define a Default Inner Event Handler HOT 5
- Retrieve Trigger ID from Slash Commands HOT 3
- panic: runtime error when adding DispatchActionConfig.TriggerActionsOn NewPlainTextInputBlockElement HOT 2
- How do you handle slash commands HOT 3
- Interactive callback no longer works in version 1.4.0 HOT 4
- Please don't break your API for an aesthetic change without going to v2... HOT 2
- Improve adherence to commit message format
- Define release process
- Remove fmt.Print usage HOT 1
- Regression of issue #84, cannot use library to read/respond to message events from other bots HOT 2
- Multiline command not working HOT 2
- V2: WithLogger not used when Debug mode set using WithDebug HOT 3
- Provide ability to use a slog logger HOT 1
- [Example] Request an example to OpenView Modal (Pop Up Window) using Slacker in Interactive Socket Mode HOT 2
- How to bind a command to all messages? HOT 5
- Provide ability to handle block_suggestion events appropriatly HOT 2
- BotModeIgnoreApp fails to handle the official SlackBot HOT 1
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 slacker.