예제 #1
0
def module_init(gd):
    global path
    path = gd.config["path"]
    commands = gd.config["commands"]
    for command in commands:
        caption_filter = Caption_Filter("/" + command)
        gd.dp.add_handler(MessageHandler(caption_filter, liquid))
        gd.dp.add_handler(PrefixHandler("/", command, liquid))
예제 #2
0
def module_init(gd):
    global path, launchpad_gif
    path = gd.config["path"]
    launchpad_gif = gd.config["launchpad_path"]
    commands = gd.config["commands"]
    for command in commands:
        caption_filter = Caption_Filter("/" + command)
        gd.dp.add_handler(MessageHandler(caption_filter, fap))
        gd.dp.add_handler(PrefixHandler("/", command, fap))
예제 #3
0
def module_init(gd):
    global path, extensions
    extensions = gd.config["extensions"]
    commands = gd.config["commands"]
    path = gd.config["path"]
    for command in commands:
        caption_filter = Caption_Filter("/" + command)
        gd.dp.add_handler(MessageHandler(caption_filter, kek))
        gd.dp.add_handler(PrefixHandler("/", command, kek))
예제 #4
0
def module_init(gd):
    global path, resources_path, font_path
    path = gd.config["path"]
    resources_path = gd.config["resources_path"]
    font_path = gd.config["font"]
    commands = gd.config["commands"]
    for command in commands:
        caption_filter = Caption_Filter("/" + command)
        gd.dp.add_handler(MessageHandler(caption_filter, quote))
        gd.dp.add_handler(PrefixHandler("/", commands, quote))
예제 #5
0
def module_init(gd):
    global path, extensions, fonts_dict
    path = gd.config["path"]
    extensions = gd.config["extensions"]
    commands = gd.config["commands"]
    fonts_dict = {}
    for i in gd.config["fonts"]:
        fonts_dict[gd.config["fonts"][i]
                   ["name"]] = gd.config["fonts"][i]["path"]
    for command in commands:
        caption_filter = Caption_Filter("/" + command)
        gd.dp.add_handler(MessageHandler(caption_filter, meme))
        gd.dp.add_handler(PrefixHandler("/", commands, meme))
예제 #6
0
def module_init(gd):
    global path, resources_path, templates_dict, templates_path, token, extensions
    path = gd.config["path"]
    extensions = gd.config["extensions"]
    resources_path = gd.config["resources_path"]
    templates_path = resources_path + "templates/"
    token = gd.full_config["keys"]["telegram_token"]
    commands = gd.config["commands"]
    for command in commands:
        caption_filter = Caption_Filter("/" + command)
        gd.dp.add_handler(MessageHandler(caption_filter, merch))
        gd.dp.add_handler(PrefixHandler("/", command, merch))
    with open(resources_path + "templates.yml", "r") as f:
        templates_dict = yaml.load(f, Loader=yaml.SafeLoader)