Code Monkey home page Code Monkey logo

Comments (4)

shomali11 avatar shomali11 commented on May 26, 2024

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.

neonima avatar neonima commented on May 26, 2024

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.

shomali11 avatar shomali11 commented on May 26, 2024

Could you put together a PR that solves this issue? I would gladly review it

from slacker.

jvrplmlmn avatar jvrplmlmn commented on May 26, 2024

This was solved by #23 / e68b061

from slacker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.