Skip to content

FoxUserbot/FoxUserbot

Repository files navigation


FoxUserbot
Telegram userbot with the easiest installation
Used Kurigram (Fork Pyrogram)
Custom modules

Custom modules

To add your module to the bot, create a pull request in the custom_modules repository

# -*- coding: utf-8 -*-
import os
from pyrogram import Client, filters
from command import fox_command, fox_sudo, who_message, get_text

filename = os.path.basename(__file__)
Module_Name = 'Example'


# If you need to install an external module via pip
# import the following line of code and install the library with the required parameter
#
# from requirements_installer import install_library
# install_library("requests -U") 
#
# ^^^ pip3 install requests -U
#
# =================================================
#
# from requirements_installer import install_library
# install_library("requests==2.32.3") 
#
# ^^^ pip3 install requests==2.32.3
#
# =================================================
#
# if you need to call any command after restarting
# with open("triggers/example_autostart", "w", encoding="utf-8") as f:
#        f.write("example_edit")
#        ^^^ enter the command that should be run after the userbot is restarted
#
# if you need write data config
# with open("userdata/example_config", "w", encoding="utf-8") as f:
#        f.write("example_data")
#        ^^^ enter the need data


LANGUAGES = {
    "en": {
        "simple_text": "🦊 <b>This is a simple example module</b>",
        "text_with_var": "🎯 <b>Hello {name}! Module working.</b>"
    },
    "ru": {
        "simple_text": "🦊 <b>Это простой пример модуля</b>", 
        "text_with_var": "🎯 <b>Привет {name}! Модуль работает.</b>"
    },
    "ua": {
        "simple_text": "🦊 <b>Це простий приклад модуля</b>",
        "text_with_var": "🎯 <b>Привіт {name}! Модуль працює.</b>"
    }
}

# fox_command(command, module_name, filename=os.path.basename(__file__), "[Arguments]")
@Client.on_message(fox_command("example", Module_Name, filename) & fox_sudo())
async def example_simple(client, message):
    message = await who_message(client, message)
    
    # Simple edit without variable
    text = get_text("example", "simple_text", LANGUAGES=LANGUAGES)
    await message.edit(text)

@Client.on_message(fox_command("example_hello", Module_Name, filename, "[name]") & fox_sudo())
async def example_with_var(client, message):
    message = await who_message(client, message)
    
    # Get variable (if none: = user)
    args = message.text.split()
    name = args[1] if len(args) > 1 else "User"
    
    # Text with variable
    text = get_text("example", "text_with_var", LANGUAGES=LANGUAGES, name=name)
    await message.edit(text)

How to add Hikka/Heroku modules?

To add modules from Hikka/Heroku, there is a special compatibility layer called Wine Hikka. To use it, download the module file itself from the modules repository and reply to the Hikka module with [prefix]wine_hikka or [prefix]wine_hikka [link].

AI will automatically convert the module from Telethon to Pyrogram for this UserBot, save it in the modules/plugins_2custom/ folder and restart it.

Note that this method is not perfect and errors may occur.

Install and Start

How to install?

  • Termux
pkg update -y && pkg install python3 wget unzip -y && termux-wake-lock && wget -O foxub.$$ https://github.com/FoxUserbot/FoxUserbot/archive/refs/heads/main.zip && (unzip foxub.$$ && rm -rf foxub.$$ && cd FoxUserbot-main && python3 -m venv venv && source venv/bin/activate && python3 main.py)

Important

Further installation (except for macOS and Docker) must be done as root or use sudo

  • APT (Debian based)
apt update -y && apt install python3 python3-pip python3-venv wget unzip -y && wget -O foxub.$$ https://github.com/FoxUserbot/FoxUserbot/archive/refs/heads/main.zip && (unzip foxub.$$ && rm -rf foxub.$$ && cd FoxUserbot-main ; python3 -m venv venv ; source venv/bin/activate ; python3 main.py)
  • APT (if python < 3.7, else go to "Debian based")
apt update -y && apt install python3-venv curl wget unzip -y && sh <(curl -sSL https://raw.githubusercontent.com/FoxUserbot/FoxUserbot/main/HowToGetPython3_8.sh) && wget -O foxub.$$ https://github.com/FoxUserbot/FoxUserbot/archive/refs/heads/main.zip && (unzip foxub.$$ && rm -rf foxub.$$ && cd FoxUserbot-main && python3 -m venv venv && source venv/bin/activate && python3 main.py)
  • YUM (RHEL based)
yum -y update && yum install wget python3 python3-pip curl unzip -y && wget -O foxub.$$ https://github.com/FoxUserbot/FoxUserbot/archive/refs/heads/main.zip && (unzip foxub.$$ && rm -rf foxub.$$ && cd FoxUserbot-main && python3 -m venv venv && source venv/bin/activate && python3 main.py)
  • PACMAN (Arch based)
pacman -Sy python3 python-pip wget curl unzip && wget -O foxub.$$ https://github.com/FoxUserbot/FoxUserbot/archive/refs/heads/main.zip && (unzip foxub.$$ && rm -rf foxub.$$ && cd FoxUserbot-main && python3 -m venv venv && source venv/bin/activate && python3 main.py)
  • EMERGE (Gentoo)
emerge python dev-python/virtualenv wget net-misc/curl unzip && python3 <(curl -sSL https://bootstrap.pypa.io/get-pip.py) && wget -O foxub.$$ https://github.com/FoxUserbot/FoxUserbot/archive/refs/heads/main.zip && (unzip foxub.$$ && rm -rf foxub.$$ && cd FoxUserbot-main && python3 -m venv venv && source venv/bin/activate && python3 main.py)
  • APK (Alpine)
apk update && apk add python3 wget unzip && wget -O foxub.$$ https://github.com/FoxUserbot/FoxUserbot/archive/refs/heads/main.zip && (unzip foxub.$$ && rm -rf foxub.$$ && cd FoxUserbot-main && python3 -m venv venv && source venv/bin/activate && python3 main.py)
  • FreeBSD
pkg update && pkg install -y python3 py39-pip wget unzip ; python -m venv venv ; source venv/bin/activate ; pip install -U pip ; wget -O foxub.zip https://github.com/FoxUserbot/FoxUserbot/archive/refs/heads/main.zip ; unzip foxub.zip ; cd FoxUserbot-main ; python main.py
  • MacOS
xcode-select --install ; /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" && brew install python3 && pip3 install --upgrade pip && pip3 install wheel && brew install wget unzip && wget -O foxub.$$ https://github.com/FoxUserbot/FoxUserbot/archive/refs/heads/main.zip && (unzip foxub.$$ && rm foxub.$$ && cd FoxUserbot-main && python3 -m venv venv && source venv/bin/activate && python3 main.py)
  • Docker
docker build -t foxuserbot .
docker run -it foxuserbot

Important

If you get an error like:

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide..

Type in terminal:

python3 -m venv venv
source venv/bin/activate
python main.py

How to start?

cd FoxUserbot-main ; source venv/bin/activate ; python3 main.py

Windows

Install

  • Download and Unzip This file

  • Open windows.bat

How to start

  • Open windows.bat

Other:

How to start in repl.it or google colab?

Run on Repl.it

Run on colab

Groups and support

Telegram

About

FoxUSERBOT | Telegram Userbot built with Kurigram (Pyrogram)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •