How to use kill method in Playwright Internal

Best JavaScript code snippet using playwright-internal

Run Playwright Internal automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

test_kill.py

Source: test_kill.py Github

copy
1#!/usr/bin/env python3
2'''Kill tests.
3
4These tests run many scenarios in which jobs are killed (KILL_JOB).
5'''
6import json
7import pandas as pd
8import pytest
9from helper import *
10
11# The number of kills to do for each job.
12KillCountMode = namedtuple('KillCountMode', ['name', 'kill_count_per_job'])
13
14# The number of seconds between a job execution and its kill.
15KillDelayMode = namedtuple('KillDelayMode', ['name', 'kill_delay'])
16
17###################################################################
18# Kill a job a given amount of time after starting its execution. #
19###################################################################
20
21def kill_after_delay(platform, workload, algorithm, redis_mode, nb_kills_per_job, delay_before_kill):
22    test_name = f'kill-{delay_before_kill.name}-{nb_kills_per_job.name}-{algorithm.name}-{platform.name}-{workload.name}-{redis_mode.name}'
23    output_dir, robin_filename, schedconf_filename = init_instance(test_name)
24
25    if algorithm.sched_implem != 'batsched': raise Exception('This test only supports batsched for now')
26
27    batparams = "--forward-profiles-on-submission"
28    if redis_mode.enabled == True: batparams = batparams + " --enable-redis"
29    batcmd = gen_batsim_cmd(platform.filename, workload.filename, output_dir, batparams)
30
31    schedconf_content = {
32        "delay_before_kill": delay_before_kill.kill_delay,
33        "nb_kills_per_job": nb_kills_per_job.kill_count_per_job,
34    }
35    write_file(schedconf_filename, json.dumps(schedconf_content))
36
37    instance = RobinInstance(output_dir=output_dir,
38        batcmd=batcmd,
39        schedcmd=f"batsched -v '{algorithm.sched_algo_name}' --variant_options_filepath '{schedconf_filename}'",
40        simulation_timeout=30, ready_timeout=5,
41        success_timeout=10, failure_timeout=0
42    )
43
44    instance.to_file(robin_filename)
45    ret = run_robin(robin_filename)
46    if ret.returncode != 0: raise Exception(f'Bad robin return code ({ret.returncode})')
47
48    # Analyze Batsim results
49    batjobs_filename = f'{output_dir}/batres_jobs.csv'
50    jobs = pd.read_csv(batjobs_filename)
51
52    epsilon = 0.1
53    max_runtime = delay_before_kill.kill_delay + epsilon
54
55    jobs_too_long = jobs.loc[jobs['execution_time'] > max_runtime]
56
57    if jobs_too_long.empty:
58        print(f'All jobs have been shorter than {max_runtime} s')
59    else:
60        print(f'Some jobs were longer than {max_runtime} s')
61        print(jobs_too_long)
62        raise Exception('Some were longer than f{max_runtime} s')
63
64@pytest.mark.parametrize("nb_kills_per_job", [KillCountMode(f'{n}kills', n) for n in [1,2]])
65@pytest.mark.parametrize("delay_before_kill", [KillDelayMode(f'after{n}', n) for n in [5,10,15]])
66def test_kill_after_delay(small_platform, small_workload, killer_algorithm, redis_mode, nb_kills_per_job, delay_before_kill):
67    kill_after_delay(small_platform, small_workload, killer_algorithm, redis_mode, nb_kills_per_job, delay_before_kill)
68
69@pytest.mark.parametrize("nb_kills_per_job", [KillCountMode(f'{n}kills', n) for n in [1,2]])
70@pytest.mark.parametrize("delay_before_kill", [KillDelayMode(f'after{n}', n) for n in [5,10,15]])
71def test_kill_after_delay_sequences(small_platform, delaysequences_workload, killer_algorithm, redis_mode, nb_kills_per_job, delay_before_kill):
72    kill_after_delay(small_platform, delaysequences_workload, killer_algorithm, redis_mode, nb_kills_per_job, delay_before_kill)
73
74@pytest.mark.parametrize("nb_kills_per_job", [KillCountMode(f'{n}kills', n) for n in [1,2]])
75@pytest.mark.parametrize("delay_before_kill", [KillDelayMode(f'after{n}', n) for n in [0]])
76def test_kill_after_delay0(small_platform, small_workload, killer_algorithm, redis_mode, nb_kills_per_job, delay_before_kill):
77    kill_after_delay(small_platform, small_workload, killer_algorithm, redis_mode, nb_kills_per_job, delay_before_kill)
78
79@pytest.mark.parametrize("nb_kills_per_job", [KillCountMode(f'{n}kills', n) for n in [1]])
80@pytest.mark.parametrize("delay_before_kill", [KillDelayMode(f'after{n}', n) for n in [1]])
81def test_kill_after_delay_smpi(small_platform, smpi_workload, killer_algorithm, redis_mode, nb_kills_per_job, delay_before_kill):
82    kill_after_delay(small_platform, smpi_workload, killer_algorithm, redis_mode, nb_kills_per_job, delay_before_kill)
83
84#####################################################
85# Kill the running job when a new one is submitted. #
86#####################################################
87
88def kill_on_new_submit(platform, workload, algorithm, redis_mode):
89    test_name = f'kill-onnewsubmit-{algorithm.name}-{platform.name}-{workload.name}-{redis_mode.name}'
90    output_dir, robin_filename, _ = init_instance(test_name)
91
92    if algorithm.sched_implem != 'batsched': raise Exception('This test only supports batsched for now')
93
94    batparams = "--forward-profiles-on-submission"
95    if redis_mode.enabled == True: batparams = batparams + " --enable-redis"
96    batcmd = gen_batsim_cmd(platform.filename, workload.filename, output_dir, batparams)
97
98    instance = RobinInstance(output_dir=output_dir,
99        batcmd=batcmd,
100        schedcmd=f"batsched -v '{algorithm.sched_algo_name}'",
101        simulation_timeout=30, ready_timeout=5,
102        success_timeout=10, failure_timeout=0
103    )
104
105    instance.to_file(robin_filename)
106    ret = run_robin(robin_filename)
107    if ret.returncode != 0: raise Exception(f'Bad robin return code ({ret.returncode})')
108
109def test_kill_on_new_submit(small_platform, small_workload, killer2_algorithm, redis_mode):
110    kill_on_new_submit(small_platform, small_workload, killer2_algorithm, redis_mode)
111
112###############################################################################
113# Kill jobs after a given delay, check that the given progress is consistent. #
114###############################################################################
115def kill_progress(platform, workload, algorithm, redis_mode, nb_kills_per_job, delay_before_kill):
116    test_name = f'kill-{delay_before_kill.name}-{nb_kills_per_job.name}-{algorithm.name}-{platform.name}-{workload.name}-{redis_mode.name}'
117    output_dir, robin_filename, schedconf_filename = init_instance(test_name)
118
119    if algorithm.sched_implem != 'batsched': raise Exception('This test only supports batsched for now')
120
121    batparams = "--forward-profiles-on-submission"
122    if redis_mode.enabled == True: batparams = batparams + " --enable-redis"
123    batcmd = gen_batsim_cmd(platform.filename, workload.filename, output_dir, batparams)
124
125    schedconf_content = {
126        "delay_before_kill": delay_before_kill.kill_delay,
127        "nb_kills_per_job": nb_kills_per_job.kill_count_per_job,
128    }
129    write_file(schedconf_filename, json.dumps(schedconf_content))
130
131    instance = RobinInstance(output_dir=output_dir,
132        batcmd=batcmd,
133        schedcmd=f"batsched -v '{algorithm.sched_algo_name}' --variant_options_filepath '{schedconf_filename}'",
134        simulation_timeout=30, ready_timeout=5,
135        success_timeout=10, failure_timeout=0
136    )
137
138    instance.to_file(robin_filename)
139    ret = run_robin(robin_filename)
140    if ret.returncode != 0: raise Exception(f'Bad robin return code ({ret.returncode})')
141
142    # Read Batsim log file.
143    batlog_filename = f'{output_dir}/log/batsim.log'
144    batlog_content = open(batlog_filename, 'r').read()
145    # Parse messages, then events.
146    messages = parse_proto_messages_from_batsim(batlog_content)
147    events = retrieve_proto_events(messages)
148    # Filter JOB_KILLED events.
149    kill_events = [e for e in events if e['type'] == 'JOB_KILLED']
150    nb_err = 0
151
152    for e in kill_events:
153        job_data = e['data']
154        if 'job_progress' not in job_data:
155            print('Error: a job progress is missing!', job_data)
156            nb_err = nb_err + 1
157        #TODO test if this job is msg or delay of composed
158        #and test the progress content type in regards
159
160    if nb_err > 0:
161        raise Exception('The progress of some killed jobs was missing.')
162
163@pytest.mark.parametrize("nb_kills_per_job", [KillCountMode(f'{n}kills', n) for n in [1]])
164@pytest.mark.parametrize("delay_before_kill", [KillDelayMode(f'after{n}', n) for n in [5]])
165def test_kill_progress(small_platform, one_job_workload, killer_algorithm, redis_mode, nb_kills_per_job, delay_before_kill):
166    kill_progress(small_platform, one_job_workload, killer_algorithm, redis_mode, nb_kills_per_job, delay_before_kill)
167
Full Screen

killBufferCommands.py

Source: killBufferCommands.py Github

copy
1# -*- coding: utf-8 -*-
2#@+leo-ver=5-thin
3#@+node:ekr.20150514040142.1: * @file ../commands/killBufferCommands.py
4#@@first
5"""Leo's kill-buffer commands."""
6#@+<< imports >>
7#@+node:ekr.20150514050411.1: ** << imports >> (killBufferCommands.py)
8from leo.core import leoGlobals as g
9from leo.commands.baseCommands import BaseEditCommandsClass
10#@-<< imports >>
11
12def cmd(name):
13    """Command decorator for the KillBufferCommandsClass class."""
14    return g.new_cmd_decorator(name, ['c', 'killBufferCommands',])
15
16#@+others
17#@+node:ekr.20160514120919.1: ** class KillBufferCommandsClass
18class KillBufferCommandsClass(BaseEditCommandsClass):
19    """A class to manage the kill buffer."""
20    #@+others
21    #@+node:ekr.20150514063305.409: *3* kill.ctor & reloadSettings
22    def __init__(self, c):
23        """Ctor for KillBufferCommandsClass class."""
24        # pylint: disable=super-init-not-called
25        self.c = c
26        self.kbiterator = self.iterateKillBuffer()
27        self.last_clipboard = None
28            # For interacting with system clipboard.
29        self.lastYankP = None
30            # Position of the last item returned by iterateKillBuffer.
31        self.reset = None
32            # The index of the next item to be returned in
33            # g.app.globalKillBuffer by iterateKillBuffer.
34        self.reloadSettings()
35
36    def reloadSettings(self):
37        """KillBufferCommandsClass.reloadSettings."""
38        c = self.c
39        self.addWsToKillRing = c.config.getBool('add-ws-to-kill-ring')
40    #@+node:ekr.20150514063305.411: *3* addToKillBuffer
41    def addToKillBuffer(self, text):
42        """
43        Insert the text into the kill buffer if force is True or
44        the text contains something other than whitespace.
45        """
46        if self.addWsToKillRing or text.strip():
47            g.app.globalKillBuffer = [z for z in g.app.globalKillBuffer if z != text]
48            g.app.globalKillBuffer.insert(0, text)
49    #@+node:ekr.20150514063305.412: *3* backwardKillSentence
50    @cmd('backward-kill-sentence')
51    def backwardKillSentence(self, event):
52        """Kill the previous sentence."""
53        w = self.editWidget(event)
54        if not w:
55            return
56        s = w.getAllText()
57        ins = w.getInsertPoint()
58        i = s.rfind('.', ins)
59        if i == -1:
60            return
61        undoType = 'backward-kill-sentence'
62        self.beginCommand(w, undoType=undoType)
63        i2 = s.rfind('.', 0, i) + 1
64        self.kill(event, i2, i + 1, undoType=undoType)
65        w.setInsertPoint(i2)
66        self.endCommand(changed=True, setLabel=True)
67    #@+node:ekr.20150514063305.413: *3* backwardKillWord & killWord
68    @cmd('backward-kill-word')
69    def backwardKillWord(self, event):
70        """Kill the previous word."""
71        c = self.c
72        w = self.editWidget(event)
73        if w:
74            self.beginCommand(w, undoType='backward-kill-word')
75            c.editCommands.backwardWord(event)
76            self.killWordHelper(event)
77
78    @cmd('kill-word')
79    def killWord(self, event):
80        """Kill the word containing the cursor."""
81        w = self.editWidget(event)
82        if w:
83            self.beginCommand(w, undoType='kill-word')
84            self.killWordHelper(event)
85
86    def killWordHelper(self, event):
87        c = self.c
88        e = c.editCommands
89        w = e.editWidget(event)
90        if w:
91            # self.killWs(event)
92            e.extendToWord(event)
93            i, j = w.getSelectionRange()
94            self.kill(event, i, j, undoType=None)
95            self.endCommand(changed=True, setLabel=True)
96    #@+node:ekr.20150514063305.414: *3* clearKillRing
97    @cmd('clear-kill-ring')
98    def clearKillRing(self, event=None):
99        """Clear the kill ring."""
100        g.app.globalKillbuffer = []
101    #@+node:ekr.20150514063305.415: *3* getClipboard
102    def getClipboard(self):
103        """Return the contents of the clipboard."""
104        try:
105            ctxt = g.app.gui.getTextFromClipboard()
106            if not g.app.globalKillBuffer or ctxt != self.last_clipboard:
107                self.last_clipboard = ctxt
108                if not g.app.globalKillBuffer or g.app.globalKillBuffer[0] != ctxt:
109                    return ctxt
110        except Exception:
111            g.es_exception()
112        return None
113    #@+node:ekr.20150514063305.416: *3* class iterateKillBuffer
114    class KillBufferIterClass:
115        """Returns a list of positions in a subtree, possibly including the root of the subtree."""
116        #@+others
117        #@+node:ekr.20150514063305.417: *4* __init__ & __iter__ (iterateKillBuffer)
118        def __init__(self, c):
119            """Ctor for KillBufferIterClass class."""
120            self.c = c
121            self.index = 0  # The index of the next item to be returned.
122
123        def __iter__(self):
124            return self
125        #@+node:ekr.20150514063305.418: *4* __next__
126        def __next__(self):
127            commands = self.c.killBufferCommands
128            aList = g.app.globalKillBuffer  # commands.killBuffer
129            if not aList:
130                self.index = 0
131                return None
132            if commands.reset is None:
133                i = self.index
134            else:
135                i = commands.reset
136                commands.reset = None
137            if i < 0 or i >= len(aList): i = 0
138            val = aList[i]
139            self.index = i + 1
140            return val
141
142        #@-others
143
144    def iterateKillBuffer(self):
145        return self.KillBufferIterClass(self.c)
146    #@+node:ekr.20150514063305.419: *3* kill (helper)
147    def kill(self, event, frm, to, force=False, undoType=None):
148        """A helper method for all kill commands."""
149        w = self.editWidget(event)
150        if not w: return
151        # 2016/03/05: all kill commands kill selected text, if it exists.
152        if not force:
153            # Delete the selection range if it spans a line.
154            i, j = w.getSelectionRange()
155            s = w.get(i, j)
156            if s.find('\n') > -1:
157                frm, to = i, j
158        s = w.get(frm, to)
159        if undoType:
160            self.beginCommand(w, undoType=undoType)
161        self.addToKillBuffer(s)
162        g.app.gui.replaceClipboardWith(s)
163        w.delete(frm, to)
164        w.setInsertPoint(frm)
165        if undoType:
166            self.endCommand(changed=True, setLabel=True)
167    #@+node:ekr.20150514063305.420: *3* killToEndOfLine
168    @cmd('kill-to-end-of-line')
169    def killToEndOfLine(self, event):
170        """Kill from the cursor to end of the line."""
171        w = self.editWidget(event)
172        if not w: return
173        s = w.getAllText()
174        ins = w.getInsertPoint()
175        i, j = g.getLine(s, ins)
176        if ins >= len(s) and g.match(s, j - 1, '\n'):
177            # Kill the trailing newline of the body text.
178            i = max(0, len(s) - 1)
179            j = len(s)
180        elif ins + 1 < j and s[ins : j - 1].strip() and g.match(s, j - 1, '\n'):
181            # Kill the line, but not the newline.
182            i, j = ins, j - 1
183        elif g.match(s, j - 1, '\n'):
184            i = ins  # Kill the newline in the present line.
185        else:
186            i = j
187        if i < j:
188            self.kill(event, i, j, undoType='kill-line')
189    #@+node:ekr.20150514063305.421: *3* KillLine
190    @cmd('kill-line')
191    def killLine(self, event):
192        """Kill the line containing the cursor."""
193        w = self.editWidget(event)
194        if not w: return
195        s = w.getAllText()
196        ins = w.getInsertPoint()
197        i, j = g.getLine(s, ins)
198        if ins >= len(s) and g.match(s, j - 1, '\n'):
199            # Kill the trailing newline of the body text.
200            i = max(0, len(s) - 1)
201            j = len(s)
202        elif j > i + 1 and g.match(s, j - 1, '\n'):
203            # Kill the line, but not the newline.
204            j -= 1
205        else:
206            pass  # Kill the newline in the present line.
207        self.kill(event, i, j, undoType='kill-line')
208    #@+node:ekr.20150514063305.422: *3* killRegion & killRegionSave & helper
209    @cmd('kill-region')
210    def killRegion(self, event):
211        """Kill the text selection."""
212        self.killRegionHelper(event, deleteFlag=True)
213
214    @cmd('kill-region-save')
215    def killRegionSave(self, event):
216        """Add the selected text to the kill ring, but do not delete it."""
217        self.killRegionHelper(event, deleteFlag=False)
218
219    def killRegionHelper(self, event, deleteFlag):
220        w = self.editWidget(event)
221        if not w: return
222        i, j = w.getSelectionRange()
223        if i == j: return
224        s = w.getSelectedText()
225        if deleteFlag:
226            self.beginCommand(w, undoType='kill-region')
227            w.delete(i, j)
228            self.endCommand(changed=True, setLabel=True)
229        self.addToKillBuffer(s)
230        g.app.gui.replaceClipboardWith(s)
231        # self.removeRKeys(w)
232    #@+node:ekr.20150514063305.423: *3* killSentence
233    @cmd('kill-sentence')
234    def killSentence(self, event):
235        """Kill the sentence containing the cursor."""
236        w = self.editWidget(event)
237        if not w:
238            return
239        s = w.getAllText()
240        ins = w.getInsertPoint()
241        i = s.find('.', ins)
242        if i == -1:
243            return
244        undoType = 'kill-sentence'
245        self.beginCommand(w, undoType=undoType)
246        i2 = s.rfind('.', 0, ins) + 1
247        self.kill(event, i2, i + 1, undoType=undoType)
248        w.setInsertPoint(i2)
249        self.endCommand(changed=True, setLabel=True)
250    #@+node:ekr.20150514063305.424: *3* killWs
251    @cmd('kill-ws')
252    def killWs(self, event, undoType='kill-ws'):
253        """Kill whitespace."""
254        ws = ''
255        w = self.editWidget(event)
256        if not w: return
257        s = w.getAllText()
258        i = j = ins = w.getInsertPoint()
259        while i >= 0 and s[i] in (' ', '\t'):
260            i -= 1
261        if i < ins: i += 1
262        while j < len(s) and s[j] in (' ', '\t'):
263            j += 1
264        if j > i:
265            ws = s[i:j]
266            w.delete(i, j)
267            if undoType:
268                self.beginCommand(w, undoType=undoType)
269            if self.addWsToKillRing:
270                self.addToKillBuffer(ws)
271            if undoType:
272                self.endCommand(changed=True, setLabel=True)
273    #@+node:ekr.20150514063305.425: *3* yank
274    @cmd('yank')
275    def yank(self, event, pop=False):
276        """
277        yank: insert the first entry of the kill ring.
278        yank-pop: insert the next entry of the kill ring.
279        """
280        c = self.c
281        w = self.editWidget(event)
282        if not w:
283            return
284        current = c.p
285        if not current:
286            return
287        text = w.getAllText()
288        i, j = w.getSelectionRange()
289        clip_text = self.getClipboard()
290        if not g.app.globalKillBuffer and not clip_text:
291            return
292        undoType = 'yank-pop' if pop else 'yank'
293        self.beginCommand(w, undoType=undoType)
294        try:
295            if not pop or self.lastYankP and self.lastYankP != current:
296                self.reset = 0
297            s = self.kbiterator.__next__()
298            if s is None: s = clip_text or ''
299            if i != j: w.deleteTextSelection()
300            if s != s.lstrip():  # s contains leading whitespace.
301                i2, j2 = g.getLine(text, i)
302                k = g.skip_ws(text, i2)
303                if i2 < i <= k:
304                    # Replace the line's leading whitespace by s's leading whitespace.
305                    w.delete(i2, k)
306                    i = i2
307            w.insert(i, s)
308            # Fix bug 1099035: Leo yank and kill behaviour not quite the same as emacs.
309            # w.setSelectionRange(i,i+len(s),insert=i+len(s))
310            w.setInsertPoint(i + len(s))
311            self.lastYankP = current.copy()
312        finally:
313            self.endCommand(changed=True, setLabel=True)
314    #@+node:ekr.20150514063305.426: *3* yankPop
315    @cmd('yank-pop')
316    def yankPop(self, event):
317        """Insert the next entry of the kill ring."""
318        self.yank(event, pop=True)
319    #@+node:ekr.20150514063305.427: *3* zapToCharacter
320    @cmd('zap-to-character')
321    def zapToCharacter(self, event):
322        """Kill characters from the insertion point to a given character."""
323        k = self.c.k
324        w = self.editWidget(event)
325        if not w:
326            return
327        state = k.getState('zap-to-char')
328        if state == 0:
329            k.setLabelBlue('Zap To Character: ')
330            k.setState('zap-to-char', 1, handler=self.zapToCharacter)
331        else:
332            ch = event.char if event else ' '
333            k.resetLabel()
334            k.clearState()
335            s = w.getAllText()
336            ins = w.getInsertPoint()
337            i = s.find(ch, ins)
338            if i == -1: return
339            self.beginCommand(w, undoType='zap-to-char')
340            self.addToKillBuffer(s[ins:i])
341            g.app.gui.replaceClipboardWith(s[ins:i])  # Support for proper yank.
342            w.setAllText(s[:ins] + s[i:])
343            w.setInsertPoint(ins)
344            self.endCommand(changed=True, setLabel=True)
345    #@-others
346#@-others
347#@-leo
348
Full Screen

test_async_process.py

Source: test_async_process.py Github

copy
1# Copyright 2013 Red Hat, Inc.
2#
3#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4#    not use this file except in compliance with the License. You may obtain
5#    a copy of the License at
6#
7#         http://www.apache.org/licenses/LICENSE-2.0
8#
9#    Unless required by applicable law or agreed to in writing, software
10#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12#    License for the specific language governing permissions and limitations
13#    under the License.
14
15import signal
16import sys
17from unittest import mock
18
19import eventlet.event
20from eventlet.green import subprocess
21import eventlet.queue
22import testtools
23
24from neutron.agent.common import async_process
25from neutron.agent.common import utils
26from neutron.tests import base
27from neutron.tests.unit.agent.linux import failing_process
28
29
30class TestAsyncProcess(base.BaseTestCase):
31
32    def setUp(self):
33        super(TestAsyncProcess, self).setUp()
34        self.proc = async_process.AsyncProcess(['fake'])
35
36    def test_construtor_raises_exception_for_negative_respawn_interval(self):
37        with testtools.ExpectedException(ValueError):
38            async_process.AsyncProcess(['fake'], respawn_interval=-1)
39
40    def test__spawn(self):
41        expected_process = 'Foo'
42        proc = self.proc
43        with mock.patch.object(utils, 'create_process') as mock_create_process:
44            mock_create_process.return_value = [expected_process, None]
45            with mock.patch('eventlet.spawn') as mock_spawn:
46                proc._spawn()
47
48        self.assertTrue(self.proc._is_running)
49        self.assertIsInstance(proc._kill_event, eventlet.event.Event)
50        self.assertEqual(proc._process, expected_process)
51        mock_spawn.assert_has_calls([
52            mock.call(proc._watch_process,
53                      proc._read_stdout,
54                      proc._kill_event),
55            mock.call(proc._watch_process,
56                      proc._read_stderr,
57                      proc._kill_event),
58        ])
59        self.assertEqual(len(proc._watchers), 2)
60
61    def test__pid_none(self):
62        pid = 1
63        self.proc._pid = None
64        with mock.patch.object(self.proc, '_process') as _process:
65            with mock.patch.object(utils,
66                                   'get_root_helper_child_pid') as func:
67                func.return_value = pid
68                self.assertEqual(self.proc.pid, pid)
69                func.assert_called_once_with(_process.pid, ['fake'],
70                                             run_as_root=False)
71                self.assertEqual(self.proc._pid, pid)
72
73    def test__pid_not_none(self):
74        self.proc._pid = 1
75        with mock.patch.object(self.proc, '_process'),\
76                mock.patch.object(utils, 'get_root_helper_child_pid') as func:
77            self.assertEqual(self.proc.pid, 1)
78            func.assert_not_called()
79
80    def test__handle_process_error_kills_with_respawn(self):
81        with mock.patch.object(self.proc, '_kill') as kill:
82            self.proc._handle_process_error()
83
84        kill.assert_has_calls([mock.call(signal.SIGKILL)])
85
86    def test__handle_process_error_kills_without_respawn(self):
87        self.proc.respawn_interval = 1
88        with mock.patch.object(self.proc, '_kill') as kill:
89            with mock.patch.object(self.proc, '_spawn') as spawn:
90                with mock.patch('eventlet.sleep') as sleep:
91                    self.proc._handle_process_error()
92
93        kill.assert_has_calls([mock.call(signal.SIGKILL)])
94        sleep.assert_has_calls([mock.call(self.proc.respawn_interval)])
95        spawn.assert_called_once_with()
96
97    def test__handle_process_error_no_crash_if_started(self):
98        self.proc._is_running = True
99        with mock.patch.object(self.proc, '_kill'):
100            with mock.patch.object(self.proc, '_spawn') as mock_spawn:
101                self.proc._handle_process_error()
102                mock_spawn.assert_not_called()
103
104    def _watch_process_exception(self):
105        raise Exception('Error!')
106
107    def _test__watch_process(self, callback, kill_event):
108        self.proc._is_running = True
109        self.proc._kill_event = kill_event
110        # Ensure the test times out eventually if the watcher loops endlessly
111        with self.assert_max_execution_time():
112            with mock.patch.object(self.proc,
113                                   '_handle_process_error') as func:
114                self.proc._watch_process(callback, kill_event)
115
116        if not kill_event.ready():
117            func.assert_called_once_with()
118
119    def test__watch_process_exits_on_callback_failure(self):
120        self._test__watch_process(lambda: None, eventlet.event.Event())
121
122    def test__watch_process_exits_on_exception(self):
123        self._test__watch_process(self._watch_process_exception,
124                                  eventlet.event.Event())
125        with mock.patch.object(self.proc,
126                               '_handle_process_error') as func:
127            self.proc._watch_process(self._watch_process_exception,
128                                     self.proc._kill_event)
129            func.assert_not_called()
130
131    def test__watch_process_exits_on_sent_kill_event(self):
132        kill_event = eventlet.event.Event()
133        kill_event.send()
134        self._test__watch_process(None, kill_event)
135
136    def _test_read_output_queues_and_returns_result(self, output):
137        queue = eventlet.queue.LightQueue()
138        mock_stream = mock.Mock()
139        with mock.patch.object(mock_stream, 'readline') as mock_readline:
140            mock_readline.return_value = output
141            result = self.proc._read(mock_stream, queue)
142
143        if output:
144            self.assertEqual(output, result)
145            self.assertEqual(output, queue.get_nowait())
146        else:
147            self.assertFalse(result)
148            self.assertTrue(queue.empty())
149
150    def test__read_queues_and_returns_output(self):
151        self._test_read_output_queues_and_returns_result('foo')
152
153    def test__read_returns_none_for_missing_output(self):
154        self._test_read_output_queues_and_returns_result('')
155
156    def test_start_raises_exception_if_process_already_started(self):
157        self.proc._is_running = True
158        with testtools.ExpectedException(async_process.AsyncProcessException):
159            self.proc.start()
160
161    def test_start_invokes__spawn(self):
162        with mock.patch.object(self.proc, '_spawn') as mock_start:
163            self.proc.start()
164
165        mock_start.assert_called_once_with()
166
167    def test__iter_queue_returns_empty_list_for_empty_queue(self):
168        result = list(self.proc._iter_queue(eventlet.queue.LightQueue(),
169                                            False))
170        self.assertEqual([], result)
171
172    def test__iter_queue_returns_queued_data(self):
173        queue = eventlet.queue.LightQueue()
174        queue.put('foo')
175        result = list(self.proc._iter_queue(queue, False))
176        self.assertEqual(result, ['foo'])
177
178    def _test_iter_output_calls_iter_queue_on_output_queue(self, output_type):
179        expected_value = 'foo'
180        with mock.patch.object(self.proc, '_iter_queue') as mock_iter_queue:
181            mock_iter_queue.return_value = expected_value
182            target_func = getattr(self.proc, 'iter_%s' % output_type, None)
183            value = target_func()
184
185        self.assertEqual(value, expected_value)
186        queue = getattr(self.proc, '_%s_lines' % output_type, None)
187        mock_iter_queue.assert_called_with(queue, False)
188
189    def test_iter_stdout(self):
190        self._test_iter_output_calls_iter_queue_on_output_queue('stdout')
191
192    def test_iter_stderr(self):
193        self._test_iter_output_calls_iter_queue_on_output_queue('stderr')
194
195    def test__kill_targets_process_for_pid(self):
196        pid = 1
197
198        with mock.patch.object(self.proc, '_kill_event'
199                               ) as mock_kill_event,\
200                mock.patch.object(utils, 'get_root_helper_child_pid',
201                                  return_value=pid),\
202                mock.patch.object(self.proc, '_kill_process_and_wait'
203                                  ) as mock_kill_process_and_wait,\
204                mock.patch.object(self.proc, '_process'):
205            self.proc._kill(signal.SIGKILL)
206
207            self.assertIsNone(self.proc._kill_event)
208            self.assertFalse(self.proc._is_running)
209            self.assertIsNone(self.proc._pid)
210
211        mock_kill_event.send.assert_called_once_with()
212        if pid:
213            mock_kill_process_and_wait.assert_called_once_with(
214                pid, signal.SIGKILL, None)
215
216    def _test__kill_process_and_wait(self, pid, expected,
217                                     exception_message=None,
218                                     kill_signal=signal.SIGKILL):
219        self.proc.run_as_root = True
220        if exception_message:
221            exc = RuntimeError(exception_message)
222        else:
223            exc = None
224        with mock.patch.object(utils, 'kill_process',
225                               side_effect=exc) as mock_kill_process:
226            actual = self.proc._kill_process(pid, kill_signal)
227
228        self.assertEqual(expected, actual)
229        mock_kill_process.assert_called_with(pid,
230                                             kill_signal,
231                                             self.proc.run_as_root)
232
233    def test__kill_process_and_wait_returns_true_for_valid_pid(self):
234        self._test__kill_process_and_wait('1', True)
235
236    def test__kill_process_and_wait_returns_false_for_execute_exception(self):
237        self._test__kill_process_and_wait('1', False, 'Invalid')
238
239    def test_kill_process_and_wait_with_different_signal(self):
240        self._test__kill_process_and_wait(
241            '1', True, kill_signal=signal.SIGTERM)
242
243    def test__kill_process_timeout_reached(self):
244        self.proc.run_as_root = True
245        kill_timeout = 5
246        pid = '1'
247        with mock.patch.object(utils, 'kill_process') as mock_kill_process, \
248                mock.patch.object(self.proc, '_process') as process_mock:
249            process_mock.wait.side_effect = subprocess.TimeoutExpired(
250                self.proc.cmd, kill_timeout)
251            self.assertTrue(
252                self.proc._kill_process_and_wait(
253                    pid, signal.SIGTERM, kill_timeout))
254
255        process_mock.wait.assert_called_once_with(kill_timeout)
256        mock_kill_process.assert_has_calls([
257            mock.call(pid, signal.SIGTERM, self.proc.run_as_root),
258            mock.call(pid, signal.SIGKILL, self.proc.run_as_root)])
259
260    def test_stop_calls_kill_with_provided_signal_number(self):
261        self.proc._is_running = True
262        with mock.patch.object(self.proc, '_kill') as mock_kill:
263            self.proc.stop(kill_signal=signal.SIGTERM)
264        mock_kill.assert_called_once_with(signal.SIGTERM, None)
265
266    def test_stop_raises_exception_if_already_started(self):
267        with testtools.ExpectedException(async_process.AsyncProcessException):
268            self.proc.stop()
269
270    def test_cmd(self):
271        for expected, cmd in (('ls -l file', ['ls', '-l', 'file']),
272                              ('fake', ['fake'])):
273            proc = async_process.AsyncProcess(cmd)
274            self.assertEqual(expected, proc.cmd)
275
276
277class TestAsyncProcessLogging(base.BaseTestCase):
278
279    def setUp(self):
280        super(TestAsyncProcessLogging, self).setUp()
281        self.log_mock = mock.patch.object(async_process, 'LOG').start()
282
283    def _test__read_stdout_logging(self, enable):
284        proc = async_process.AsyncProcess(['fakecmd'], log_output=enable)
285        with mock.patch.object(proc, '_read', return_value='fakedata'),\
286                mock.patch.object(proc, '_process'):
287            proc._read_stdout()
288        self.assertEqual(enable, self.log_mock.debug.called)
289
290    def _test__read_stderr_logging(self, enable):
291        proc = async_process.AsyncProcess(['fake'], log_output=enable)
292        with mock.patch.object(proc, '_read', return_value='fakedata'),\
293                mock.patch.object(proc, '_process'):
294            proc._read_stderr()
295        self.assertEqual(enable, self.log_mock.error.called)
296
297    def test__read_stdout_logging_enabled(self):
298        self._test__read_stdout_logging(enable=True)
299
300    def test__read_stdout_logging_disabled(self):
301        self._test__read_stdout_logging(enable=False)
302
303    def test__read_stderr_logging_enabled(self):
304        self._test__read_stderr_logging(enable=True)
305
306    def test__read_stderr_logging_disabled(self):
307        self._test__read_stderr_logging(enable=False)
308
309
310class TestAsyncProcessDieOnError(base.BaseTestCase):
311
312    def test__read_stderr_returns_none_on_error(self):
313        proc = async_process.AsyncProcess(['fakecmd'], die_on_error=True)
314        with mock.patch.object(proc, '_read', return_value='fakedata'),\
315                mock.patch.object(proc, '_process'):
316            self.assertIsNone(proc._read_stderr())
317
318
319class TestFailingAsyncProcess(base.BaseTestCase):
320    def setUp(self):
321        super(TestFailingAsyncProcess, self).setUp()
322        path = self.get_temp_file_path('async.tmp', self.get_new_temp_dir())
323        self.process = async_process.AsyncProcess([sys.executable,
324                                                   failing_process.__file__,
325                                                   path],
326                                                  respawn_interval=0)
327
328    def test_failing_async_process_handle_error_once(self):
329        with mock.patch.object(self.process, '_handle_process_error')\
330                as handle_error_mock:
331            self.process.start()
332            self.process._process.wait()
333            # Wait for the monitor process to complete
334            for thread in self.process._watchers:
335                thread.wait()
336            self.assertEqual(1, handle_error_mock.call_count)
337
Full Screen

config.js

Source: config.js Github

copy
1/*
2* Recodado por Lucas R. e construido em homenagem ao Legião Z.
3* Evite remover coisas como o Link do legião, obrigado!
4*/
5const { decryptMedia } = require('@open-wa/wa-decrypt')
6const fs = require('fs-extra')
7const axios = require('axios')
8const sharp = require('sharp')
9const math = require('mathjs')
10const search = require("simple-play-store-search")
11const google = require('google-it')
12const isPorn = require('is-porn')
13const imgsearch = require('node-reverse-image-search')
14const imgbbUploader = require('imgbb-uploader')
15const moment = require('moment-timezone')
16moment.tz.setDefault('America/Sao_Paulo').locale('pt_BR')
17const get = require('got')
18const request = require('request')
19const color = require('./lib/color')
20const { spawn, exec, execFile } = require('child_process')
21const nhentai = require('nhentai-js')
22const { API } = require('nhentai-api')
23const { randomNimek, sleep, wall, tulis, ss } = require('./lib/functions')
24const { owner, donate, down, help, admins, adult, readme, lang } = require('./lib/help')
25const { stdout } = require('process')
26const bent = require('bent')
27const { doing } = require('./lib/translate.js')
28const { meme, msgFilter, translate, kill } = require('./lib')
29const { uploadImages } = require('./lib/fether')
30const feature = require('./lib/poll')
31const { sobre } = require('./lib/sobre')
32const { belle } = require('./lib/belle')
33const { termux } = require('./lib/termux')
34const bklist = JSON.parse(fs.readFileSync('./lib/blacklist.json'))
35const faki = JSON.parse(fs.readFileSync('./lib/fake.json'))
36const atbk = JSON.parse(fs.readFileSync('./lib/anti.json'))
37const BrainlySearch = require('./lib/brainly')
38const { removeBackgroundFromImageBase64 } = require('remove.bg')
39const fetch = require('node-fetch');
40const nsfw_ = JSON.parse(fs.readFileSync('./lib/NSFW.json'))
41const welkom = JSON.parse(fs.readFileSync('./lib/welcome.json'))
42const exsv = JSON.parse(fs.readFileSync('./lib/exclusive.json'))
43const errorurl = 'https://steamuserimages-a.akamaihd.net/ugc/954087817129084207/5B7E46EE484181A676C02DFCAD48ECB1C74BC423/?imw=512&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false'
44const errorurl2 = 'https://steamuserimages-a.akamaihd.net/ugc/954087817129084207/5B7E46EE484181A676C02DFCAD48ECB1C74BC423/?imw=512&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false'
45
46
47module.exports = kconfig = async (kill, message) => {
48    try {
49		const { type, id, from, t, sender, author, isGroupMsg, chat, chatId, caption, isMedia, mimetype, quotedMsg, quotedMsgObj, mentionedJidList } = message
50        let { body } = message
51        const { name, formattedTitle } = chat
52        let { pushname, verifiedName, formattedName } = sender
53        pushname = pushname || verifiedName || formattedName
54	const techapi = 'INSIRA UMA API DO SITE OPEN API I-TECH' // MUDE ISSO PARA UMA API DO SITE QUE TA ALI
55        const double = Math.floor(Math.random() * 2) + 1
56        const four = Math.floor(Math.random() * 4) + 1
57        const triple = Math.floor(Math.random() * 3) + 1
58        const cinco = Math.floor(Math.random() * 5) + 1
59        const six = Math.floor(Math.random() * 6) + 1
60        const seven = Math.floor(Math.random() * 7) + 1
61        const octo = Math.floor(Math.random() * 8) + 1
62		const lvpc = Math.floor(Math.random() * 101) + 1
63        const time = moment(t * 1000).format('DD/MM HH:mm:ss')
64		const processTime = (timestamp, now) => { return moment.duration(now - moment(timestamp * 1000)).asSeconds() }
65        const botNumber = await kill.getHostNumber()
66        const blockNumber = await kill.getBlockedIds()
67        const groupId = isGroupMsg ? chat.groupMetadata.id : ''
68        const groupAdmins = isGroupMsg ? await kill.getGroupAdmins(groupId) : ''
69        const isGroupAdmins = isGroupMsg ? groupAdmins.includes(sender.id) : false
70        const isBotGroupAdmins = isGroupMsg ? groupAdmins.includes(botNumber + '@c.us') : false
71		const chats = (type === 'chat') ? body : (type === 'image' || type === 'video') ? caption : ''
72        const ownerNumber = '[email protected]' // MUDE ISSO PARA O SEU NUMERO
73        const isOwner = sender.id === ownerNumber
74        global.pollfile = 'poll_Config_'+chat.id+'.json'
75        global.voterslistfile = 'poll_voters_Config_'+chat.id+'.json'
76		global.client = kill
77        const isBlocked = blockNumber.includes(sender.id)
78		const isLeg = exsv.includes(chatId)
79        const isNsfw = isGroupMsg ? nsfw_.includes(chat.id) : false
80        const isUrl = new RegExp(/https?:\/\/(www\.)?[[email protected]:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/gi)
81	
82
83
84        // Bot Prefix
85        const prefix = '/'
86        body = (type === 'chat' && body.startsWith(prefix)) ? body : ((type === 'image' && caption || type === 'video' && caption) && caption.startsWith(prefix)) ? caption : ''
87        const command = body.slice(1).trim().split(/ +/).shift().toLowerCase()
88		const arg = body.trim().substring(body.indexOf(' ') + 1)
89        const args = body.trim().split(/ +/).slice(1)
90        const isCmd = body.startsWith(prefix)
91        const url = args.length !== 0 ? args[0] : ''
92        const uaOverride = process.env.UserAgent
93        const isQuotedImage = quotedMsg && quotedMsg.type === 'image'
94		const isQuotedVideo = quotedMsg && quotedMsg.type === 'video'
95		
96		
97        const mess = {
98            wait: '✅¿Puedes esperar un rato? Realizar este tipo de comando lleva algún tiempo🏳.',
99            error: {
100                St: '¡Lo usaste mal jaja! \nPara usar esto, envía o etiqueta una foto con este mensaje.',
101                Ki: 'Para eliminar administradores, primero debe eliminar su ADM.',
102                Ad: '¡Errores! No pude agregarlo, podría deberse a la limitación de agregar o mis errores.',
103                Go: 'Por qué, solo el propietario de un grupo puede usar este tipo de comando.',
104		Kl: '¡Ups! Ese es solo mi creador, no puedes acceder.',
105		Ga: 'Solo los administradores pueden usarlo, así que chaoo jaja!',
106		Gp: 'Lo siento, pero este es un comando para grupos.🕳💦.',
107		Ac: 'Solo los grupos que permiten contenido +18 pueden usar comandos como este, si usted es el propietario y desea esto, use /nsfw enable o use en PRIV.',
108		Ba: 'Estimado administrador, si desea que use estos comandos, debe permitirme ser admin😙!',
109                Iv: '¿Este enlace es correcto? Me parece mal...'
110            }
111        }
112	
113	
114		// ANTI GRUPOS && ANTI PORNO
115        if (isGroupMsg && isLeg && !isGroupAdmins){
116            if (chats.match(/(https?:\/\/chat.whatsapp.com)/gi)) {
117				console.log('Comprobando el enlace de grupo recibido.')
118                const check = await kill.inviteInfo(chats)
119                if (check.status == 200) {
120                    kill.removeParticipant(groupId, sender.id)
121					console.log('Era un enlace real, así que lo elimine ' + sender.id)
122                } else {
123                    console.log('¡Enlace de grupo recibido! Pero es falso, no supone amenazas.')
124                }
125			} else if (chats.match(/\bhttps?:\/\/(www\.)?[[email protected]:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi)) {
126				const chatpn = chats.match(/\bhttps?:\/\/(www\.)?[[email protected]:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi)
127				const flnrl = new URL(chatpn)
128				console.log('Comprobación de pornografía en el enlace recibido...\n' + flnrl)
129				isPorn(flnrl.hostname, function(error, status) {
130					if (status == true) {
131						kill.removeParticipant(groupId, sender.id)
132						console.log('Había pornografía, así que lo elimine ' + sender.id)
133					}
134				})
135			}
136		} else {
137            if (chats.match(/(https?:\/\/chat.whatsapp.com)/gi)) {
138				console.log('Se recibió un enlace de grupo, pero era de alguien en la Lista Blanca o en el PV.')
139			}
140		}
141	            
142        // ANTI FLOOD PRIVADO
143        if (isCmd && msgFilter.isFiltered(from) && !isGroupMsg) {
144        await kill.reply(from, '¡Ei! Espere 10 segundos antes de usar otros comandos!', id)
145		return console.log(color('FLOOD AS', 'red'), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`${command} [${args.length}]`), 'de', color(pushname))
146		}
147		
148		
149		// ANTI FLOOD GRUPOS
150        if (isCmd && msgFilter.isFiltered(from) && isGroupMsg) {
151		await kill.reply(from, 'Ei! Espere 10 segundos antes de usar otros comandos!', id)
152		return console.log(color('FLOOD AS', 'red'), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), color(`${command} [${args.length}]`), 'de', color(pushname), 'em', color(name || formattedTitle))
153		}
154		
155		
156        // MENSAGENS
157        if (!isCmd && !isGroupMsg) { return console.log('> MENSAGEM AS', color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), 'de', color(pushname)) }
158        if (!isCmd && isGroupMsg) { return console.log('> MENSAGEM AS', color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), 'de', color(pushname), 'em', color(name || formattedTitle)) }
159		
160		// COMANDOS
161        if (isCmd && !isGroupMsg) { console.log(color(`> COMANDO "/${command} [${args.length}]" AS`), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), 'de', color(pushname)) }
162        if (isCmd && isGroupMsg) { console.log(color(`> COMANDO "/${command} [${args.length}]" AS`), color(moment(t * 1000).format('DD/MM/YY HH:mm:ss'), 'yellow'), 'de', color(pushname), 'em', color(name || formattedTitle)) }
163		
164
165        // Impede SPAM
166        msgFilter.addFilter(from)
167	
168
169        switch(command) {
170
171           
172        case 'sticker':
173        case 'stiker':
174            if (isMedia && type === 'image') {
175                const mediaData = await decryptMedia(message, uaOverride)
176				sharp(mediaData)
177				.resize(512, 512, {
178					fit: sharp.fit.contain
179				})
180				.toBuffer()
181				.then(async (resizedImageBuffer) => {
182					let resizedImageData = resizedImageBuffer.toString('base64');
183					let resizedBase64 = `data:${mimetype};base64,${resizedImageData}`;
184					await kill.sendImageAsSticker(from, resizedBase64)
185				})
186            } else if (quotedMsg && quotedMsg.type == 'image') {
187                const mediaData = await decryptMedia(quotedMsg, uaOverride)
188				sharp(mediaData)
189				.resize(512, 512, {
190					fit: sharp.fit.contain
191				})
192				.toBuffer()
193				.then(async (resizedImageBuffer) => {
194					let resizedImageData = resizedImageBuffer.toString('base64');
195					let resizedBase64 = `data:${quotedMsg.mimetype};base64,${resizedImageData}`;
196					await kill.sendImageAsSticker(from, resizedBase64)
197				})
198            } else if (args.length == 1) {
199                const url = args[1]
200                if (url.match(isUrl)) {
201                    await kill.sendStickerfromUrl(from, url, { method: 'get' })
202                        .catch(err => console.log('Erro: ', err))
203                } else {
204                    kill.reply(from, mess.error.Iv, id)
205                }
206            } else {
207                    kill.reply(from, mess.error.St, id)
208            }
209            break
210
211			
212
213		case 'ttp':
214			if (args.length == 0) return kill.reply(from, '¿Dónde está la frase?', id)
215			axios.get(`https://st4rz.herokuapp.com/api/ttp?kata=${body.slice(5)}`)
216			.then(res => {
217				kill.sendImageAsSticker(from, res.data.result)
218			})
219			break
220			
221			
222		case 'anonymod':
223    await kill.reply(from, 'Algunos videos del canal de mi bro DEIVID\n\nWhatsApp ANONYMOUS V.06 oFc 100% inmune\n\nhttps://youtu.be/tOE_ywldS_Q\n\nComo modificar un WA prt-1\n\nhttps://youtu.be/WdWsvY3xGPc\n\nWhAtsApp BusSines Golden/13\n\nhttps://youtu.be/JqSHAWlGhDY\n\nNumero virtual +48 método efectivo\n\nhttps://youtu.be/7GOss7AaJ88\n\nNumero virtual +1 EE.Uu (ANONYMOUS DEIVID)\n\nhttps://youtu.be/D1G6hI1mLs4\n\nCreando con pixelLab (ANONYMOUS DEIVID)\n\nhttps://youtu.be/so1y1g-MPZ4\n\nSu video mas reciente:\n\nhttps://youtu.be/hy4od9BT-tA\n\nEspero y lo apoyes🤗', id)
224    break
225	
226	    case 'samu330':
227    await kill.reply(from, '。☆✼★━━━━━━━━━━━━★✼☆。\n\nHola!😀\n\nTe gustaria apoyarme?\n\nSolo unete a mi grupo de WhatsApp: https://chat.whatsapp.com/ELeHAmX3P6j1xy1qNRjEXR\n\n* ◄ ◊ ► ◄ ◊ ► ◄ ◊ ► ◄ ◊ ► ◄ ◊ ►*\n\nO puedes suscribirte a mi canal para saber como instalar un Bot: https://www.youtube.com/channel/UCqPXxG2ZdDe_ugOqMHDRMqg\n\n✩。:*•.─────  ❁ ❁  ─────.•*:。✩\n\nO seamos amigos en facebook: https://facebook.com/tupapi.samu330', id)
228    break	
229			
230		case 'about':
231			await kill.sendFile(from, './lib/media/img/iris.png', 'iris.png', sobre, id)
232			break
233			
234		case 'belle':
235			await kill.sendFile(from, './lib/media/img/belle.png', 'belle.png', belle, id)
236			break
237
238		case 'termux':
239			await kill.sendFile(from, './lib/media/img/termux.png', 'termux.png', termux, id)
240			break
241			
242		case 'fake':
243			if (isGroupMsg && isGroupAdmins) {
244				if (args.length !== 1) return kill.reply(from, 'Olvidaste establecer entre activado [on], y desactivado [off].', id)
245				if (args[0] == 'on') {
246					faki.push(chatId)
247					fs.writeFileSync('./lib/fake.json', JSON.stringify(faki))
248					kill.reply(from, 'Anti-Fakes habilitado.', id)
249				} else if (args[0] == 'off') {
250					let yath = faki.indexOf(chatId)
251					faki.splice(yath, 1)
252					fs.writeFileSync('./lib/fake.json', JSON.stringify(faki))
253					kill.reply(from, 'Anti-fakes desabilitado.', id)
254				}
255			} else if (isGroupMsg && isGroupAdmins) {
256				if (args.length !== 1) return kill.reply(from, 'Olvidaste establecer entre activado [on], y desactivado [off].', id)
257				if (args[0] == 'on') {
258					faki.push(chatId)
259					fs.writeFileSync('./lib/fake.json', JSON.stringify(faki))
260					kill.reply(from, 'Anti-Fakes habilitado.', id)
261				} else if (args[0] == 'off') {
262					let yath = faki.indexOf(chatId)
263					faki.splice(yath, 1)
264					fs.writeFileSync('./lib/fake.json', JSON.stringify(faki))
265					kill.reply(from, 'Anti-fakes desabilitado.', id)
266				}
267            } else {
268                kill.reply(from, mess.error.Ga, id)
269            }
270            break
271			
272			
273        case 'blacklist':
274            if (isGroupMsg && isGroupAdmins) {
275				if (args.length !== 1) return kill.reply(from, 'Defina entre on y off!', id)
276				if (args[0] == 'on') {
277					bklist.push(chatId)
278					fs.writeFileSync('./lib/blacklist.json', JSON.stringify(bklist))
279					kill.reply(from, 'Anti números accionado.\nUse /bklist (Número) para adicionar números.', id)
280				} else if (args[0] == 'off') {
281					let exclu = bklist.indexOf(chatId)
282					bklist.splice(exclu, 1)
283					fs.writeFileSync('./lib/blacklist.json', JSON.stringify(bklist))
284					kill.reply(from, 'Anti números offline.', id)
285				}
286			} else if (isGroupMsg && isOwner) {
287				if (args.length !== 1) return kill.reply(from, 'Defina entre on y off!', id)
288				if (args[0] == 'on') {
289					bklist.push(chatId)
290					fs.writeFileSync('./lib/blacklist.json', JSON.stringify(bklist))
291					kill.reply(from, 'Anti números acionado.\nUse /bklist (Número) para adicionar números.', id)
292				} else if (args[0] == 'off') {
293					let exclu = bklist.indexOf(chatId)
294					bklist.splice(exclu, 1)
295					fs.writeFileSync('./lib/blacklist.json', JSON.stringify(bklist))
296					kill.reply(from, 'Anti números offline.', id)
297				}
298            } else {
299                kill.reply(from, mess.error.Ga, id)
300            }
301            break	
302		
303			
304        case 'bklist':
305            if (isGroupMsg && isGroupAdmins) {
306				if (args.length == 0) return kill.reply(from, 'Defina un número.', id)
307				const bkls = body.slice(8) + '@c.us'
308				atbk.push(bkls)
309				fs.writeFileSync('./lib/anti.json', JSON.stringify(atbk))
310				await client.reply(from, 'Número adicionado a black-list', id)
311			} else if (isGroupMsg && isOwner) {
312				if (args.length == 0) return kill.reply(from, 'Defina un número.', id)
313				const bkls = body.slice(8) + '@c.us'
314				atbk.push(bkls)
315				fs.writeFileSync('./lib/anti.json', JSON.stringify(atbk))
316				await client.reply(from, 'Número adicionado a black-list', id)
317            } else {
318                kill.reply(from, mess.error.Ga, id)
319            }
320            break
321		
322			
323        case 'stickernobg':
324		 if (isMedia) {
325                try {
326                    var mediaData = await decryptMedia(message, uaOverride)
327                    var imageBase64 = `data:${mimetype};base64,${mediaData.toString('base64')}`
328                    var base64img = imageBase64
329                    var outFile = './lib/media/img/noBg.png'
330                    var result = await removeBackgroundFromImageBase64({ base64img, apiKey: 'https://www.remove.bg/upload', size: 'auto', type: 'auto', outFile }) // bota sua propria api ai, cuidado no limite mensal
331                    await fs.writeFile(outFile, result.base64img)
332                    await kill.sendImageAsSticker(from, `data:${mimetype};base64,${result.base64img}`)
333					await kill.reply(from, 'Trate de no usar esto cuando no lo nececite,', id)
334                } catch(err) {
335                    console.log(err)
336		    await kill.reply(from, 'Ups! Algo esta mal en este comando!', id)
337                }
338            }
339            break
340
341        case 'stickergif':
342        case 'stikergif':
343        case 'gif':
344if (isMedia) {
345                if (mimetype === 'video/mp4' && message.duration < 15 || mimetype === 'image/gif' && message.duration < 15) {
346                    var mediaData = await decryptMedia(message, uaOverride)
347                    kill.reply(from, mess.wait, id)
348                    var filename = `./lib/media/stickergif.${mimetype.split('/')[1]}`
349                    await fs.writeFileSync(filename, mediaData)
350                    await exec(`gify ${filename} ./lib/media/stickergf.gif --fps=60 --scale=256:256`, async function (error, stdout, stderr) {
351                        var gif = await fs.readFileSync('./lib/media/stickergf.gif', { encoding: "base64" })
352                        await kill.sendImageAsSticker(from, `data:image/gif;base64,${gif.toString('base64')}`)
353                        .catch(() => {
354                            kill.reply(from, 'Aff! la conversion tuvo errores, puede ser el peso de video/gif.', id)
355                        })
356                    })
357                } else {
358                    kill.reply(from, `Encaso de que reciba esto considere 2 opciones.\n\n1 - Esto no es un gif o video.\n\n2 - el gif o video supera los 15 segundos.`, id)
359                }
360            } else if (quotedMsg) {
361                if (quotedMsg.mimetype == 'video/mp4' && quotedMsg.duration < 15 || quotedMsg.mimetype == 'image/gif' && quotedMsg.duration < 15) {
362                    var mediaData = await decryptMedia(quotedMsg, uaOverride)
363                    kill.reply(from, mess.wait, id)
364                    var filename = `./lib/media/stickergif.${quotedMsg.mimetype.split('/')[1]}`
365                    await fs.writeFileSync(filename, mediaData)
366                    await exec(`gify ${filename} ./lib/media/stickergf.gif --fps=60 --scale=256:256`, async function (error, stdout, stderr) {
367                        var gif = await fs.readFileSync('./lib/media/stickergf.gif', { encoding: "base64" })
368                        await kill.sendImageAsSticker(from, `data:image/gif;base64,${gif.toString('base64')}`)
369                        .catch(() => {
370                            kill.reply(from, 'Aff! la conversion tuvo errores, puede ser el peso de video/gif.', id)
371                        })
372                    })
373                } else {
374                    kill.reply(from, `Encaso de que reciba esto considere 2 opciones.\n\n1 - Esto no es un gif o video.\n\n2 - el gif o video supera los 15 segudnos.`, id)
375                }
376			} else {
377                kill.reply(from, mess.error.St, id)
378            }
379            break
380			
381		case 'upimg':
382            if (isMedia && type === 'image') {
383                const mediaData = await decryptMedia(message, uaOverride)
384                var uplimg = './lib/media/img/imageupl.jpg'
385                await fs.writeFile(uplimg, mediaData)
386				const sdimg = await imgbbUploader("API DO SITE IMGBB", uplimg) // Bote uma api do imgbb pras suas fotos n irem pra minha conta
387				console.log(sdimg.url_viewer)
388				await kill.reply(from, `*OBS!* _Este enlace tiene una duración de 7 días, después de los cuales la imagen se eliminará automáticamente del servidor.._\n\n${sdimg.url_viewer}`, id)
389			} else {
390				await kill.reply(from, 'Amigo, esto solo funciona con imágenes.', id)
391			}
392			break
393			
394			
395        case 'makesticker':
396            if (args.length == 0) return kill.reply(from, 'Faltaba algo para usar como referencia!', id)
397            const stkm = await fetch(`http://api.fdci.se/rep.php?gambar=${body.slice(7)}`)
398			const stimg = await stkm.json()
399            let stkfm = stimg[Math.floor(Math.random() * stimg.length) + 1]
400			console.log(stkfm)
401            await kill.sendStickerfromUrl(from, stkfm)
402			.catch(() => {
403                kill.reply(from, 'No se ha recibido ninguna imagen o el servidor está desconectado, inténtalo más tarde.', id)
404            })
405            break
406			
407			
408		case 'morte':
409		case 'death':
410            if (args.length == 0) return kill.reply(from, 'Ponga un nombre, solo uno, sin apellido ni nombres completos, especialmente por su seguridad!', id)
411			const predea = await axios.get(`https://api.agify.io/?name=${args[0]}`)
412			await kill.reply(from, `Personas con este nombre "${predea.data.name}" tienden a morir en ${predea.data.age} años de edad.`, id)
413			break			
414			
415			
416	    case 'oculto':
417            if (!isGroupMsg) return kill.reply(from, 'Solo grupos!', id)
418            const eur = await kill.getGroupMembers(groupId)
419            const surpresa = eur[Math.floor(Math.random() * eur.length)]
420			console.log(surpresa.id)
421    	    var xvid = ["Negoes branquelos e feministas", `${pushname} afeitarse en la bañera`, `${pushname} comiendo mi culo`, `${pushname} quieres comerme que hacer?`, "lolis nuas e safadas", "Ursinhos Mansos Peludos e excitados", "mae do adm cozida na pressao", "Buceta de 500 cm inflavel da boneca chinesa lolita company", "corno manso batendo uma pra mim com meu rosto na webcam", "tigresa vip da buceta de mel", "belle delphine dando o cuzinho no barzinho da esquina", "fazendo anal no negao", "africanos nus e chupando pau", "anal africano", "comendo a minha tia", "lgbts fazendo ahegao", "adm gostoso tirando a roupa", "gays puxando o intestino pra fora", "Gore de porno de cachorro", "anoes baixinhos do pau grandao", "Anões Gays Dotados Peludos", "anões gays dotados penetradores de botas", "Ursinhos Mansos Peludos", "Jailson Mendes", "Vendo meu Amigo Comer a Esposa", "Golden Shower"]
422            const surpresa2 = xvid[Math.floor(Math.random() * xvid.length)]
423            await kill.sendTextWithMentions(from, `*EQUIPO ❌VIDEOS*\n\n_Querido usuario @${surpresa.id.replace(/@c.us/g, '')} ..._\n\n_Soy de la administración de Xvideos y notamos que no ha iniciado sesión en su cuenta durante más de 2 semanas y decidimos verificar si todo está bien con nuestro usuario más activo.._ \n\n_Desde la última vez que visitó nuestro sitio, ha buscado cientos de veces_ *"${surpresa2}"* _(creemos que es tu favorito), venimos a decir que se agregaron y estamos seguros que te gustará mucho._ \n_Te esperamos allí!_\n\n_Para nuestro usuario favorito, con cariño, Equipo Xvideos._`)
424            await sleep(2000)
425            break
426			
427			
428		case 'gender':
429		case 'genero':
430            if (args.length == 0) return kill.reply(from, 'Ponga un nombre, solo uno, sin apellido ni nombres completos, especialmente por su seguridad!', id)
431			const seanl = await axios.get(`https://api.genderize.io/?name=${args[0]}`)
432			const gender = seanl.data.gender.replace('Femenino', 'Mujeres').replace('Mazculino', 'hombres')
433			await kill.reply(from, `O nombre "${seanl.data.name}" mas usado por ${gender}.`, id)
434			break
435			
436			
437        case 'detector' :
438            if (!isGroupMsg) return kill.reply(from, 'Solo grupos grupos!', id)
439			await kill.reply(from, 'Calculando foto de los participantes del grupo...', id)
440            await sleep(3000)
441            const eu = await kill.getGroupMembers(groupId)
442            const gostosa = eu[Math.floor(Math.random() * eu.length)]
443			console.log(gostosa.id)
444            await kill.sendTextWithMentions(from, `*DETECTOR   DE  GROCERIAS👩‍⚕️*\n\n*pi pi pi pi*  \n*pipipipi🚨🚨🚨pipipipi🚨🚨🚨pipipipi🚨🚨🚨pipi*\n\[email protected]${gostosa.id.replace(/@c.us/g, '')} *ALTO HAÍ🖐*\n\n*A SIDO MULTADO!!*\n\n*1 por no decir buenos días, buenas tardes, buenas noches y otro por ser muy*\n\n*grocero(o)*\n\n*valor de la multa:*\n*FOTO [email protected] AL PRIV kkkkk*`)
445            await sleep(2000)
446            break			
447
448			
449			
450		case 'math':
451            if (args.length == 0) return kill.reply(from, 'No especificaste una cuenta de matemáticas.', id)
452            const mtk = body.slice(6)
453            if (typeof math.evaluate(mtk) !== "number") {
454            kill.reply(from, `¿Incluso abriste una cuenta? No parece eh!.`, id)
455			} else {
456				kill.reply(from, `_La ecuacion:_\n\n*${mtk}*\n\n_Su resultado es:_\n\n*${math.evaluate(mtk)}*`, id)
457			}
458			break
459			
460			
461		case 'inverter':
462            if (args.length == 0) return kill.reply(from, 'No especificó una frase para invertir.', id)
463			const inver = body.slice(10).split('').reverse().join('')
464			await kill.reply(from, inver, id)
465			break
466			
467			
468		case 'contar':
469            if (args.length == 0) return kill.reply(from, 'Esto tiene 0 letras, después de todo, no hay texto.', id)
470			const count = body.slice(8).length
471			await kill.reply(from, `El texto tiene ${count} letras.`, id)
472			break
473			
474			
475        case 'giphy':
476			gark = body.trim().split(/ +/).slice(1)
477			const link = gark.length !== 0 ? gark[0] : ''
478            if (gark.length !== 1) return kill.reply(from, `Ownn, olvidó insertar el enlace?`, id)
479            const isGiphy = link.match(new RegExp(/https?:\/\/(www\.)?giphy.com/, 'gi'))
480            const isMediaGiphy = link.match(new RegExp(/https?:\/\/media.giphy.com\/media/, 'gi'))
481            if (isGiphy) {
482                const getGiphyCode = link.match(new RegExp(/(\/|\-)(?:.(?!(\/|\-)))+$/, 'gi'))
483                if (!getGiphyCode) { return kill.reply(from, '¡Que pena! Su código de descarga está demasiado lejos, pero tal vez si lo intentas de nuevo * solo 1 vez más...*', id) }
484                const giphyCode = getGiphyCode[0].replace(/[-\/]/gi, '')
485                const smallGifUrl = 'https://media.giphy.com/media/' + giphyCode + '/giphy-downsized.gif'
486                kill.sendGiphyAsSticker(from, smallGifUrl)
487                .catch((err) => kill.reply(from, `Un pajarito me dijo que este error está relacionado con el envío del sticker...`, id))
488            } else if (isMediaGiphy) {
489                const gifUrl = link.match(new RegExp(/(giphy|source).(gif|mp4)/, 'gi'))
490                if (!gifUrl) { return kill.reply(from, '¡Que pena! Su código de descarga está demasiado lejos, pero tal vez si lo intentas de nuevo * solo 1 vez más...*', id) }
491                const smallGifUrl = link.replace(gifUrl[0], 'giphy-downsized.gif')
492                kill.sendGiphyAsSticker(from, smallGifUrl)
493                .catch(() => {
494                    kill.reply(from, `Un pajarito me dijo que este error está relacionado con el envío del sticker...`, id)
495                })
496            } else {
497                await kill.reply(from, 'Lo siento, pero solo puedo aceptar enlaces de giphy.', id)
498            }
499            break
500
501
502		case 'msg':
503            if (args.length == 0) return kill.reply(from, 'Olvidaste ingresar un mensaje... e.e', id)
504			await kill.sendText(from, `${body.slice(5)}`)
505			break
506			
507			
508		case 'id':
509			if (!isGroupMsg) return kill.reply(from, mess.error.Gp, id)
510			kill.reply(from, `El ID del grupo es ${groupId}`, id)
511			break
512			
513			
514		case 'onlyadms':
515			onar = body.trim().split(/ +/).slice(1)
516			if (!isGroupMsg) return kill.reply(from, mess.error.Gp, id)
517            if (!isGroupAdmins) return kill.reply(from, mess.error.Ga, id)
518            if (!isBotGroupAdmins) return kill.reply(from, mess.error.Ba, id)
519			if (onar.length !== 1) return kill.reply(from, `Olvidaste encenderlo (ON) o apagarlo [Off].`, id)
520            if (onar[0] == 'on') {
521				kill.setGroupToAdminsOnly(groupId, true).then(() => kill.sendText(from, 'Se cierra el grupo!\nSE ABRIRA EN UNOS MOMENTOS :)'))
522			} else if (onar[0] == 'off') {
523				kill.setGroupToAdminsOnly(groupId, false).then(() => kill.sendText(from, 'Ya pueden escribir gente!! NOMAS NO LLENEN EL CHAT!!🥶'))
524			} else {
525				kill.reply(from, `Olvidaste encenderlo (ON) o apagarlo [Off].`, id)
526			}
527			break
528			
529			
530		case 'legiao':
531			if (isGroupMsg) return kill.reply(from, 'Puede ser que este grupo no permita enlaces, así que use ese comando en el PV, ¿de acuerdo?', id)
532			kill.sendLinkWithAutoPreview(from, 'https://wa.me/+529984907794', 'Genial que te hayas interesado en contactar a samu!\nAqui esta su whats!', id)
533			break
534			
535			
536		case 'revoke':
537			if (!isGroupMsg) return kill.reply(from, mess.error.Gp, id)
538            if (!isGroupAdmins) return kill.reply(from, mess.error.Ga, id)
539            if (!isBotGroupAdmins) return kill.reply(from, mess.error.Ba, id)
540			await kill.revokeGroupInviteLink(groupId).then(() => kill.reply(from, 'Allí se cumplió tu orden! e.e', id))
541			break
542			
543			
544        case 'slogan':
545            if (args.length == 0) return kill.reply(from, 'Donde esta la frase?', id)
546            const slog = await axios.get(`http://api.haipbis.xyz/randomcooltext?text=${body.slice(8)}`)
547			await kill.sendFileFromUrl(from, slog.data.image, slog.data.text, 'Elegante no es?', id)
548            break
549			
550			
551	case 'setimage':
552			if (!isGroupMsg) return kill.reply(from, mess.error.Gp, id)
553            if (!isGroupAdmins) return kill.reply(from, mess.error.Ga, id)
554            if (!isBotGroupAdmins) return kill.reply(from, mess.error.Ba, id)
555			if (isMedia && type == 'image' || isQuotedImage) {
556				const dataMedia = isQuotedImage ? quotedMsg : message
557				const _mimetype = dataMedia.mimetype
558				const mediaData = await decryptMedia(dataMedia, uaOverride)
559				const imageBase64 = `data:${_mimetype};base64,${mediaData.toString('base64')}`
560				const picgp = await kill.getProfilePicFromServer(chat.id)
561				if (picgp == undefined) {
562					var backup = errorurl
563				} else {
564					var backup = picgp
565				}
566				await kill.sendFileFromUrl(from, backup, 'group.png', 'En caso de que cambies de opinión...', id)
567				await kill.setGroupIcon(groupId, imageBase64)
568			} else if (args.length == 1) {
569				if (!isUrl(url)) { await kill.reply(from, '¿Estás seguro de que este es un enlace solo a la foto??', id) }
570				const picgpo = await kill.getProfilePicFromServer(chat.id)
571				if (picgpo == undefined) {
572					var back = errorurl
573				} else {
574					var back = picgpo
575				}
576				await kill.sendFileFromUrl(from, back, 'group.png', 'En caso de que cambies de opinión...', id)
577				kill.setGroupIconByUrl(groupId, url).then((r) => (!r && r !== undefined)
578				? kill.reply(from, 'Eso es lo que pensé, no hay fotos en este enlace o el enlace contiene demasiadas fotos.', id)
579				: kill.reply(from, '¡Eso! Ahora el grupo tiene una nueva cara jaja!', id))
580			} else {
581				kill.reply(from, `Acho que você esta usando errado em!`)
582			}
583			break			
584
585			
586		case 'img':
587            if (quotedMsg && quotedMsg.type == 'sticker') {
588                const mediaData = await decryptMedia(quotedMsg)
589                kill.reply(from, `Podrias esperar porfavor? esto lleva un poco de tiempo👑`, id)
590                const stickerImage = `data:${quotedMsg.mimetype};base64,${mediaData.toString('base64')}`
591                await kill.sendFile(from, stickerImage, '', 'Disfruta, aquí tienes tu foto! :D', id)
592			} else if (!quotedMsg) return kill.reply(from, `Lo siento, esto es solo para stickers...`, id)
593			break	
594
595
596        case 'randomanime':
597            const matn = Math.floor(Math.random() * 3) + 1
598            if (matn == 1) {
599            const nime = await axios.get(`http://api.i-tech.id/anim/anime?key=${techapi}`)
600			console.log(nime.data)
601			await kill.sendFileFromUrl(from, nime.data.result, ``, `Veo que eres un hombre / mujer de cultura.`, id)
602            } else if (matn == 2) {
603            const nime2 = await randomNimek('anime')
604			console.log(nime2.data)
605            await kill.sendFileFromUrl(from, nime2, ``, 'Ui Ui...', id)
606            } else if (matn == 3) {
607            const nime3 = await axios.get(`http://api.i-tech.id/anim/anime2?key=${techapi}`)
608			console.log(nime3.data)
609            await kill.sendFileFromUrl(from, nime3.data.result, ``, `Hermoso anime...`, id)
610			}
611            break
612
613
614        case 'frase':
615            const quote = Math.floor(Math.random() * 3) + 1
616            if (quote == 1) {
617            const quote1 = await axios.get(`http://api.i-tech.id/anim/quotes?key=${techapi}`)
618			console.log(quote1.data)
619			const quota = quote1.data.quotes
620			kill.reply(from, mess.wait, id)
621			await sleep(5000)
622            translate(quota, 'pt')
623                .then((quoted) => kill.reply(from, `➸ *Frase* : ${quoted}\n➸ *Personaje* : ${quote1.data.character}\n➸ *Anime* : ${quote1.data.anime}`, id))
624            } else if (quote == 2) {
625            const skya = await get.get('http://mhankbarbars.herokuapp.com/api/quotesnime/random').json() 
626            skya_ = skya.data
627			const quot = skya.data.quote
628			kill.reply(from, mess.wait, id)
629			await sleep(5000)
630            translate(quot, 'pt')
631                .then((quote) => kill.reply(from, `➸ *Frase* : ${quote}\n➸ *Personaje* : ${skya_.chara}\n➸ *Anime* : ${skya_.anime}`, id))
632			} else if (quote == 3) {
633			const aiquote = await axios.get("http://inspirobot.me/api?generate=true")
634            await kill.sendFileFromUrl(from, aiquote.data, 'quote.jpg', '~No entendí nada, pero sigamos el juego...~\n\n❤️' , id )
635			}
636            break
637
638
639        case 'make':
640            if (args.length == 0) return kill.reply(from, `Debes ingresar una frase después del comando.`, id)
641            const nulisq = body.slice(6)
642            const nulisp = await tulis(nulisq)
643            await kill.sendImage(from, `${nulisp}`, '', 'Hermoso diario amigo...', id)
644            .catch(() => {
645                kill.reply(from, 'Qué pena, la imagen no quiso enviarse o el servidor denegó el acceso...', id)
646            })
647            break
648
649
650        case 'neko':
651            const nekol = Math.floor(Math.random() * 7) + 1
652            if (nekol == 1) {
653				const neko1 = await axios.get(`http://api.i-tech.id/anim/neko?key=${techapi}`)
654				await kill.sendFileFromUrl(from, neko1.data.result, ``, `Uma neko as vezes vai bem...`, id)
655            } else if (nekol == 2) {
656				const neko2 = await axios.get(`http://api.i-tech.id/anim/neko2?key=${techapi}`)
657				await kill.sendFileFromUrl(from, neko2.data.result, ``, `Vejo que você é um homem/mulher de cultura.`, id)
658            } else if (nekol == 3) {
659				const neko3 = await get.get('http://mhankbarbars.herokuapp.com/api/nekonime').json()
660				await kill.sendFileFromUrl(from, neko3.result, ``, `Que fofa...`, id)
661            } else if (nekol == 4) {
662				const neko4 = await axios.get(`https://nekos.life/api/v2/img/neko`)
663				await kill.sendFileFromUrl(from, neko4.data.url, ``, `Nekooo`, id)
664            } else if (nekol == 5) {
665				const neko5 = await axios.get(`https://nekos.life/api/v2/img/ngif`)
666				await kill.sendFileFromUrl(from, neko5.data.url, ``, `Nekooo`, id)
667            } else if (nekol == 6) {
668				const neko6 = await axios.get(`https://nekos.life/api/v2/img/fox_girl`)
669				await kill.sendFileFromUrl(from, neko6.data.url, ``, `Nekooo`, id)
670            } else if (nekol == 7) {
671				const neko7 = await axios.get(`https://nekos.life/api/v2/img/kemonomimi`)
672				await kill.sendFileFromUrl(from, neko7.data.url, ``, `Nekoooo chann`, id)
673			}
674            break
675
676
677        case 'char':
678            const char = await axios.get(`http://api.i-tech.id/anim/wibu?key=${techapi}`)
679			var chara = char.data.deskripsi
680			console.log(chara)
681			kill.reply(from, mess.wait, id)
682			await sleep(5000)
683			translate(chara, 'pt')
684                .then((reschar) => kill.sendFileFromUrl(from, `${char.data.foto}`, ``, `Nome: ${char.data.nama}\n\nDescrição: ${reschar}\n\nFonte: ${char.data.sumber}`, id))
685            break
686
687
688        case 'image':
689            if (args.length == 0) return kill.reply(from, 'Falta un nombre!', id)
690            const linp = await fetch(`http://api.fdci.se/rep.php?gambar=${body.slice(7)}`)
691			const pint = await linp.json()
692            let erest = pint[Math.floor(Math.random() * pint.length) + 1]
693			console.log(erest)
694            await kill.sendFileFromUrl(from, erest, '', 'Fueron muchos pero espero que les guste la imagen que elegí ^^!', id)
695			.catch(() => {
696                kill.reply(from, 'No se ha recibido ninguna imagen o el servidor está desconectado, inténtalo más tarde.', id)
697            })
698            break
699			
700			
701        case 'yaoi':
702            const yam = await fetch(`http://api.fdci.se/rep.php?gambar=yaoi`)
703			const yaoi = await yam.json()
704            let flyaoi = yaoi[Math.floor(Math.random() * yaoi.length) + 1]
705            await kill.sendFileFromUrl(from, flyaoi, '', 'Tururu...', id)
706			.catch(() => {
707                kill.reply(from, 'No se ha recibido ninguna imagen o el servidor está desconectado, inténtalo más tarde.', id)
708            })
709            break
710
711
712        case 'life': 
713            const dia = await axios.get(`https://docs-jojo.herokuapp.com/api/fml`)
714			var acon = dia.data.result.fml
715            await sleep(5000)
716            translate(acon, 'pt')
717                .then((lfts) => kill.reply(from, lfts, id))
718			break
719
720
721        case 'name':
722            if (args.length == 0) return kill.reply(from, 'Falto un nombre!', id)
723            const names = await axios.get(`https://api.i-tech.id/tools/arti?key=${techapi}&nama=${body.slice(6)}`)
724			var sign = names.data.arti
725			kill.reply(from, mess.wait, id)
726			await sleep(5000)
727            translate(sign, 'pt')
728                .then((cado) => kill.reply(from, cado, id))
729			break
730
731
732        case 'fox':
733            const fox = await axios.get(`http://api.i-tech.id/tools/foxes?key=${techapi}`)
734			await kill.sendFileFromUrl(from, fox.data.result, ``, 'Que lindo zorro <3', id)
735			break
736
737
738        case 'goat':
739            const goat = await axios.get(`https://api.i-tech.id/tools/goat?key=${techapi}`)
740			await kill.sendFileFromUrl(from, goat.data.result, ``, 'Nada mejor que una cabra ... cierto?', id)
741			break
742
743
744        case 'wiki':
745            if (args.length == 0) return kill.reply(from, 'Por favor escriba correctamente.', id)
746            const wiki = await axios.get(`https://docs-jojo.herokuapp.com/api/wiki?q=${body.slice(6)}`)
747			var wikit = wiki.data.result
748			console.log(wikit)
749			kill.reply(from, mess.wait, id)
750			await sleep(5000)
751            translate(wikit, 'pt')
752                .then((resulta) => kill.reply(from, resulta, id))
753            break
754
755
756        case 'chord':
757            if (args.length == 0) return kill.reply(from, 'Olvidé el nombre de la canción?', id)
758            const ch = await axios.get(`https://api.i-tech.id/tools/chord?key=${techapi}&query=${body.slice(7)}`)
759            await kill.reply(from, ch.data.result, id)
760            break
761			
762			
763        case 'nasa':
764            const nasa = await axios.get(`https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY`)
765			console.log(nasa.data)
766			await kill.sendFileFromUrl(from, `${nasa.data.url}`, '', `Titulo: ${nasa.data.title}\n\nData: ${nasa.data.date}\n\nAutor: ${nasa.data.copyright}\n\nMateria: ${nasa.data.explanation}`, id)
767			.catch(() => {
768						kill.reply(from, `Titulo: ${nasa.data.title}\n\nData: ${nasa.data.date}\n\nAutor: ${nasa.data.copyright}\n\nMateria: ${nasa.data.explanation}\n\nURL: ${nasa.data.url}`, id)
769					})
770			break
771			
772	case 'stalkig':
773            if (args.length == 0) return kill.reply(from, 'Nombre de usuario?', id)
774            const ig = await axios.get(`http://arugaz.my.id/api/media/stalkig?user=${body.slice(9)}`)
775			var insta = ig.data.result.biography
776            await kill.sendFileFromUrl(from, `${ig.data.result.profile_picture}`, ``, `Username: ${ig.data.result.username}\n\nNombre: ${ig.data.result.fullname}\n\nbio: ${insta}\n\nSeguidores: ${ig.data.result.followers}\n\nSigiendo: ${ig.data.followings}`, id)
777            break
778			
779
780        case 'stalktw':
781            if (args.length == 0) return kill.reply(from, 'Nombre de usuario?', id)
782            const tw = await axios.get(`http://arugaz.my.id/api/media/stalktwitt?user=${body.slice(9)}`)
783			var insta = tw.data.result.biography
784            await kill.sendFileFromUrl(from, `${tw.data.result.profile_picture}`, ``, `Username: ${tw.data.result.username}\n\nNombre: ${tw.data.result.fullname}\n\nbio: ${insta}\n\nSeguidores: ${tw.data.result.followers}\n\nSigiendo: ${tw.data.followings}`, id)
785            break
786		
787
788	case 'twit':
789            if (args.length == 0) return kill.reply(from, 'Enlace caido?', id)
790            const twi = await axios.get(`http://arugaz.my.id/api/media/twvid?url=${body.slice(4)}`)
791			await kill.sendFileFromUrl(from, twi.data.result.videos, ``, 'É um otimo video haha!\n~Mas o que diabos foi isso...~', id)
792			.catch(() => {
793						kill.reply(from, 'Ess no, impidieron my acceso!\nLo siento!', id)
794					})
795            break
796
797       case 'ig':
798            if (args.length == 0) return kill.reply(from, 'El enlace no es valido?', id)
799            const iga = await axios.get(`http://api.i-tech.id/dl/igdl?key=${techapi}&link=${body.slice(11)}`)
800			await kill.sendFileFromUrl(from, iga.data.result, ``, 'Es un gran video jaja!\n~Pero que diablos fue eso...~', id)
801			.catch(() => {
802						kill.reply(from, '¡Esa no! Impidieron mi acceso!!', id)
803					})
804            break
805			
806		case 'fb':
807			if (args.length == 0) return kill.reply(from, 'Olvidaste insertar un enlace de facebook?', id)
808            const fb = await axios.get(`http://arugaz.herokuapp.com/api/fb?url=${body.slice(4)}`)
809			const fbdw = fb.data.result.sd
810            await kill.sendFileFromUrl(from, fbdw, 'video.mp4', 'Excelente video!\n~Pero que diablos paso?...~', id)
811			.catch(() => {
812						kill.reply(from, 'Dios mío, algún tipo de fuerza maligna me impidió terminar el comando!', id)
813					})
814            break
815
816			
817
818         case 'mp3': // eu censurei o acesso pois as apis estão offlines, e fazer isso evita que usem o comando e te de problemas
819             if (args.length == 0) return kill.reply(from, 'Lo uso incorrectamente.', id)
820            axios.get(`http://arugaz.my.id/api/media/ytaudio?url=${body.slice(5)}`)
821            .then(async(rest) => {
822					var m3pa = rest.data.infourl
823					await kill.sendFileFromUrl(from, m3pa, '', '', id)
824                })
825			break
826
827
828        case 'mp4':
829           if (args.length == 0) return kill.reply(from, 'Lo uso incorretamente.', id)
830            axios.get(`http://arugaz.my.id/api/media/ytvideo?url=${body.slice(5)}`)
831            .then(async(rest) => {
832					var mp4 = rest.data.infourl
833					await kill.sendFileFromUrl(from, mp4, `video.mp4`, tmp4, id)
834                })
835			break
836			
837        case 'video':
838            if (args.length == 0) return kill.reply(from, 'Lo uso incorrectamente.', id)
839            axios.get(`https://arugaz.my.id/api/media/ytsearch?query=${body.slice(7)}`)
840            .then(async (res) => {
841				const vyre = res.data.result[0].uploadDate
842				if (vyre == '' || vyre == 'null' || vyre == null || vyre == undefined || vyre == 'undefined') {
843					var videore = 'Indefinido'
844				} else if (vyre.endsWith('years ago')) {
845                    var videore = vyre.replace('years ago', 'Anos atrás')
846				} else if (vyre.endsWith('hours ago')) {
847                    var videore = vyre.replace('hours ago', 'Horas atrás')
848				} else if (vyre.endsWith('minutes ago')) {
849                    var videore = vyre.replace('minutes ago', 'Minutos atrás')
850				} else if (vyre.endsWith('day ago')) {
851                    var videore = vyre.replace('day ago', 'Dia atrás')
852				} else if (vyre.endsWith('months ago')) {
853                    var videore = vyre.replace('months ago', 'Meses atrás')
854				} else if (vyre.endsWith('seconds ago')) {
855                    var videore = vyre.replace('seconds ago', 'Segundos atrás')
856				}
857				const size = await axios.get(`http://st4rz.herokuapp.com/api/ytv?url=http://youtu.be/${res.data.result[0].id}`)
858				const fsize = size.data.filesize.replace(' MB', '').replace('Download  ', 'Imposible calcular')
859				console.log(fsize)
860				const impo = size.data.filesize.replace('Download  ', 'un peso que no puedo calcular')
861				if (fsize >= 16.0 || size.data.filesize.endsWith('Download  ') || size.data.filesize.endsWith('GB')) {
862					kill.reply(from, `Desculpe, para evitar banimentos do WhatsApp, o limite de envio de videos é de 16MB, e esse possui ${impo.replace('    ', ' ')}.`, id)
863				} else {
864					await kill.sendFileFromUrl(from, `${res.data.result[0].thumbnail}`, ``, `Titulo: ${res.data.result[0].title}\n\nDuracion: ${res.data.result[0].duration} segundos\n\nHace: ${videore}\n\nVisualizaciones: ${res.data.result[0].viewCount}\n\nPeso: ${size.data.filesize}\n\nEspero averlo echo bien, ahora solo espera que tu video se envie, NO UTILIZES ESTE COMANDO HASTA QUE EL PROCESO TERMINE!!`, id)
865					console.log(res.data.result[0].title)
866					axios.get(`http://st4rz.herokuapp.com/api/ytv2?url=https://youtu.be/${res.data.result[0].id}`)
867					.then(async(rest) => {
868						var mp4 = rest.data.result
869						var tmp4 = rest.data.title
870						await kill.sendFileFromUrl(from, mp4, `video.mp4`, tmp4, id)
871					})
872				}
873			})
874            break
875			
876
877        case 'play':
878            if (args.length == 0) return kill.reply(from, 'Lo uso incorretamente.', id)
879            axios.get(`https://arugaz.my.id/api/media/ytsearch?query=${body.slice(6)}`)
880            .then(async (res) => {
881				const pyre = res.data.result[0].uploadDate
882				if (pyre == '' || pyre == 'null' || pyre == null || pyre == undefined || pyre == 'undefined') {
883					var playre = 'Indefinido'
884				} else if (pyre.endsWith('years ago')) {
885                    var playre = pyre.replace('years ago', 'Anos atrás')
886				} else if (pyre.endsWith('hours ago')) {
887                    var playre = pyre.replace('hours ago', 'Horas atrás')
888				} else if (pyre.endsWith('minutes ago')) {
889                    var playre = pyre.replace('minutes ago', 'Minutos atrás')
890				} else if (pyre.endsWith('day ago')) {
891                    var playre = pyre.replace('day ago', 'Dia atrás')
892				} else if (pyre.endsWith('months ago')) {
893                    var playre = pyre.replace('months ago', 'Meses atrás')
894				} else if (pyre.endsWith('seconds ago')) {
895                    var playre = pyre.replace('seconds ago', 'Segundos atrás')
896				}
897				const asize = await axios.get(`http://st4rz.herokuapp.com/api/yta?url=http://youtu.be/${res.data.result[0].id}`)
898				const afsize = asize.data.filesize.replace(' MB', '')
899				console.log(afsize)
900				if (afsize >= 16.0 || asize.data.filesize.endsWith('GB')) {
901					kill.reply(from, `Lo sentimos, para evitar prohibiciones de WhatsApp, el límite de envío de audio es de 16 MB, y esto tiene ${asize.data.filesize}.`, id)
902				} else {
903					await kill.sendFileFromUrl(from, `${res.data.result[0].thumbnail}`, ``, `Titulo: ${res.data.result[0].title}\n\nDuracion: ${res.data.result[0].duration} segundos\n\nHace: ${playre}\n\nVisualizaciones: ${res.data.result[0].viewCount}\n\nEspero averlo echo bien, ahora solo espera que tu video se envie, NO UTILIZES ESTE COMANDO HASTA QUE EL PROCESO TERMINE!!`, id)
904					console.log(res.data.result[0].title)
905					axios.get(`http://st4rz.herokuapp.com/api/yta2?url=http://youtu.be/${res.data.result[0].id}`)
906					.then(async(rest) => {
907						var m3pa = rest.data.result
908						var m3ti = rest.data.title
909						await kill.sendFileFromUrl(from, m3pa, '', '', id)
910					})
911				}
912			})
913            break
914			
915
916		case 'qr':
917			const qrco = body.slice(4)
918			await kill.sendFileFromUrl(from, `https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${qrco}`, '', 'Su mensaje fue insertado en este QRCode, disfrute.\n\nBy SAMU330 - Íris.', id)
919			break
920
921
922		case 'send':
923			if (args.length == 0) return kill.reply(from, 'Olvidaste poner un enlace de imagen jaja!', id)
924			const file = body.slice(6)
925			if (file.endsWith('.jpg')) {
926				await kill.sendFileFromUrl(from, file, '', '', id)
927				.catch(() => {
928					kill.reply(from, '¡Ah! Esto no parece ser una imagen o puede ser más grande de lo esperado...', id)
929				})
930			} else if (file.endsWith('.png')) {
931				await kill.sendFileFromUrl(from, file, '', '', id)
932				.catch(() => {
933					kill.reply(from, '¡Ah! Esto no parece ser una imagen o puede ser más grande de lo esperado...', id)
934				})
935            } else {
936                kill.reply(from, 'Lo sentimos, solo se permiten fotos, exclusivamente .jpg e .png ^^', id)
937            }
938			break
939			
940			
941        case 'quote':
942		    arks = body.trim().split(/ +/).slice(1)
943            ark = body.trim().substring(body.indexOf(' ') + 1)
944            if (arks.length >= 1) {
945                const quotes = ark.split('|')[0]
946                const qauth = ark.split('|')[1]
947                kill.reply(from, '¡Entendido! Espere a que se complete el comando!', id)
948                const quoteimg = await kill.quote(quotes, qauth)
949				console.log(quoteimg)
950                await kill.sendFileFromUrl(from, quoteimg, '', 'Completo.', id)
951                .catch(() => {
952					kill.reply(from, '¡Guauu! Parece que me negaron subir la foto....', id)
953				})
954            } else {
955                kill.reply(from, `Realmente lo estás usando correctamente?`)
956            }
957            break		
958
959
960       case 'translate':
961            if (args.length != 1) return kill.reply(from, `Esto es demasiado pequeño para traducirlo...`, id)
962            if (!quotedMsg) return kill.reply(from, `Olvidaste marcar el mensaje para traducir.`, id)
963            const quoteText = quotedMsg.type == 'chat' ? quotedMsg.body : quotedMsg.type == 'image' ? quotedMsg.caption : ''
964			kill.reply(from, mess.wait, id)
965			await sleep(5000)
966            translate(quoteText, args[0])
967                .then((result) => kill.reply(from, result, id))
968                .catch(() => kill.reply(from, 'Bloqueo de IP de Google o error de traducción...'))
969            break
970			
971        case 'tts':
972            if (args.length == 0) return kill.reply(from, `Texto a voz */tts* (idioma) (texto), para ver los diomas usa */idiomas*`)
973            const ttsGB = require('node-gtts')(args[0])
974            const dataText = body.slice(8)
975                if (dataText === '') return kill.reply(from, 'Y el texto..?', id)
976                try {
977                    ttsGB.save('./media/tts.mp3', dataText, function () {
978                    kill.sendPtt(from, './media/tts.mp3', id)
979                    })
980                } catch (err) {
981                    kill.reply(from, err, id)
982                }
983            break
984
985        case 'idiomas':
986            kill.sendText(from, lang, id)
987            break
988			
989			
990		case 'resposta':
991			if (args.length == 0) return kill.reply(from, 'Falta una frase para agregar.', id)
992			fs.appendFile('./lib/reply.txt', `\n${body.slice(10)}`)
993			await kill.reply(from, 'Frase agregada a Iris.', id)
994			break
995
996
997        case 'speak':
998			const sppt = require('node-gtts')('pt-br')
999			try {
1000				const spiris = await axios.get(`http://simsumi.herokuapp.com/api?text=${body.slice(7)}&lang=pt`)
1001				const a = spiris.data.success
1002				if (a == '') {
1003					console.log('Request falhou, fallo usando respuestas locales...')
1004					let rfua = fs.readFileSync('./lib/reply.txt').toString().split('\n')
1005					let repy = rfua[Math.floor(Math.random() * rfua.length)]
1006					let resfl = repy.replace('%name$', '${name}').replace('%battery%', '${lvpc}')
1007					console.log(resfl)
1008					sppt.save('./lib/media/tts/resPtm.mp3', resfl, function () {
1009					kill.sendPtt(from, './lib/media/tts/resPtm.mp3', id)
1010					})		
1011				} else {
1012					sppt.save('./lib/media/tts/resPtm.mp3', a, function () {
1013						kill.sendPtt(from, './lib/media/tts/resPtm.mp3', id)
1014					})
1015				}
1016			} catch (error) {
1017					console.log('Request falhou, usando respostas locais...')
1018					let rfua = fs.readFileSync('./lib/reply.txt').toString().split('\n')
1019					let repy = rfua[Math.floor(Math.random() * rfua.length)]
1020					let resfl = repy.replace('%name$', '${name}').replace('%battery%', '${lvpc}')
1021					console.log(resfl)
1022					sppt.save('./lib/media/tts/resPtm.mp3', resfl, function () {
1023					kill.sendPtt(from, './lib/media/tts/resPtm.mp3', id)
1024					})
1025			}
1026			break
1027			
1028
1029        case 'iris':
1030			try {
1031				const iris = await axios.get(`http://simsumi.herokuapp.com/api?text=${body.slice(6)}&lang=pt`)
1032				if (iris.data.success == '') {
1033					console.log('Request falhou, usando respostas locais...')
1034					let rndrl = fs.readFileSync('./lib/reply.txt').toString().split('\n')
1035					let repl = rndrl[Math.floor(Math.random() * rndrl.length)]
1036					let resmf = repl.replace('%name$', `${name}`).replace('%battery%', `${lvpc}`)
1037					console.log(resmf)
1038					kill.reply(from, resmf, id)
1039				} else {
1040					await kill.reply(from, iris.data.success, id)
1041				}
1042			} catch (error) {
1043					console.log('Request falhou, usando respostas locais...')
1044					let rndrl = fs.readFileSync('./lib/reply.txt').toString().split('\n')
1045					let repl = rndrl[Math.floor(Math.random() * rndrl.length)]
1046					let resmf = repl.replace('%name$', `${name}`).replace('%battery%', `${lvpc}`)
1047					console.log(resmf)
1048					kill.reply(from, resmf, id)
1049			}
1050			break
1051
1052
1053        case 'wallpaper':
1054            if (args.length == 0) return kill.reply(from, 'Necesitas decirme que quieres de fondo de pantalla!', id)
1055            const quere = body.slice(6)
1056            const wallp = await wall(quere)
1057            console.log(wallp)
1058            await kill.sendFileFromUrl(from, wallp, 'wallp.jpg', '', id)
1059            break
1060
1061
1062        case 'ping':
1063            kill.sendText(from, `Pong! xd\n_Mi velocidad de respuesta es de ${processTime(t, moment())} segundos._`)
1064            break
1065
1066
1067        case 'criador':
1068            kill.sendContact(from, 'wa.me/+529984907794')
1069			kill.reply(from, 'Si no responde, solo espera, es raro que deje Internet ~Smitten guy sabe~, pero si sucedió, fue algo importante..', id)
1070            break
1071
1072
1073        case 'donate':
1074		case 'doar':
1075            kill.sendText(from, donate, id)
1076            kill.sendContact(from, 'wa.me/+529984907794')
1077            break
1078
1079
1080        case 'roll':
1081            const dice = Math.floor(Math.random() * 6) + 1
1082            await kill.sendStickerfromUrl(from, 'https://www.random.org/dice/dice' + dice + '.png')
1083            break
1084
1085
1086        case 'flip':
1087            const side = Math.floor(Math.random() * 2) + 1
1088            if (side == 1) {
1089               kill.sendStickerfromUrl(from, 'https://i.ibb.co/LJjkVK5/heads.png')
1090            } else {
1091               kill.sendStickerfromUrl(from, 'https://i.ibb.co/wNnZ4QD/tails.png')
1092            }
1093            break
1094
1095
1096       case 'poll':
1097            feature.getpoll(kill, message, pollfile, voterslistfile)
1098            break    
1099
1100
1101       case 'vote' :
1102            feature.voteadapter(kill, message, pollfile, voterslistfile)
1103            break
1104
1105
1106       case 'newpoll':
1107            feature.adminpollreset(kill, message, message.body.slice(9), pollfile, voterslistfile)
1108            break
1109
1110
1111       case 'ins': 
1112            feature.addcandidate(kill, message, message.body.slice(5), pollfile, voterslistfile)
1113            break
1114
1115
1116        case 'nsfw':
1117       	    const isGroupOwner = sender.id === chat.groupMetadata.owner
1118            if (args.length !== 1) return kill.reply(from, 'Establecer habilitar o deshabilitar', id)
1119			if (isGroupMsg) {
1120				if (args[0].toLowerCase() == 'enable') {
1121					nsfw_.push(chat.id)
1122					fs.writeFileSync('./lib/NSFW.json', JSON.stringify(nsfw_))
1123					kill.reply(from, 'Comandos NSFW activados en este grupo!', id)
1124				} else if (args[0].toLowerCase() == 'disable') {
1125					nsfw_.splice(chat.id, 1)
1126					fs.writeFileSync('./lib/NSFW.json', JSON.stringify(nsfw_))
1127					kill.reply(from, 'Comandos nsfw desactivamos para este grupo.', id)
1128				} else {
1129					kill.reply(from, 'Establecer habilitar o deshabilitar', id)
1130				}
1131			} else if (isGroupMsg) {
1132				if (args[0].toLowerCase() == 'enable') {
1133					nsfw_.push(chat.id)
1134					fs.writeFileSync('./lib/NSFW.json', JSON.stringify(nsfw_))
1135					kill.reply(from, 'Comandos NSFW activados en este grupo!', id)
1136				} else if (args[0].toLowerCase() == 'disable') {
1137					nsfw_.splice(chat.id, 1)
1138					fs.writeFileSync('./lib/NSFW.json', JSON.stringify(nsfw_))
1139					kill.reply(from, 'Comandos nsfw desactivamos para este grupo.', id)
1140				} else {
1141					kill.reply(from, 'Establecer habilitar o deshabilitar', id)
1142				}
1143			} else if (isGroupMsg) {
1144				await kill.reply(from, 'Lo sentimos, solo los administradores pueden usar este comando...', id)
1145			} else {
1146				await kill.reply(from, 'Este comando solo se puede usar en grupos!', id)
1147			}
1148            break
1149
1150
1151        case 'welcome':
1152			if (!isGroupMsg) return kill.reply(from, mess.error.Gp, id)
1153            if (args.length !== 1) return kill.reply(from, 'Olvidaste ponerlo (ON) o quitarlo [off].', id)
1154			if (args[0] == 'on') {
1155                welkom.push(chat.id)
1156                fs.writeFileSync('./lib/welcome.json', JSON.stringify(welkom))
1157                kill.reply(from, '¡Hecho! Se han activado las funciones Bienvenida y Adiós.', id)
1158			} else if (args[0] == 'off') {
1159				let welcom = welcome.indexOf(chatId)
1160                welkom.splice(welcom, 1)
1161                fs.writeFileSync('./lib/welcome.json', JSON.stringify(welkom))
1162                kill.reply(from, 'Entendido! Desactive las opciones de Bienvenida y Adiós.', id)
1163            } else {
1164                kill.reply(from, 'Olvidaste ponerlo (ON) o quitarlo [off].', id)
1165            }
1166            break
1167			
1168			
1169		case 'macaco':
1170			var item = ["macaco", "gorila", "chimpanzé", "orangotango", "babuino"]
1171    	    var esco = item[Math.floor(Math.random() * item.length)]
1172			console.log(esco)
1173			var maca = "https://api.fdci.se/rep.php?gambar=" + esco
1174			axios.get(maca)
1175			    .then((result) => {
1176				var mon = JSON.parse(JSON.stringify(result.data))
1177				var nkey = mon[Math.floor(Math.random() * mon.length)]
1178              	kill.sendFileFromUrl(from, nkey, "", "Saludos soy el dios mono y vine a bendecir:v", id)
1179			})
1180			break
1181			
1182			
1183		case 'ball':
1184			const ball = await axios.get('https://nekos.life/api/v2/img/8ball')
1185			await kill.sendFileFromUrl(from, ball.data.url, '', '', id)
1186			break
1187			
1188			
1189		case 'cafune':
1190			if (double == 1) {
1191				const cfne = await axios.get('https://nekos.life/api/v2/img/pat')
1192				await kill.sendFileFromUrl(from, cfne.data.url, '', '', id)
1193			} else if (double == 2) {
1194				const cfne = await axios.get('https://nekos.life/api/v2/img/cuddle')
1195				await kill.sendFileFromUrl(from, cfne.data.url, '', '', id)
1196			}
1197			break			
1198			
1199			
1200		case 'quack':
1201			const patu = await axios.get('https://nekos.life/api/v2/img/goose')
1202			await kill.sendFileFromUrl(from, patu.data.url, '', '', id)
1203			break
1204			
1205
1206		case 'poke':
1207			const teco = await axios.get('https://nekos.life/api/v2/img/poke')
1208			await kill.sendFileFromUrl(from, teco.data.url, '', '', id)
1209			break
1210			
1211
1212		case 'cocegas':
1213			const cocegas = await axios.get('https://nekos.life/api/v2/img/tickle')
1214			await kill.sendFileFromUrl(from, cocegas.data.url, '', '', id)
1215			break
1216			
1217			
1218		case 'feed':
1219			const feed = await axios.get('https://nekos.life/api/v2/img/tickle')
1220			await kill.sendFileFromUrl(from, feed.data.url, '', '', id)
1221			break
1222			
1223			
1224		case 'baka':
1225			const baka = await axios.get('https://nekos.life/api/v2/img/baka')
1226			await kill.sendFileFromUrl(from, baka.data.url, '', '', id)
1227			break
1228			
1229			
1230		case 'lizard':
1231		case 'lagarto':
1232			const lizard = await axios.get('https://nekos.life/api/v2/img/lizard')
1233			await kill.sendFileFromUrl(from, lizard.data.url, '', '', id)
1234			break
1235			
1236
1237        case 'google':
1238            if (args.length == 0) return kill.reply(from, `Digite algo para buscar.`, id)
1239		    const googleQuery = body.slice(8)
1240            google({ 'query': googleQuery }).then(results => {
1241            let vars = `_*Resultados de búsqueda de Google para: ${googleQuery}*_\n`
1242            for (let i = 0; i < results.length; i++) {
1243                vars +=  `\n═════════════════\n*Titulo >* ${results[i].title}\n\n*Descripcion >* ${results[i].snippet}\n\n*Link >* ${results[i].link}`
1244            }
1245                kill.reply(from, vars, id)
1246            }).catch(e => {
1247                kill.reply(from, 'Error al buscar en google.', id)
1248            })
1249            break
1250			
1251			
1252        case 'boy':
1253    	    var hite = ["eboy", "garoto", "homem", "men", "garoto oriental", "japanese men", "pretty guy", "homem bonito"];
1254    	    var hesc = hite[Math.floor(Math.random() * hite.length)];
1255			var men = "https://api.fdci.se/rep.php?gambar=" + hesc;
1256			axios.get(men)
1257            	.then((result) => {
1258				var h = JSON.parse(JSON.stringify(result.data));
1259				var cewek =  h[Math.floor(Math.random() * h.length)];
1260              	kill.sendFileFromUrl(from, cewek, "result.jpg", "Homens...", id)
1261			})
1262			break
1263			
1264
1265        case 'girl':
1266    	    var items = ["garota adolescente", "saycay", "alina nikitina", "belle delphine", "teen girl", "teen cute", "japanese girl", "garota bonita oriental", "oriental girl", "korean girl", "chinese girl", "e-girl", "teen egirl", "brazilian teen girl", "pretty teen girl", "korean teen girl", "garota adolescente bonita", "menina adolescente bonita", "egirl", "cute girl"];
1267    	    var cewe = items[Math.floor(Math.random() * items.length)];
1268			console.log(cewe)
1269			var girl = "https://api.fdci.se/rep.php?gambar=" + cewe;
1270			axios.get(girl)
1271            	.then((result) => {
1272				var b = JSON.parse(JSON.stringify(result.data));
1273				var cewek =  b[Math.floor(Math.random() * b.length)];
1274              	kill.sendFileFromUrl(from, cewek, "result.jpg", "UUUU pero que linda no?", id)
1275			})
1276			break
1277
1278
1279	case 'mod':
1280            if (args.length == 0) return kill.reply(from, 'Ingrese un nombre para buscar!', id)
1281            try {
1282                const moddroid = await axios.get('https://tobz-api.herokuapp.com/api/moddroid?q=' + body.slice(10)  + '&apikey=BotWeA')
1283                if (moddroid.data.error) return kill.reply(from, moddroid.data.error, id)
1284                const modo = moddroid.data.result[0]
1285                const resmod = `• *Titulo* : ${modo.title}\n\n• *Quien lo creo* : ${modo.publisher}\n\n• *Peso* : ${modo.size}\n\n• *MOD* : ${modo.mod_info}\n\n• *Version* : ${modo.latest_version}\n\n• *Genero* : ${modo.genre}\n\n• *Link* : ${modo.link}\n\n• *Download* : ${modo.download}`
1286                kill.sendFileFromUrl(from, modo.image, 'MODDROID.jpg', resmod, id)
1287            } catch (err) {
1288                console.log(err)
1289            }
1290            break
1291			
1292	case 'happymod':
1293            if (args.length == 0) return kill.reply(from, 'Ingrese un nombre para buscar!', id)
1294            try {
1295                const happymod = await axios.get('https://tobz-api.herokuapp.com/api/happymod?q=' + body.slice(10)  + '&apikey=BotWeA')
1296                if (happymod.data.error) return kill.reply(from, happymod.data.error, id)
1297                const modo = happymod.data.result[0]
1298                const resmod = `• *Titulo* : ${modo.title}\n\n• *Compra* : ${modo.purchase}\n\n• *Peso* : ${modo.size}\n\n• *Root* : ${modo.root}\n\n• *Version* : ${modo.version}\n\n• *Precio* : ${modo.price}\n\n• *Link* : ${modo.link}\n\n• *Download* : ${modo.download}`
1299                kill.sendFileFromUrl(from, modo.image, 'HAPPYMOD.jpg', resmod, id)
1300            } catch (err) {
1301                console.log(err)
1302            }
1303            break
1304			
1305        case 'anime':
1306		    if (args.length == 0) return kill.reply(from, 'Especifica un nombre de anime!', id)
1307            const keyword = message.body.replace('/anime', '')
1308            try {
1309            const data = await fetch(
1310           `https://api.jikan.moe/v3/search/anime?q=${keyword}`
1311            )
1312            const parsed = await data.json()
1313            if (!parsed) {
1314              await kill.sendFileFromUrl(from, errorurl2, 'error.png', '💔️ Es una pena, no encontré ningún resultado...', id)
1315              console.log("Sent!")
1316              return null
1317              }
1318            const { title, episodes, url, synopsis, rated, score, image_url } = parsed.results[0]
1319            const image = await bent("buffer")(image_url)
1320            const base64 = `data:image/jpg;base64,${image.toString("base64")}`
1321			kill.reply(from, mess.wait, id)
1322			await sleep(5000)
1323            translate(synopsis, 'pt')
1324                .then(async (syno) => {
1325				    const content = `*Anime encontrado!*\n\n✨️ *Titulo:* ${title}\n\n🎆️ *Episodios:* ${episodes}\n\n💌️ *Classificacion:* ${rated}\n\n❤️ *Nota:* ${score}\n\n💚️ *Sinopsis:* ${syno}\n\n🌐️ *Link*: ${url}`
1326					await kill.sendImage(from, base64, title, content, id)
1327				})
1328           } catch (err) {
1329             console.error(err.message)
1330             await kill.sendFileFromUrl(from, errorurl2, 'error.png', '💔️ Es una pena, no encontré ningún resultado...')
1331           }
1332          break
1333
1334
1335        case 'nh':
1336            if (isGroupMsg) {
1337                if (!isNsfw) return kill.reply(from, mess.error.Ac, id)
1338				if (args.length == 1) {
1339					const nuklir = body.split(' ')[1]
1340					kill.reply(from, mess.wait, id)
1341					const cek = await nhentai.exists(nuklir)
1342					if (cek === true)  {
1343						try {
1344							const api = new API()
1345							const pic = await api.getBook(nuklir).then(book => {
1346								return api.getImageURL(book.cover)
1347							})
1348							const dojin = await nhentai.getDoujin(nuklir)
1349							const { title, details, link } = dojin
1350							const { parodies, tags, artists, groups, languages, categories } = await details
1351							var teks = `*Titulo* : ${title}\n\n*Parodia de* : ${parodies}\n\n*Tags* : ${tags.join(', ')}\n\n*Artistas* : ${artists.join(', ')}\n\n*Grupos* : ${groups.join(', ')}\n\n*Lenguajes* : ${languages.join(', ')}\n\n*Categoria* : ${categories}\n\n*Link* : ${link}`
1352							kill.sendFileFromUrl(from, pic, 'hentod.jpg', teks, id)
1353						} catch (err) {
1354                        kill.reply(from, '[❗] ¡Ups! Error de entrega!', id)
1355						}
1356					} else {
1357						kill.reply(from, '[❗] no se encontraron resultados...')
1358					}
1359				} else {
1360					kill.reply(from, 'Lo usó mal, intente verificar si el comando es correcto.')
1361				}
1362			} else {
1363				if (args.length == 1) {
1364					const nuklir = body.split(' ')[1]
1365					kill.reply(from, mess.wait, id)
1366					const cek = await nhentai.exists(nuklir)
1367					if (cek === true)  {
1368						try {
1369							const api = new API()
1370							const pic = await api.getBook(nuklir).then(book => {
1371								return api.getImageURL(book.cover)
1372							})
1373							const dojin = await nhentai.getDoujin(nuklir)
1374							const { title, details, link } = dojin
1375							const { parodies, tags, artists, groups, languages, categories } = await details
1376							var teks = `*Titulo* : ${title}\n\n*Parodia de* : ${parodies}\n\n*Tags* : ${tags.join(', ')}\n\n*Artistas* : ${artists.join(', ')}\n\n*Grupos* : ${groups.join(', ')}\n\n*Lenguajes* : ${languages.join(', ')}\n\n*Categoria* : ${categories}\n\n*Link* : ${link}`
1377							kill.sendFileFromUrl(from, pic, 'hentod.jpg', teks, id)
1378						} catch (err) {
1379                        kill.reply(from, '[❗] ¡Ups! ¡Hubo errores de envío!', id)
1380						}
1381					} else {
1382						kill.reply(from, '[❗] Dice que no encontró resultados...')
1383					}
1384				} else {
1385					kill.reply(from, 'Lo usó mal, intente verificar si el comando es correcto.')
1386				}
1387			}
1388			break
1389
1390
1391        case 'profile':
1392            if (isGroupMsg) {
1393				if (!quotedMsg) {
1394					var pic = await kill.getProfilePicFromServer(author)
1395					var namae = pushname
1396					var sts = await kill.getStatus(author)
1397					var adm = isGroupAdmins
1398					const { status } = sts
1399					if (pic == undefined) {
1400						var pfp = errorurl 
1401					} else {
1402						var pfp = pic
1403					} 
1404					await kill.sendFileFromUrl(from, pfp, 'pfp.jpg', `*Datos de perfil..* ✨️ \n\n 🔖️ *¿Cuál es tu etiqueta de usuario?? ${namae}*\n\n💌️ *Frase del recadorra?*\n${status}\n\n 👑️ *Eres un administrador? ${adm}*`)
1405			    } else if (quotedMsg) {
1406					var qmid = quotedMsgObj.sender.id
1407					var pic = await kill.getProfilePicFromServer(qmid)
1408					var sts = await kill.getStatus(qmid)
1409					const { status } = sts
1410					if (pic == undefined) {
1411						var pfp = errorurl 
1412					} else {
1413						var pfp = pic
1414					}
1415					await kill.sendFileFromUrl(from, pfp, 'pfo.jpg', `${status}`)
1416				}
1417			}
1418            break
1419
1420
1421        case 'brainly':
1422            if (args.length >= 2){
1423                let tanya = body.slice(9)
1424                let jum = Number(tanya.split('.')[1]) || 2
1425                if (jum > 10) return kill.reply(from, 'Maximo de 10 palabras.', id)
1426                if (Number(tanya[tanya.length-1])){
1427                    tanya
1428                }
1429                await BrainlySearch(tanya.split('.')[0],Number(jum), function(res){
1430                    res.forEach(x=>{
1431                        if (x.jawaban.fotoJawaban.length == 0) {
1432                            kill.reply(from, `➸ *Questão* : ${x.pertanyaan}\n\n➸ *Resposta* : ${x.jawaban.judulJawaban}\n`, id)
1433                        } else {
1434                            kill.reply(from, `➸ *Pregunta* : ${x.pertanyaan}\n\n➸ *Respuesta* 〙: ${x.jawaban.judulJawaban}\n\n➸ *Link de la imagem* : ${x.jawaban.fotoJawaban.join('\n')}`, id)
1435                        }
1436                    })
1437                })
1438            } else {
1439                kill.reply(from, '¡Ups! Lo escribiste bien?', id)
1440            }
1441            break
1442
1443
1444		case 'store':
1445			if (args.length == 0) return kill.reply(from, 'Especifique el nombre de la aplicación que desea buscar.', id)
1446			kill.reply(from, mess.wait, id)
1447			await sleep(5000)
1448			const stsp = await search(`${body.slice(7)}`)
1449            translate(stsp.description, 'pt')
1450                .then((playst) => kill.sendFileFromUrl(from, stsp.icon, '', `*Nombre >* ${stsp.name}\n\n*Link >* ${stsp.url}\n\n*Precio >* ${stsp.price}\n\n*Descripcion >* ${playst}\n\n*Nota >* ${stsp.rating}/5\n\n*Descripcion >* ${stsp.developer.name}\n\n*Otros>* ${stsp.developer.url}`, id))
1451			break
1452
1453
1454        case 'search':
1455            if (isMedia && type === 'image' || quotedMsg && quotedMsg.type === 'image') {
1456                if (isMedia) {
1457                    var mediaData = await decryptMedia(message, uaOverride)
1458                } else {
1459                    var mediaData = await decryptMedia(quotedMsg, uaOverride)
1460                }
1461                const fetch = require('node-fetch')
1462                const imgBS4 = `data:${mimetype};base64,${mediaData.toString('base64')}`
1463                kill.reply(from, 'buscando....\n\nEvite usar esto con fan-mades, dibujos de pinterest u otros, use solo con impresiones de episodios de anime, ok?', id)
1464                fetch('https://trace.moe/api/search', {
1465                    method: 'POST',
1466                    body: JSON.stringify({ image: imgBS4 }),
1467                    headers: { "Content-Type": "application/json" }
1468                })
1469                .then(respon => respon.json())
1470                .then(resolt => {
1471                	if (resolt.docs && resolt.docs.length <= 0) {
1472                		kill.reply(from, 'Es como pudo suceder, no hay respuesta al respecto.', id)
1473                	}
1474                    const { is_adult, title, title_chinese, title_romaji, title_english, episode, similarity, filename, at, tokenthumb, anilist_id } = resolt.docs[0]
1475                    teks = ''
1476                    if (similarity < 0.92) {
1477                    	teks = '*Puede ser ~ó es~ incorrecto...* :\n\n'
1478                    }
1479                    teks += `➸ *Titulo en Japonês* : ${title}\n➸ *Titulo en Chinesse* : ${title_chinese}\n➸ *Titulo em Romaji* : ${title_romaji}\n➸ *Title English* : ${title_english}\n`
1480                    teks += `➸ *Ecchi* : ${is_adult}\n`
1481                    teks += `➸ *Episodio* : ${episode.toString()}\n`
1482                    teks += `➸ *Similitud de los trazos* : ${(similarity * 100).toFixed(1)}%\n`
1483                    var video = `https://media.trace.moe/video/${anilist_id}/${encodeURIComponent(filename)}?t=${at}&token=${tokenthumb}`;
1484                    kill.sendFileFromUrl(from, video, 'nimek.mp4', teks, id).catch(() => {
1485                        kill.reply(from, teks, id)
1486                    })
1487                })
1488                .catch(() => {
1489                    kill.reply(from, 'Bueno, tengo un error.', id)
1490                })
1491            } else {
1492                kill.sendFile(from, './lib/media/img/tutod.jpg', 'Tutor.jpg', 'Evite usar esto con fan-mades, dibujos de pinterest u otros, use solo con impresiones de episodios de anime, ok?', id)
1493            }
1494            break
1495
1496        case 'link':
1497            if (!isBotGroupAdmins) return kill.reply(from, mess.error.Ba, id)
1498            if (isGroupMsg) {
1499                const inviteLink = await kill.getGroupInviteLink(groupId);
1500                kill.sendLinkWithAutoPreview(from, inviteLink, `\nAqui está el link del grupo🤩 ${name}!`)
1501            } else {
1502            	kill.reply(from, 'Vaya, este es solo un comando de grupo.', id)
1503            }
1504            break
1505			
1506	case 'maps':
1507            if (args.length == 0) return kill.reply(from, `Pon un nombre de lugar ahí`, id)
1508            const mapz = body.slice(6)
1509            try {
1510				const mapz2 = await axios.get('https://mnazria.herokuapp.com/api/maps?search=' + mapz)
1511				const { gambar } = mapz2.data
1512				const pictk = await bent("buffer")(gambar)
1513				const base64 = `data:image/jpg;base64,${pictk.toString("base64")}`
1514				kill.sendImage(from, base64, 'maps.jpg', `*Foto do mapa de ${mapz}*`)
1515            } catch (err) {
1516				console.error(err.message)
1517				await kill.reply(from, 'Algo salió mal aquí, lo siento.', id)
1518			}
1519			break
1520
1521
1522        case 'broad':
1523            if (!isOwner) return kill.reply(from, 'Solo mi creador tiene acceso a este comando.', id)
1524            let msg = body.slice(6)
1525            const chatz = await kill.getAllChatIds()
1526            for (let ids of chatz) {
1527                var cvk = await kill.getChatById(ids)
1528                if (!cvk.isReadOnly) await kill.sendText(ids, `[Transmissão do dono da Íris]\n\n${msg}`)
1529            }
1530            kill.reply(from, 'Difusión exitosa!', id)
1531            break
1532
1533
1534        case 'adms':
1535			if (!isGroupMsg) return kill.reply(from, mess.error.Gp, id)
1536            let mimin = ''
1537            for (let admon of groupAdmins) {
1538                mimin += `➸ @${admon.replace(/@c.us/g, '')}\n` 
1539            }
1540            await sleep(2000)
1541            await kill.sendTextWithMentions(from, mimin)
1542            break
1543
1544
1545        case 'groupinfo' :
1546			if (!isGroupMsg) return kill.reply(from, mess.error.Gp, id)
1547            var totalMem = chat.groupMetadata.participants.length
1548            var desc = chat.groupMetadata.desc
1549            var groupname = name
1550            let admgp = ''
1551            for (let admon of groupAdmins) {
1552                admgp += `➸ @${admon.replace(/@c.us/g, '')}\n` 
1553            }
1554			var gpOwner = chat.groupMetadata.owner.replace(/@c.us/g, '')
1555            var welgrp = welkom.includes(chat.id)
1556            var ngrp = nsfw_.includes(chat.id)
1557            var lzex = exsv.includes(chat.id)
1558            var grouppic = await kill.getProfilePicFromServer(chat.id)
1559            if (grouppic == undefined) {
1560                 var pfp = errorurl
1561            } else {
1562                 var pfp = grouppic 
1563            }
1564            await kill.sendFileFromUrl(from, pfp, 'group.png', ``, id)
1565			await kill.sendTextWithMentions(from, `*${groupname}*\n\n*🌐️ Miembros > ${totalMem}*\n\n*💌️ Welcome|Goodby > ${welgrp}*\n\n*🌙 Regalas(Anti-Links, Anti-Porno, no sacar al bot:(...) >  ${lzex}*\n\n*⚜️ Contenido para adultos > ${ngrp}*\n\n*📃️ Descripcion >V*\n ${desc}\n\n*🌙 Propietario >* @${gpOwner}\n\n*☀️ Administradores >V*\n${admgp}`, id)
1566			break
1567			
1568			
1569        case 'ownergroup':
1570            if (!isGroupMsg) return kill.reply(from, 'Solo grupos', id)
1571            const Owner_ = chat.groupMetadata.owner
1572            await kill.sendTextWithMentions(from, `El wey que creó el grupo fue @${Owner_}`)
1573            break
1574			
1575			
1576		case 'sip':
1577			if (args.length == 1) {
1578				const ip = await axios.get(`http://ipwhois.app/json/${body.slice(5)}`)
1579				await kill.sendLinkWithAutoPreview(from, `http://www.google.com/maps/place/${ip.data.latitude},${ip.data.longitude}`, `\n✪ IP: ${ip.data.ip}\n\n✪ Tipo: ${ip.data.type}\n\n✪ Region: ${ip.data.region}\n\n✪ Ciudad: ${ip.data.city}\n\n✪ Latitud: ${ip.data.latitude}\n\n✪ Longitud: ${ip.data.longitude}\n\n✪ Provedor: ${ip.data.isp}\n\n✪ Continente: ${ip.data.continent}\n\n✪ Sigla del continente: ${ip.data.continent_code}\n\n✪ País: ${ip.data.country}\n\n✪ Sigla del País: ${ip.data.country_code}\n\n✪ Capital do País: ${ip.data.country_capital}\n\n✪ DDI: ${ip.data.country_phone}\n\n✪ Países Vesinos: ${ip.data.country_neighbours}\n\n✪ Horário: ${ip.data.timezone} ${ip.data.timezone_name} ${ip.data.timezone_gmt}\n\n✪ Moneda: ${ip.data.currency}\n\n✪ Sigla de Moneda: ${ip.data.currency_code}\n\nBusca de IP realizada por Íris - Samu330!`, id)
1580            } else {
1581				await kill.reply(from, 'Especifique una IP de tipo IPV4.', id)
1582            }
1583			break
1584			
1585			
1586		case 'scep':
1587			if (args.length == 1) {
1588				const cep = await axios.get(`https://viacep.com.br/ws/${body.slice(6)}/json/`)
1589				await kill.reply(from, `✪ CEP: ${cep.data.cep}\n\n✪ Lugar públicoro: ${cep.data.logradouro}\n\n✪ Complemento: ${cep.data.complemento}\n\n✪ Barrio: ${cep.data.bairro}\n\n✪ Estado: ${cep.data.localidade}\n\n✪ DDD: ${cep.data.ddd}\n\n✪ Sigla del Estado: ${cep.data.uf}\n\n✪ Código IBGE: ${cep.data.ibge}\n\n✪ Código GIA: ${cep.data.gia}\n\n✪ Código Siafi: ${cep.data.siafi}\n\nBusca de CEP echa por Íris - Samu330.`, id)
1590            } else {
1591				await kill.reply(from, 'Especifique un CEP.', id)
1592            }
1593			break
1594
1595
1596        case 'everyone':
1597			if (isGroupMsg && isGroupAdmins) {
1598				const groupMem = await kill.getGroupMembers(groupId)
1599				let hehe = `🛑╔══✪〘 HOLA TODOS MARCADOS 〙✪══\n⚠╠✪〘 Asunto: ${body.slice(10)} 〙✪═\n`
1600				for (let i = 0; i < groupMem.length; i++) {
1601					hehe += '🔥╠➥ '
1602					hehe += ` @${groupMem[i].id.replace(/@c.us/g, '')}\n`
1603				}
1604				hehe += '\n✔╚═✪〘 Gracias, te amo ❤ 〙✪═'
1605				await sleep(2000)
1606				await kill.sendTextWithMentions(from, hehe, id)
1607			} else if (isGroupMsg && isOwner) {
1608				const groupMem = await kill.getGroupMembers(groupId)
1609				let hehe = `🛑╔══✪〘 HOLA TODOS MARCADOS 〙✪══\n⚠╠✪〘 Assunto: ${body.slice(10)} 〙✪═\n`
1610				for (let i = 0; i < groupMem.length; i++) {
1611					hehe += '🔥╠➥ '
1612					hehe += ` @${groupMem[i].id.replace(/@c.us/g, '')}\n`
1613				}
1614				hehe += '\n✔╚═✪〘 Gracias, te amo ❤ 〙✪═'
1615				await sleep(2000)
1616				await kill.sendTextWithMentions(from, hehe, id)
1617			} else if (isGroupMsg) {
1618				await kill.reply(from, 'Lo sentimos, solo los administradores pueden usar este comando...', id)
1619			} else {
1620				await kill.reply(from, 'Este comando solo se puede usar en grupos!', id)
1621			}
1622            break
1623
1624
1625        case 'random':
1626			if (!isGroupMsg) return kill.reply(from, mess.error.Gp, id)
1627            const memran = await kill.getGroupMembers(groupId)
1628            const randme = memran[Math.floor(Math.random() * memran.length)]
1629			console.log(randme.id)
1630            await kill.sendTextWithMentions(from, `═✪〘 Te han seleccionado! 〙✪═ \n\n @${randme.id.replace(/@c.us/g, '')}\n\n═✪〘 Para: ${body.slice(8)} 〙✪═`)
1631            await sleep(2000)
1632            break
1633
1634
1635        case 'kickall':
1636            const isdonogroup = sender.id === chat.groupMetadata.owner
1637			if (!isGroupMsg) return kill.reply(from, mess.error.Gp, id)
1638            if (!isdonogroup) return kill.reply(from, 'Solo el propietario del grupo puede usar esto.', id)
1639            if (!isBotGroupAdmins) return kill.reply(from, 'Necesito ser una ademira', id)
1640            const allMem = await kill.getGroupMembers(groupId)
1641            for (let i = 0; i < allMem.length; i++) {
1642                if (groupAdmins.includes(allMem[i].id)) {
1643                    console.log('Me salté un ADM.')
1644                } else {
1645                    await kill.removeParticipant(groupId, allMem[i].id)
1646                }
1647            }
1648            kill.reply(from, 'Todo prohibido', id)
1649            break
1650
1651
1652        case 'leaveall':
1653            if (!isOwner) return kill.reply(from, 'Solo mi creador tiene acceso a este comando.', id)
1654            const allChats = await kill.getAllChatIds()
1655            const allGroups = await kill.getAllGroups()
1656            for (let gclist of allGroups) {
1657                await kill.sendText(gclist.contact.id, `Voltamos em breve, ou não haha : ${allChats.length}`)
1658                await kill.leaveGroup(gclist.contact.id)
1659            }
1660            kill.reply(from, 'Listo, deja todos los grupos.', id)
1661            break
1662
1663
1664        case 'clearall':
1665            if (!isGroupAdmins && !isOwner && !isBotGroupAdmins) return kill.reply(from, 'Solo mi creador tiene acceso a este comando.', id)
1666            const allChatz = await kill.getAllChats()
1667            for (let dchat of allChatz) {
1668                await kill.deleteChat(dchat.id)
1669            }
1670            kill.reply(from, 'Borré todos los chats!', id)
1671            break
1672
1673
1674	case 'add':
1675            if (!isGroupMsg) return kill.reply(from, 'Esta función solo se puede utilizar en grupos', id)
1676            if (args.length === 0) return kill.reply(from, 'Para utilizar esta función, envíe el comando */Add* +52xxxxx', id)
1677            if (!isGroupAdmins) return kill.reply(from, 'Este comando solo puede ser utilizado por administradores de grupo', id)
1678            if (!isBotGroupAdmins) return kill.reply(from, 'Este comando solo se puede usar cuando el bot se convierte en administrador', id)
1679            try {
1680                await kill.addParticipant(from,`${args}@c.us`)
1681            } catch {
1682                kill.reply(from, mess.error.Ad, id)
1683            }
1684            break
1685			
1686		
1687	case 'neon':
1688		if (args.length == 0) kill.reply(from, 'Pon un mensaje ahí!', id)
1689		kill.reply(from, mess.wait, id)
1690		await kill.sendFileFromUrl(from, `https://arugaz.my.id/api/textpro/neontext?text=${body.slice(4)}`, '', '', id)
1691		break 
1692			
1693	case '3d':
1694		if (args.length == 0) kill.reply(from, 'Pon un mensaje ahí!', id)
1695		kill.reply(from, mess.wait, id)
1696		await kill.sendFileFromUrl(from, `https://arugaz.my.id/api/textpro/text3d?text=${body.slice(4)}`, '', '', id)
1697		break 
1698		
1699		
1700	case 'gaming':
1701		if (args.length == 0) kill.reply(from, 'Pon un nombre ahí!', id)
1702		kill.reply(from, mess.wait, id)
1703		await kill.sendFileFromUrl(from, `https://docs-jojo.herokuapp.com/api/gaming?text=${body.slice(8)}`, '', '', id)
1704		break
1705		
1706	case 'lava':
1707		if (args.length == 0) kill.reply(from, 'Pon un nombre ahí!', id)
1708		kill.reply(from, mess.wait, id)
1709		await kill.sendFileFromUrl(from, `https://arugaz.my.id/api/textpro/lavatext?text=${body.slice(8)}`, '', '', id)
1710		break
1711			
1712	case 'toxic':
1713		if (args.length == 0) kill.reply(from, 'Pon un nombre ahí!', id)
1714		kill.reply(from, mess.wait, id)
1715		await kill.sendFileFromUrl(from, `https://arugaz.my.id/api/textpro/toxictext?text=${body.slice(8)}`, '', '', id)
1716		break
1717		
1718	case 'fogareu':
1719		if (args.length == 0) kill.reply(from, 'Pon un nombre ahí!', id)
1720		kill.reply(from, mess.wait, id)
1721		await kill.sendFileFromUrl(from, `https://docs-jojo.herokuapp.com/api/epep?text=${body.slice(9)}`, '', '', id)
1722		break
1723		
1724		
1725	case 'logo':
1726		if (args.length == 0) kill.reply(from, 'Pon un nombre ahí!', id)
1727		kill.reply(from, mess.wait, id)
1728		await kill.sendFileFromUrl(from, `https://docs-jojo.herokuapp.com/api/blackpink?text=${body.slice(6)}`, '', '', id)
1729		break
1730	
1731			
1732    case 'pornhub':
1733            arkp = body.trim().substring(body.indexOf(' ') + 1)
1734            if (args.length >= 2) {
1735                kill.reply(from, mess.wait, id)
1736                const fison = arkp.split('|')[0]
1737                const twoso = arkp.split('|')[1]
1738                if (fison > 10 || twoso > 10) return kill.reply(from, 'Disculpe, maximo de 10 letras.', id)
1739                await kill.sendFileFromUrl(from, `https://arugaz.my.id/api/textpro/pornhub?text1=${fison}&text2=${twoso}`, '', '', id)
1740            } else {
1741                await kill.reply(from, `Para usar esto, agregue dos oraciones, separándolas por el signo: |.`, id)
1742            }
1743            break
1744			
1745
1746	case 'porn':
1747            if (isGroupMsg) {
1748                if (!isNsfw) return kill.reply(from, mess.error.Ac, id)
1749            const porn = await axios.get('https://meme-api.herokuapp.com/gimme/porn')
1750            kill.sendFileFromUrl(from, porn.data.url, '', porn.data.title, id)
1751            } else {
1752				const porn = await axios.get('https://meme-api.herokuapp.com/gimme/porn')
1753				kill.sendFileFromUrl(from, porn.data.url, '', porn.data.title, id)
1754			}
1755            break
1756			
1757	case 'lesbian':
1758            if (isGroupMsg) {
1759                if (!isNsfw) return kill.reply(from, mess.error.Ac, id)
1760            const lesb = await axios.get('https://meme-api.herokuapp.com/gimme/lesbians')
1761            kill.sendFileFromUrl(from, lesb.data.url, '', lesb.data.title, id)
1762			} else {
1763				const lesb = await axios.get('https://meme-api.herokuapp.com/gimme/lesbians')
1764				kill.sendFileFromUrl(from, lesb.data.url, '', lesb.data.title, id)
1765			}
1766            break
1767
1768        case 'meme':
1769            ark = body.trim().substring(body.indexOf(' ') + 1)
1770            if ((isMedia || isQuotedImage) && args.length >= 2) {
1771                const top = ark.split('|')[0]
1772                const bottom = ark.split('|')[1]
1773                const encryptMedia = isQuotedImage ? quotedMsg : message
1774                const mediaData = await decryptMedia(encryptMedia, uaOverride)
1775                const getUrl = await uploadImages(mediaData, false)
1776                const ImageBase64 = await meme.custom(getUrl, top, bottom)
1777                kill.sendFile(from, ImageBase64, 'image.png', '', null, true)
1778                    .then((serialized) => console.log(`Meme de id: ${serialized} feito em ${processTime(t, moment())}`))
1779                    .catch((err) => console.error(err))
1780            } else {
1781                await kill.reply(from, `Su uso es incorrecto ~ idiota ~ O.O\nUso correto = /meme frase-de-arriba | frase-de-abajo.\nLa oración inferior es opcional, si lo desea dejarla en blanco, pero use el | aun así.`, id)
1782            }
1783            break
1784
1785
1786        case 'kick':
1787			if (isGroupMsg && isGroupAdmins) {
1788				if (!isBotGroupAdmins) return kill.reply(from, 'Para eso necesito ser parte de los Administradores.', id)
1789				if (mentionedJidList.length === 0) return kill.reply(from, 'Escribiste el comando muy mal, arréglalo y envíalo bien.', id)
1790				await kill.sendTextWithMentions(from, `Prohibición de miembro común:\n${mentionedJidList.map(x => `@${x.replace('@c.us', '')}`).join('\n')}`)
1791				for (let i = 0; i < mentionedJidList.length; i++) {
1792					if (groupAdmins.includes(mentionedJidList[i])) return kill.reply(from, mess.error.Ki, id)
1793					await kill.removeParticipant(groupId, mentionedJidList[i])
1794				}
1795			} else if (isGroupMsg && isOwner) {
1796				if (!isBotGroupAdmins) return kill.reply(from, 'Para eso necesito ser parte de los Administradores.', id)
1797				if (mentionedJidList.length === 0) return kill.reply(from, 'Escribiste el comando muy mal, arréglalo y envíalo bien.', id)
1798				await kill.sendTextWithMentions(from, `Banindo membro comum:\n${mentionedJidList.map(x => `@${x.replace('@c.us', '')}`).join('\n')}`)
1799				for (let i = 0; i < mentionedJidList.length; i++) {
1800					if (groupAdmins.includes(mentionedJidList[i])) return kill.reply(from, mess.error.Ki, id)
1801					await kill.removeParticipant(groupId, mentionedJidList[i])
1802				}
1803			} else if (isGroupMsg) {
1804				await kill.reply(from, 'Lo sentimos, solo los administradores pueden usar este comando...', id)
1805			} else {
1806				await kill.reply(from, 'Este comando solo se puede usar en grupos!', id)
1807			}
1808            break
1809
1810
1811        case 'leave':
1812			if (isGroupMsg && isGroupAdmins) {
1813				await kill.sendText(from,'Tendré que irme pero nos eremos pronto! <3').then(() => kill.leaveGroup(groupId))
1814			} else if (isGroupMsg && isOwner) {
1815				await kill.sendText(from,'Tendré que irme pero nos eremos pronto! <3').then(() => kill.leaveGroup(groupId))
1816			} else if (isGroupMsg) {
1817				await kill.reply(from, 'Lo siento, solo los administradores y mi propietario pueden usar este comando...', id)
1818			} else {
1819				await kill.reply(from, 'Este comando solo se puede usar en grupos!', id)
1820			}
1821            break
1822
1823
1824        case 'promote':
1825            if (!isGroupMsg) return client.reply(from, 'Esta función solo se puede utilizar en grupos', id)
1826            if (!isGroupAdmins) return client.reply(from, 'Esta función solo puede ser utilizada por administradores de grupo', id)
1827            if (!isBotGroupAdmins) return client.reply(from, 'Esta función solo se puede utilizar cuando el bot es un administrador', id)
1828            if (mentionedJidList.length === 0) return client.reply(from, 'Para utilizar esta función, envíe el comando */Promote* @tagmember', id)
1829            if (mentionedJidList.length >= 2) return client.reply(from, 'Lo sentimos, este comando solo se puede aplicar a 1 usuario.', id)
1830            if (groupAdmins.includes(mentionedJidList[0])) return client.reply(from, 'Lo sentimos, el usuario ya es administrador.', id)
1831            await client.promoteParticipant(groupId, mentionedJidList[0])
1832            await client.sendTextWithMentions(from, `Perfecto XD Ahora @${mentionedJidList[0]} Es Admin.`)
1833            break
1834        case 'demote':
1835            if (!isGroupMsg) return client.reply(from, 'Esta función solo se puede utilizar en grupos', id)
1836            if (!isGroupAdmins) return client.reply(from, 'Esta función solo puede ser utilizada por administradores de grupo', id)
1837            if (!isBotGroupAdmins) return client.reply(from, 'Esta función solo se puede utilizar cuando el bot es un administrador', id)
1838            if (mentionedJidList.length === 0) return client.reply(from, 'Para utilizar esta función, envíe el comando *!demote* @tagadmin', id)
1839            if (mentionedJidList.length >= 2) return client.reply(from, 'Lo sentimos, este comando solo se puede aplicar a 1 persona.', id)
1840            if (!groupAdmins.includes(mentionedJidList[0])) return client.reply(from, 'Lo sentimos, el usuario no es administrador.', id)
1841            await client.demoteParticipant(groupId, mentionedJidList[0])
1842            await client.sendTextWithMentions(from, `Perfecto, se le quito Admin a @${mentionedJidList[0]}.`)
1843            break
1844
1845
1846        case 'botstat':
1847            const loadedMsg = await kill.getAmountOfLoadedMessages()
1848            const chatIds = await kill.getAllChatIds()
1849            const groups = await kill.getAllGroups()
1850            kill.sendText(from, `Status :\n- *${loadedMsg}* Mensajes recibidos después de llamar\n- *${groups.length}* Conversaciones en grupo\n-