forked from Maduradilshan/Dilshann-MD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Telegraph.js
78 lines (67 loc) · 4.85 KB
/
Telegraph.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
//══════════════════════════════════════════════════════════════════════════════════════════════════════//
WHATSAPP BOT-MD BETA
V:1.0.1
██╗ ██╗ █████╗ ██╗██╗██████╗ █████╗ ███╗ ███╗██████╗
██║ ██║██╔══██╗ ██║██║██╔══██╗██╔══██╗ ████╗ ████║██╔══██╗
██║ ██║███████║ ██║██║██████╔╝███████║ █████╗██╔████╔██║██║ ██║
╚██╗ ██╔╝██╔══██║██ ██║██║██╔══██╗██╔══██║ ╚════╝██║╚██╔╝██║██║ ██║
╚████╔╝ ██║ ██║╚█████╔╝██║██║ ██║██║ ██║ ██║ ╚═╝ ██║██████╔╝
╚═══╝ ╚═╝ ╚═╝ ╚════╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═════╝
//══════════════════════════════════════════════════════════════════════════════════════════════════════//
CURRENTLY RUNNING ON BETA VERSION!!
*
* @project_name : Vajira-Md
* @author : Vajira Tech Info
* @youtube : https://youtube.com/@gamingewingyt6216
* @description : Vajira-Md ,A Multi-functional whatsapp user bot.
* @version 1.2.2
*
* Licensed under the GPL-3.0 License;
*
* ┌┤Created By Vajira Tech Info.
* © 2023 Vajira-Md ✭ ⛥.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
**/
//---------------------------------------------------------------------------
const { smd } = require('../lib');
const util = require('util');
const axios = require('axios');
const PastebinAPI = require("pastebin-js");
pastebin = new PastebinAPI("EMWTMkQAVfJa9kM-MRUrxd5Oku1U7pgL");
smd({
pattern: "pastebin",
desc: "To check ping",
category: "converter",
react: "✅",
filename: __filename,
},
async(Suhail, msg,text) => {
if (!text) { text=msg.quoted.text;}
if(!text) return msg.send('Please reply to any text to get link.');
let data = await pastebin.createPaste(text, "Vajira Tech Info");
return msg.send('_Here is your link._\n'+data+'\n*Click to Get Your Text*');
}
);
//----------------------------------------------- ---------------------------
smd({
pattern: "paste",
desc: "create paste of text.",
category: "converter",
react: "✅",
filename: __filename,
},
async(Suhail, msg,text) => {
let a = msg.quoted ? msg.quoted.text : msg.text;
try{
let { data } = await axios.get(`https://api.telegra.ph/createPage?access_token=d3b25feccb89e508a9114afb82aa421fe2a9712b963b387cc5ad71e58722&title=Vajira-Md+Bot&author_name=VajiraTechInfo&content=[%7B"tag":"p","children":["${a.replace(/ /g,'+')}"]%7D]&return_content=true`);
return msg.reply(`*Paste created on telegraph*\nName:-${util.format(data.result.title)} \nUrl:- ${util.format(data.result.url)}`)
}catch(e){return await msg.error(e)}
});