Difference between revisions of "Bot Playground/Events/group notice"

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:...}} <onlyinclude>Fires when bot receives a group notice.</onlyinclude> <syntaxhighlight lang="javascript"> Bot.on("group_notice", function(event) { ... }); <...")
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:...}}
+
{{DISPLAYTITLE:group_notice}}
 
<onlyinclude>Fires when bot receives a group notice.</onlyinclude>
 
<onlyinclude>Fires when bot receives a group notice.</onlyinclude>
  
Line 10: Line 10:
 
{{API Variable|name}}The name of the event in this case group_notice
 
{{API Variable|name}}The name of the event in this case group_notice
 
{{API Variable|group_name}}The name of the group
 
{{API Variable|group_name}}The name of the group
{{API Variable|group_uuid}}The UUUID of the group
+
{{API Variable|group_uuid}}The UUID of the group
 
{{API Variable|speaker_name}}The name of the sender
 
{{API Variable|speaker_name}}The name of the sender
 
{{API Variable|speaker_uuid}}The UUID of the sender
 
{{API Variable|speaker_uuid}}The UUID of the sender
 
{{API Variable|subject}}The subject of the notice
 
{{API Variable|subject}}The subject of the notice
 
{{API Variable|message}}The message of the notice
 
{{API Variable|message}}The message of the notice
{{API Variable|attachment}}The attachment type of the notice
+
{{API Variable|attachment}}The attachment type of the notice:
{{API Variable|bot_slname}}The name of the bot receiving the notice
+
* Object
 
+
* Notecard
 
+
* Landmark
 +
* Texture
  
 
{{API Variables Table End}}
 
{{API Variables Table End}}
Line 26: Line 27:
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
 
Bot.on("group_notice", function(event) {
 
Bot.on("group_notice", function(event) {
   console.log(event.group_name + ": " + event.speaker_name +" sent notice: \n message: " + event.message + "\n subject" + event.subject);
+
   console.log(event.group_name + ": " + event.speaker_name +" sent notice: \n message: " + event.message + "\n subject: " + event.subject);
 
});
 
});
  

Latest revision as of 16:30, 6 October 2022

Fires when bot receives a group notice.

Bot.on("group_notice", function(event) { ... });

Reference

This event comes with the following event object:

Variable Required Description
event object properties:
name The name of the event in this case group_notice
group_name The name of the group
group_uuid The UUID of the group
speaker_name The name of the sender
speaker_uuid The UUID of the sender
subject The subject of the notice
message The message of the notice
attachment The attachment type of the notice:
  • Object
  • Notecard
  • Landmark
  • Texture

Example

Bot.on("group_notice", function(event) {
  console.log(event.group_name + ": " + event.speaker_name +" sent notice: \n message: " + event.message + "\n subject: " + event.subject);
});

console.log("Bot is listening, to group notice.");