User Tools

Site Tools


projects:owncastmatrix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
projects:owncastmatrix [2021/04/07 21:00]
admin
projects:owncastmatrix [2021/04/07 21:06]
admin
Line 55: Line 55:
  
 $room_id = "​!room_id:​homeserver";​ $room_id = "​!room_id:​homeserver";​
 +$sender_name = "​@botname:​homeserver.com";​ // IMPORTANT: use this to stop the script looping and repeating what the bot is saying on each chat/room
  
 while(true) { while(true) {
Line 61: Line 62:
 if(is_array($data['​chunk'​]) and sizeof($data['​chunk'​])>​0) { if(is_array($data['​chunk'​]) and sizeof($data['​chunk'​])>​0) {
    ​foreach($data['​chunk'​] as $message) {    ​foreach($data['​chunk'​] as $message) {
-      if($message['​sender'​] != '​@adelaide:​glasgow.social'​) {+      if($message['​sender'​] != $sender_name) {
          ​if($message['​content'​]['​msgtype'​] == "​m.text"​) {          ​if($message['​content'​]['​msgtype'​] == "​m.text"​) {
             if(!empty($message['​content'​]['​body'​])) {             if(!empty($message['​content'​]['​body'​])) {
projects/owncastmatrix.txt ยท Last modified: 2021/04/07 21:18 by admin