Skip to content

SendGroupTextMessage is not usable #26

@akasandra

Description

@akasandra

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions