𝗗𝗔π—₯π—₯π—˜π—Ÿπ—Ÿ π— π—¨π—–π—›π—˜π—₯π—œ ⚑ commited on
Commit
19a8a18
Β·
unverified Β·
1 Parent(s): 808d555

Create fun-randomwall.js

Browse files
Files changed (1) hide show
  1. plugins/fun-randomwall.js +52 -0
plugins/fun-randomwall.js ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const {
2
+ cmd,
3
+ commands
4
+ } = require("../command");
5
+ const {
6
+ getBuffer,
7
+ getGroupAdmins,
8
+ getRandom,
9
+ h2k,
10
+ isUrl,
11
+ Json,
12
+ runtime,
13
+ sleep,
14
+ fetchJson
15
+ } = require("../lib/functions");
16
+ const axios = require("axios");
17
+ cmd({
18
+ 'pattern': 'rw',
19
+ 'alias': ["randomwall", "wallpaper"],
20
+ 'react': '🌌',
21
+ 'desc': "Download random wallpapers based on keywords.",
22
+ 'category': 'wallpapers',
23
+ 'use': ".rw <keyword>",
24
+ 'filename': __filename
25
+ }, async (_0x4e03bc, _0x345d21, _0x40a30e, {
26
+ from: _0x12db73,
27
+ args: _0x22efc8,
28
+ reply: _0x2f266c
29
+ }) => {
30
+ try {
31
+ const _0x2d400f = _0x22efc8.join(" ") || "random";
32
+ const _0x3ba124 = "https://pikabotzapi.vercel.app/random/randomwall/?apikey=anya-md&query=" + _0x2d400f;
33
+ const _0x235f6c = await axios.get(_0x3ba124);
34
+ if (_0x235f6c.data.status) {
35
+ const _0x3a965b = _0x235f6c.data.imgUrl;
36
+ const _0x122bb7 = "🌌 Random Wallpaper: *" + _0x2d400f + "*\n\n> *© Generated by SubZero*";
37
+ await _0x4e03bc.sendMessage(_0x12db73, {
38
+ 'image': {
39
+ 'url': _0x3a965b
40
+ },
41
+ 'caption': _0x122bb7
42
+ }, {
43
+ 'quoted': _0x345d21
44
+ });
45
+ } else {
46
+ _0x2f266c("❌ Failed to fetch wallpaper for \"" + _0x2d400f + "\".");
47
+ }
48
+ } catch (_0x56a8ca) {
49
+ console.error(_0x56a8ca);
50
+ _0x2f266c("❌ An error occurred while fetching the wallpaper.");
51
+ }
52
+ });