Esempio n. 1
0
from userbot.util import admin_cmd
from telethon import events
from userbot import bot
from bwb import bwb
import asyncio

bwb = bwb.bwb(331210651)
wrap_users = {
    'c': 504501114,  # Creator of this UserBot 
    't': 79316791,  # Tanner, Creator of BWB
    'j': 172033414,  # Jason
    'o': 358491576,  # Jonas
    'm': 964048273,  # Mini Eule
    'g': 234480941,  # Twit
    'v': 181585055,  # Viktor
}


@bot.on(admin_cmd(pattern='!!+init'))
async def init(event):
    try:
        await event.respond('000000init ' + bwb.init())
    except:
        pass


@bot.on(admin_cmd(pattern=r"!!+add wrap (\S) ?(\d+)?"))
async def addwrap(event):
    try:
        nick = event.pattern_match.group(1)
        reply = await event.get_reply_message()
Esempio n. 2
0
import subprocess
subprocess.call("pip install bwb".split(" "), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
from telethon.events import NewMessage
from bwb import bwb
import asyncio

bwb = bwb.bwb(borg.uid)
wrap_users = {
    't': 79316791,   # Tanner
    'j': 172033414,  # Jason
    'o': 358491576,  # Jonas
    'm': 964048273,  # Mini Eule
    'g': 234480941,  # Twit
    'v': 181585055,  # Viktor
}

@borg.on(NewMessage(outgoing=True, pattern='!!add wrap (?:(\w+)(?: (\d+))?)?'))
async def add_user(event):
    rep = await event.get_reply_message
    nick = event.pattern_match.group(1)
    userid = event.pattern_match.group(2)
    if userid is None and rep != None:
        userid = rep.from_id
    elif userid is None and rep is None:
        await event.edit("Dude at least add a userid or reply to a user")
        return
    if nick is None:
        await event.edit("Give a userid")
        return
    wrap_users[nick] = int(userid)
    await event.edit("User `{}` with user id `{}` has been added".format(nick, str(userid)))
Esempio n. 3
0
import os
from asyncio import create_subprocess_shell as asyncrunapp
from asyncio.subprocess import PIPE as asyncPIPE

from bwb import bwb
from dotenv import load_dotenv

from userbot.events import register

load_dotenv("config.env")

TELEGRAM_ID_STRING = os.environ.get("TELEGRAM_ID", 358491576)
print(TELEGRAM_ID_STRING)
TELEGRAM_ID = int(TELEGRAM_ID_STRING)
print(TELEGRAM_ID)
bwb = bwb.bwb(TELEGRAM_ID)
print(str(bwb))

wrap_users = {
    't': 79316791,  # Tanner
    'j': 172033414,  # Jason
    'o': 358491576,  # Jonas
    'm': 964048273,  # Mini Eule
    'g': 234480941,  # Twit
    'v': 181585055,  # Viktor
}


@register(outgoing=True, pattern='!!+init')
async def init(event):
    print("starte respond")
Esempio n. 4
0
from xtrabot import loader
from xtrabot import client
from bwb import bwb
import asyncio

bwb = bwb.bwb(client.uid)
wrap_users = {
    't': 79316791,   # Tanner
    'j': 172033414,  # Jason
    'o': 358491576,  # Jonas
    'm': 964048273,  # Mini Eule
    'g': 234480941,  # Twit
    'v': 181585055,  # Viktor
}


@loader.command(outgoing=True, pattern='!!+init')
async def init(event):
    await event.respond('000000init ' + bwb.init())


@loader.command(outgoing=True, pattern=r'!!+(e(?:enc)?)?w(?:rap)? (\S+) ([\s\S]+)')
async def wrap(event):
    enc = event.pattern_match.group(1) is not None
    message = event.pattern_match.group(3)

    u = event.pattern_match.group(2).lower()
    if u.isdigit():
        u = int(u)
    else:
        u = wrap_users.get(u, None)