Skip to content
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

SendGroupTextMessage is not usable #26

Open
akasandra opened this issue Feb 25, 2019 · 3 comments
Open

SendGroupTextMessage is not usable #26

akasandra opened this issue Feb 25, 2019 · 3 comments

Comments

@akasandra
Copy link

You can't send group text message with current version because this code will never satisfy ok == true:

case o3.GroupTextMessage:
  fmt.Printf("GroupTextMessage: ~%s [%s] for Group [%x] created by [%s]\n", msg.PubNick(), msg.Sender(), msg.GroupID(), msg.GroupCreator())
  fmt.Printf("GroupTextMessage: Text: %s\n", msg.Text())

  group, ok := bot.sc.ID.Groups[msg.GroupCreator()][msg.GroupID()]
  if ok {
  	time.Sleep(500 * time.Millisecond)
  	// respond with a quote of what was send to us. Multiline quote possible.
  	qoute := fmt.Sprintf("> %s: %s\n%s", msg.Sender(), strings.Replace(msg.Text(), "\n", "\n> ", -1), "Exactly in group!")
  	bot.sc.SendGroupTextMessage(group, qoute, bot.sendMsgChan)
  } else {
  	fmt.Printf("ERROR sending to group [%x] by [%s].\n", msg.GroupID(), msg.GroupCreator())
  }

The prototype of this code comes from https://github.com/V-inz/o3demo/blob/testing/main.go#L263 (does not work now)

Searching shows there was also another approach used to find group for this https://github.com/r3ek0/cr3ma/blob/master/main.go (does not work now)

Constructing Group object with o3.Group{GroupID: msg.GroupID(),CreatorID: msg.GroupCreatorID()} does not work - no error is returned, but the message not is not sent/delivered

@akasandra
Copy link
Author

Was there ever support for send message to group?
Why if i search "Groups" in the source i can only find three lines of code, a map which is never initialized but used in demo code?

@cryptix
Copy link
Member

cryptix commented Feb 28, 2019

Sorry, I’m not sure about the state of the groups feature set. You might have stumbled into something unfinished.

@cryptix
Copy link
Member

cryptix commented Mar 1, 2019

I didn’t make it but will let them know about this issue. Might take them a while to get back to you since they are working on other stuff currently and this is unpaid open source after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants