Skip to content

Shineii86/AdLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

📢 AdLib

A lightweight library that centralizes advertisement management for your Bots.Business bot.
Provides a pool of promotional messages and a ready-to-use formatted footer – perfect for Telegram bots.


⚡ Features

  • Random ad selection – picks one ad from a curated list every time you call it.
  • Pre-formatted HTML footer – includes a styled ad block with a clickable attribution link (Quinx Ads).
  • Easy integration – publish once and call from any command using Libs.AdLib.
  • No external dependencies – works with the native Bots.Business API.

🗂 Repository Structure

To make the library importable via Git, your repository must contain a libs folder:

AdLab/
└── libs/
    └── AdLib.js

Optional: You can also include a commands folder with your bot’s command files – but be aware that a full import will replace your bot's existing commands. Back up your bot first!


🔧 Installation (Import via Git)

  1. Set up a Git repository (public or private) with the structure above.
  2. In the Bots.Business app, open your bot and go to Sync > Import from Git rep.
  3. Generate a Deploy Key and add the public key to your repository’s deploy keys (write access required).
  4. Enter your repo URL / branch and import.
  5. After a successful import, the library is loaded and ready to use.

⚠️ Warning: Importing from Git will erase all existing commands and libs in your bot. Always back up your current code first.


📖 Usage

Once imported, call the library’s functions from any command’s BJS code.

getAdFooter()

Returns an HTML-formatted string containing a random ad, wrapped in a blockquote, with an Ads: Quinx Ads header.

var footer = Libs.AdLib.getAdFooter();
Bot.sendMessage(footer);

getRandomAd()

Returns only the raw ad text (no formatting or links).

var adText = Libs.AdLib.getRandomAd();
Bot.sendMessage(adText);

Full example in a command

var msg = "<b>Welcome!</b> Here is today's recommendation.\n";
msg += Libs.AdLib.getAdFooter();

Api.sendMessage({
  chat_id: user.telegramid,
  text: msg,
  parse_mode: "HTML"
});

📋 Advertisements Pool

The library ships with a set of default ads (you can edit the advertisements array):

Channel Description
@MaximXEmojis Expressive emojis for every mood.
@MaximXStickers Vibrant and diverse sticker packs.
@MaximXBots Cutting-edge bots for fun, utility, and more.
@MaximXWallpaper Stunning wallpapers to revamp your device’s look.
@MaximXIcons Unique and stylish profile icons.
@MaximXAnime Curated anime recommendations and community discussions.

To add or remove ads, simply edit the array inside AdLib.js and re-import the repository.


🧩 Customization

  • Change the advertisements array to include your own promotional texts.
  • Modify the getAdFooter() function to adjust the HTML wrapper or attribution link.
  • After changes, commit them to your repository and re-import to update the library.

📜 License

This library is provided as-is for use in your own Bots.Business projects. You are free to modify and redistribute it. Attribution is appreciated but not required.


🙌 Credits

Powered by Bots.Business.

About

Centralized advertisement library for Bots.Business — random ad selection and formatted footers for Telegram bots.

Topics

Resources

License

Stars

Watchers

Forks

Contributors