Go 1.11 has reached end of support
and will bedeprecatedon January 31, 2026. After deprecation, you won't be able to deploy Go 1.11
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Go
1.11 applications will continue to run and receive traffic after theirdeprecation date. We
recommend that youmigrate to the latest supported version of Go.
GetPresence retrieves a user's presence.
If the from address is an empty string the default
(yourapp@appspot.com/bot) will be used.
Possible return values are "", "away", "dnd", "chat", "xa".
ErrPresenceUnavailable is returned if the presence is unavailable.
GetPresenceMulti retrieves multiple users' presence.
If the from address is an empty string the default
(yourapp@appspot.com/bot) will be used.
Possible return values are "", "away", "dnd", "chat", "xa".
If any presence is unavailable, an appengine.MultiError is returned
Invite sends an invitation. If the from address is an empty string
the default (yourapp@appspot.com/bot) will be used.
Message
typeMessagestruct{// Sender is the JID of the sender.// Optional for outgoing messages.Senderstring// To is the intended recipients of the message.// Incoming messages will have exactly one element.To[]string// Body is the body of the message.Bodystring// Type is the message type, per RFC 3921.// It defaults to "chat".Typestring// RawXML is whether the body contains raw XML.RawXMLbool}
Send sends a message.
If any failures occur with specific recipients, the error will be an appengine.MultiError.
Presence
typePresencestruct{// Sender is the JID (optional).Senderstring// The intended recipient of the presence update.Tostring// Type, per RFC 3921 (optional). Defaults to "available".Typestring// State of presence (optional).// Valid values: "away", "chat", "xa", "dnd" (RFC 3921).Statestring// Free text status message (optional).Statusstring}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe xmpp package enables sending and receiving instant messages to and from users on XMPP-compatible services.\u003c/p\u003e\n"],["\u003cp\u003eMessages can be sent using the \u003ccode\u003exmpp.Message\u003c/code\u003e type, specifying recipients and the message body, and then sending it with the \u003ccode\u003eSend\u003c/code\u003e function.\u003c/p\u003e\n"],["\u003cp\u003eIncoming messages are handled by registering a handler function with \u003ccode\u003exmpp.Handle\u003c/code\u003e, which will be called when new messages are received.\u003c/p\u003e\n"],["\u003cp\u003eThe package provides functions like \u003ccode\u003eGetPresence\u003c/code\u003e and \u003ccode\u003eGetPresenceMulti\u003c/code\u003e to retrieve user presence information, and \u003ccode\u003eInvite\u003c/code\u003e to send invitations.\u003c/p\u003e\n"],["\u003cp\u003ePresence updates can be sent using the \u003ccode\u003exmpp.Presence\u003c/code\u003e type, which allows specifying the sender, recipient, presence type, and state.\u003c/p\u003e\n"]]],[],null,["# Package google.golang.org/appengine/xmpp (v1.6.7)\n\nVersion 1.6.7keyboard_arrow_down\n\n- [1.6.8 (latest)](/appengine/docs/legacy/standard/go111/reference/latest/xmpp)\n- [1.6.7](/appengine/docs/legacy/standard/go111/reference/1.6.7/xmpp) \n**Note:** To get more information about this package, such as access to older versions, view [this package on pkg.go.dev](https://pkg.go.dev/google.golang.org/appengine/xmpp). \n\u003cbr /\u003e\n\nPackage xmpp provides the means to send and receive instant messages\nto and from users of XMPP-compatible services.\n\nTo send a message, \n\n```maple\nm := &xmpp.Message{\n To: []string{\"kaylee@example.com\"},\n Body: `Hi! How's the carrot?`,\n}\nerr := m.Send(c)\n```\n\n\u003cbr /\u003e\n\nTo receive messages, \n\n```gdscript\nfunc init() {\n xmpp.Handle(handleChat)\n}\n\nfunc handleChat(c context.Context, m *xmpp.Message) {\n // ...\n}\n``` \n\nVariables\n---------\n\n### ErrPresenceUnavailable, ErrInvalidJID\n\n var (\n \tErrPresenceUnavailable = https://pkg.go.dev/errors.https://pkg.go.dev/errors#New(\"xmpp: presence unavailable\")\n \tErrInvalidJID = https://pkg.go.dev/errors.https://pkg.go.dev/errors#New(\"xmpp: invalid JID\")\n )\n\nFunctions\n---------\n\n### func GetPresence\n\n func GetPresence(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context, to https://pkg.go.dev/builtin#string, from https://pkg.go.dev/builtin#string) (https://pkg.go.dev/builtin#string, https://pkg.go.dev/builtin#error)\n\nGetPresence retrieves a user's presence.\nIf the from address is an empty string the default\n(yourapp@appspot.com/bot) will be used.\nPossible return values are \"\", \"away\", \"dnd\", \"chat\", \"xa\".\nErrPresenceUnavailable is returned if the presence is unavailable. \n\n### func GetPresenceMulti\n\n func GetPresenceMulti(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context, to []https://pkg.go.dev/builtin#string, from https://pkg.go.dev/builtin#string) ([]https://pkg.go.dev/builtin#string, https://pkg.go.dev/builtin#error)\n\nGetPresenceMulti retrieves multiple users' presence.\nIf the from address is an empty string the default\n(yourapp@appspot.com/bot) will be used.\nPossible return values are \"\", \"away\", \"dnd\", \"chat\", \"xa\".\nIf any presence is unavailable, an appengine.MultiError is returned \n\n### func Handle\n\n func Handle(f func(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context, m *#google_golang_org_appengine_xmpp_Message))\n\nHandle arranges for f to be called for incoming XMPP messages.\nOnly messages of type \"chat\" or \"normal\" will be handled. \n\n### func Invite\n\n func Invite(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context, to, from https://pkg.go.dev/builtin#string) https://pkg.go.dev/builtin#error\n\nInvite sends an invitation. If the from address is an empty string\nthe default (yourapp@appspot.com/bot) will be used. \n\nMessage\n-------\n\n type Message struct {\n \t// Sender is the JID of the sender.\n \t// Optional for outgoing messages.\n \tSender https://pkg.go.dev/builtin#string\n\n \t// To is the intended recipients of the message.\n \t// Incoming messages will have exactly one element.\n \tTo []https://pkg.go.dev/builtin#string\n\n \t// Body is the body of the message.\n \tBody https://pkg.go.dev/builtin#string\n\n \t// Type is the message type, per RFC 3921.\n \t// It defaults to \"chat\".\n \tType https://pkg.go.dev/builtin#string\n\n \t// RawXML is whether the body contains raw XML.\n \tRawXML https://pkg.go.dev/builtin#bool\n }\n\nMessage represents an incoming chat message. \n\n### func (\\*Message) Send\n\n func (m *#google_golang_org_appengine_xmpp_Message) Send(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context) https://pkg.go.dev/builtin#error\n\nSend sends a message.\nIf any failures occur with specific recipients, the error will be an appengine.MultiError. \n\nPresence\n--------\n\n type Presence struct {\n \t// Sender is the JID (optional).\n \tSender https://pkg.go.dev/builtin#string\n\n \t// The intended recipient of the presence update.\n \tTo https://pkg.go.dev/builtin#string\n\n \t// Type, per RFC 3921 (optional). Defaults to \"available\".\n \tType https://pkg.go.dev/builtin#string\n\n \t// State of presence (optional).\n \t// Valid values: \"away\", \"chat\", \"xa\", \"dnd\" (RFC 3921).\n \tState https://pkg.go.dev/builtin#string\n\n \t// Free text status message (optional).\n \tStatus https://pkg.go.dev/builtin#string\n }\n\nPresence represents an outgoing presence update. \n\n### func (\\*Presence) Send\n\n func (p *#google_golang_org_appengine_xmpp_Presence) Send(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context) https://pkg.go.dev/builtin#error\n\nSend sends a presence update."]]