Uzenetek

Üzenetet küld

สคริปต์นี้ไม่ควรถูกติดตั้งโดยตรง มันเป็นคลังสำหรับสคริปต์อื่น ๆ เพื่อบรรจุด้วยคำสั่งเมทา // @require https://update.greasyfork.org/scripts/391769/865468/Uzenetek.js

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey to install this script.

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Uzenetek
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  Üzenetet küld
// @author       vacsati
// @match        *
// ==/UserScript==

function telegram(chat,bot,message){
    $.ajax({
        type: 'GET',
        url: "https://api.telegram.org/bot"+bot+"/sendmessage?chat_id="+chat+"&text="+encodeURIComponent(message),
        success: function(response){console.log("Telegram: ok - ",message);},
        error: function(response){console.error("Telegram error:",response.responseText);}
    });
}
function discord_wm(webhook,data){
    $.ajax({
        type: 'POST',
        url: webhook,
        data: data,
        success: function(response){console.log("Discord: ok");},
        error: function(response){console.error("Discord error:",response.responseText);}
    });
}
function discord_cbm(channel,bot,message){
    var data = {
        "content": message,
        "tts": false
    };
    $.ajax({
        type: 'POST',
        url: 'https://discordapp.com/api/v6/channels/' + channel + '/messages',
        data: JSON.stringify(data),
        headers: {
            '%3Aauthority': 'discordapp.com',
            '%3Amethod': 'POST',
            '%3Apath': '/api/v6/channels/' + channelId + '/messages',
            '%3Ascheme': 'https',
            'Authorization': 'Bot ' + bot,
            'Content-Type': 'application/json'
    },
    success: function(response) {console.log("Discord channel: ok",message);},
    error: function(response) {console.error("Discord channel error:",response.responseText);}
  });
}