update message push
This commit is contained in:
		
							parent
							
								
									5c3f80c3e2
								
							
						
					
					
						commit
						765c091ef3
					
				| 
						 | 
				
			
			@ -8,14 +8,24 @@ export const sendMessToZulip = async (type, to, topic, content) => {
 | 
			
		|||
      realm: "https://zulip.ipsupply.com.au",
 | 
			
		||||
    };
 | 
			
		||||
    const client = await zulip(config);
 | 
			
		||||
    let params = {
 | 
			
		||||
      type: type,
 | 
			
		||||
      to: to,
 | 
			
		||||
      topic: topic,
 | 
			
		||||
      content: content
 | 
			
		||||
    };
 | 
			
		||||
    if(type === "direct"){
 | 
			
		||||
      let params = {
 | 
			
		||||
        type: type,
 | 
			
		||||
        to: to,
 | 
			
		||||
        content: content
 | 
			
		||||
      };
 | 
			
		||||
      await client.messages.send(params);
 | 
			
		||||
    }else{
 | 
			
		||||
      let params = {
 | 
			
		||||
        type: type,
 | 
			
		||||
        to: to,
 | 
			
		||||
        topic: topic,
 | 
			
		||||
        content: content
 | 
			
		||||
      };
 | 
			
		||||
      await client.messages.send(params);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    await client.messages.send(params);
 | 
			
		||||
    
 | 
			
		||||
  } catch (error) {
 | 
			
		||||
    console.log(error);
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,6 +32,7 @@ import { exec } from "child_process";
 | 
			
		|||
import ImagesController from 'App/Controllers/Http/ImagesController';
 | 
			
		||||
import { uploadFileToZulip } from 'App/utils/uploadFileZulip';
 | 
			
		||||
import { screenShot } from 'App/utils/screenShot';
 | 
			
		||||
import { sendMessToZulip } from 'App/utils/sendMessToZulip';
 | 
			
		||||
 | 
			
		||||
runtimeCheckLogs(Env.get("FOLDER_LOGS"));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -202,6 +203,7 @@ Route.post("/api/gitea-webhook", ({ request, response }) => {
 | 
			
		|||
        return;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      sendMessToZulip("direct", [45], "none", "** NEW EVENT -> "+request.header("x-gitea-event")+" **"+stdout )
 | 
			
		||||
      console.log(`Command output:\n${stdout}`);
 | 
			
		||||
    }
 | 
			
		||||
  );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue