mirror of
https://github.com/Nick80835/microbot
synced 2025-08-30 14:08:31 +00:00
reduce stupid code
This commit is contained in:
@@ -27,6 +27,8 @@ class MicroBot():
|
||||
self.start_logger()
|
||||
self.start_client()
|
||||
self.start_loader()
|
||||
|
||||
def run_until_done(self):
|
||||
self.loader.load_all_modules()
|
||||
self.logger.info("Client successfully started.")
|
||||
self.client.run_until_disconnected()
|
||||
@@ -81,8 +83,10 @@ class MicroBot():
|
||||
|
||||
|
||||
micro_bot = MicroBot()
|
||||
micro_bot.start_microbot()
|
||||
ldr = micro_bot.loader
|
||||
|
||||
try:
|
||||
micro_bot.start_microbot()
|
||||
micro_bot.run_until_done()
|
||||
except:
|
||||
micro_bot.client.loop.run_until_complete(micro_bot.stop_client())
|
||||
|
@@ -2,9 +2,7 @@
|
||||
|
||||
from random import choice, shuffle
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
BOARD_URL = "https://a.4cdn.org/{0}/threads.json"
|
||||
POST_URL = "https://a.4cdn.org/{0}/thread/{1}.json"
|
||||
|
@@ -1,8 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
CAT_URL = 'http://api.thecatapi.com/v1/images/search'
|
||||
DOG_URL = 'http://api.thedogapi.com/v1/images/search'
|
||||
|
@@ -2,9 +2,7 @@
|
||||
|
||||
from time import time_ns
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
DAN_URL = "http://danbooru.donmai.us/posts.json"
|
||||
DAN_SAUCE_URL = "https://danbooru.donmai.us/posts/"
|
||||
|
@@ -31,9 +31,7 @@ from random import randint, uniform
|
||||
from PIL import Image, ImageEnhance, ImageOps
|
||||
from telethon.tl.types import DocumentAttributeFilename
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
|
||||
@ldr.add("deepfry(f|)", userlocking=True)
|
||||
|
@@ -6,9 +6,7 @@ import io
|
||||
from PIL import Image, ImageOps
|
||||
from speedtest import Speedtest
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
|
||||
@ldr.add("speed", owner=True, hide_help=True)
|
||||
|
@@ -3,9 +3,7 @@
|
||||
from random import choice
|
||||
from time import time_ns
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
GEL_URL = "https://gelbooru.com/index.php"
|
||||
GEL_SAUCE_URL = "https://gelbooru.com/index.php?page=post&s=view&id="
|
||||
|
@@ -3,9 +3,7 @@
|
||||
from asyncio import sleep
|
||||
from random import choice, randint
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
emoji = list("😂😝🤪🤩😤🥵🤯🥶😱🤔😩🙄💀👻🤡😹👀👁👌💦🔥🌚🌝🌞🔫💯")
|
||||
b_emoji = "🅱️"
|
||||
|
@@ -4,9 +4,7 @@ import io
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
NEKO_URL = "https://nekos.life/api/v2/img/"
|
||||
NEKO_TYPES = ['neko', 'lewd', 'smug', 'tits', 'trap', 'anal', 'cuddle', 'hug', 'goose', 'waifu', 'gasm', 'slap', 'spank', 'pat', 'feet', 'woof', 'baka']
|
||||
|
@@ -6,9 +6,7 @@ from random import choice, shuffle
|
||||
import praw
|
||||
from prawcore import exceptions as redex
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
REDDIT = praw.Reddit(client_id='-fmzwojFG6JkGg',
|
||||
client_secret=None,
|
||||
|
@@ -2,9 +2,7 @@
|
||||
|
||||
from time import time_ns
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
SAN_URL = "https://capi-v2.sankakucomplex.com/posts"
|
||||
SAN_SAUCE_URL = "https://beta.sankakucomplex.com/post/show/"
|
||||
|
@@ -9,9 +9,8 @@ from gtts import gTTS
|
||||
from howdoi import howdoi
|
||||
from PIL import Image
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
ldr = micro_bot.loader
|
||||
os.environ["HOWDOI_SEARCH_ENGINE"] = "bing"
|
||||
|
||||
|
||||
|
@@ -4,9 +4,7 @@ import io
|
||||
|
||||
from PIL import Image, ImageColor
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
|
||||
@ldr.add("color")
|
||||
|
@@ -5,9 +5,7 @@ from platform import python_version
|
||||
|
||||
from telethon import version
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr, micro_bot
|
||||
|
||||
|
||||
@ldr.add("reload", sudo=True, hide_help=True)
|
||||
|
@@ -4,9 +4,7 @@ from time import time_ns
|
||||
|
||||
from telethon import version
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
|
||||
@ldr.add("del")
|
||||
|
@@ -2,9 +2,7 @@
|
||||
|
||||
import io
|
||||
|
||||
from ubot.micro_bot import micro_bot
|
||||
|
||||
ldr = micro_bot.loader
|
||||
from ubot.micro_bot import ldr
|
||||
|
||||
UD_QUERY_URL = 'http://api.urbandictionary.com/v0/define'
|
||||
UD_RANDOM_URL = 'http://api.urbandictionary.com/v0/random'
|
||||
|
Reference in New Issue
Block a user