Uzenetek

Üzenetet küld

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @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.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==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);}
  });
}