Giter Site home page Giter Site logo

Comments (5)

demurgos avatar demurgos commented on May 27, 2024

You can send messages to group chats just as you send messages to simple contacts.
Instead of using the contact id, use the group chat id (a string starting with 19:).

You can get events from group chats and respond to them but the API to list the group chats you are participating in is missing at the moment.

const onMessage = (resource: resources.TextResource): void => {
  const conversationId: string = resource.conversation;
  // This is the id of the simple contact or group chat
  console.log(conversationId);
  // There was a recent update to help to handle resources by id:
  // import * as mri from "skype-http/mri"
  // if (mri.parse(conversationId).type === mri.MriType.GroupConversation) {
  //  console.log("This is a group conversation");
  // }
  api.sendMessage({textContent: "Hello, World!"}, conversationId).catch(console.error);
};

api.on("Text", onMessage);
api.on("RichText", onMessage);

from skype-http.

demurgos avatar demurgos commented on May 27, 2024

I haven't looked into it but if you find the API endpoint to list the currently existing group chats, it would be a nice addition.

from skype-http.

demurgos avatar demurgos commented on May 27, 2024
https://client-s.gateway.messenger.live.com/v1/users/ME/conversations?startTime=1514877701928&pageSize=100&view=msnp24Equivalent&targetType=Passport|Skype|Lync|Thread|PSTN

The method above lists the available conversations: PMs and group chats. I'll try to add support for this as soon as possible.
You can then use sendMessage with the id of the conversation to send messages to group chats.

from skype-http.

demurgos avatar demurgos commented on May 27, 2024

Huh, well. It turns out that the method to get the conversations already exists 😄 :

async getConversations(): Promise<Conversation[]> {

Still, I'll update the types to match the contacts API.

from skype-http.

demurgos avatar demurgos commented on May 27, 2024

Updating the conversation types also requires me to update the message types. It will improve the health of the lib a lot but requires more time.
I started work on my repo. I'll probably finish it next week.

from skype-http.

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.