
inside that if conditional!

What you mean by query
Inside that If you already gonna have the new message document object

Thank you so much!

So, @Binyamin Do I need to create a team for every Group creation in my application! right?

Yes, that would be a quick and efficient way to gather room users and will make the document real-time fetching worry free

[SOLVED] How can I write a query in the realtime?

The only issue currently which makes teams not a friendly option is you cannot just add a user to a team. Any team additions are based on email/phone invites

Ohh is it?

Even using server side functions you cannot add users to a team

You can with server side sdk https://appwrite.io/docs/server/teams?sdk=nodejs-default#teamsCreateMembership
If initiated from a Server SDK, the new member will be added automatically to the team.

Then A typical who wants to join a chatting group like this discord, How can i implement this?

Why not? I've done that inside a function.

Interesting, what do you pass for URL if the user is already registered ?

This is part my function code.
async function addUserToTeam(teamID,email) {
client
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject(projectID)
.setKey(apiKey)
.setSelfSigned(true);
try {
const r = await teams.createMembership(teamID, email, [], '');
} catch (e) {
//
}
}

It works both ways

Sweet, glad in jumped into this thread. Now I need to update a bunch of logic in my app 🙂 .. Thanks @Binyamin

<:appwritefire:823999000330895380>

Are you building chat application too?

Are you participating in appwrite's hackathon too?

Hopefully if I'll be able to delivery till the deadline.

Amazing!

what are you building by the way? @Binyamin

I had few ideas, maybe a URL shortener

Hey Binyamin, tried adding member to a team via server SDK and blank URL and get the error Invalid URL :/

You can put your Appwrite endpoint.
In the future, it's best to create a separate post rather than reusing someone else's thread, especially for something unrelated to the original post
Recommended threads
- I am facing this error: type 'Null' is ...
When attempting to fetch areas from the area collection, the application throws an error: "type 'Null' is not a subtype of type 'int.'" This issue originates in...
- Adding custom domain to Appwrite project
My app is hosted on Vercel on domain todo.velleb.com. On PC, the OAuth logins like GitHub, Discord and Google work and create the account and log in. On mobile ...
- Received duplicate events
I used the React Native SDK to subscribe to `buckets.<ID>.files` on the client side. When the backend creates a file, two events are logged in my client's conso...
