Giter VIP home page Giter VIP logo

alya-bot's Introduction

ALYA-BOT V4.1-RC

An implementation of @neoxr/wb which has been optimized to be lightweigth.

Requirements

  • NodeJS v14
  • FFMPEG
  • Server vCPU/RAM 1/2GB (Min)

Configuration

There are 2 configuration files namely .env, config.js and config.json, adjust them before installing.

{
   "owner": "62626262626262",
   "owner_name": "alya",
   "database": "data",
   "limit": 15,
   "ram_limit": "900mb",
   "max_upload": 50,
   "max_upload_free": 10,
   "cooldown": 3,
   "timer": 180000,
   "timeout": 1800000,
   "blocks": ["994", "91", "92"],
   "evaluate_chars":  ["=>", "~>", "<", ">", "$"]
}
### Database : https://www.mongodb.com/
DATABASE_URL = ''
global.APIs = {
   alya: 'https://api.alyachan.biz.id'
}
global.APIKeys = {
   'https://api.alyachan.biz.id': 'YOURKEY'
}

Notes :

  • ram_limit : ram usage limit, for example you have a server with 1gb of ram set before the maximum capacity is 900mb.

  • global.APIKeys : some of the features in this script use apikey, especially the downloader feature, to get an apiKey you can get it on the Alyachan Api's with prices that vary according to your needs.

  • DATABASE_URL : can be filled with mongo and postgresql URLs to use localdb just leave it blank and the data will be saved to the .json file.

Installation & Run

Make sure the configuration and server meet the requirements so that there are no problems during installation or when this bot is running, type this on your console :

$ yarn
$ node .

or want to use pm2

$ yarn
$ npm i -g pm2
$ pm2 start index.js && pm2 save && pm2 logs

Command Plugin

Command Plugin is a plugin that will run using the command.

exports.run = {
   usage: ['mediafire'],
   hidden: ['mf'],
   use: 'link',
   category: 'downloader',
   async: async (m, {
      client,
      args,
      text,
      isPrefix,
      command,
      env,
      Scraper,
      Func
   }) => {
      try {
         // do something
      } catch (e) {
         console.log(e)
         client.reply(m.chat, Func.jsonFormat(e), m)
      }
   },
   error: false,
   limit: true,
   restrict: true,
   cache: true,
   location: __filename
}

Up Side Options :

  • usage : main command that will automatically appear in the menu list, use of usage can be in the form of arrays and strings.

  • hidden : commands that are hidden from the menu list, suitable for command aliases or hidden features.

  • use : this parameter is optionally used when the plugin / feature requires input such as link, query, amount, etc.

  • category : categories for each plugin that the command will be arranged by category when the menu is displayed.

  • m : parameters that contain chat object.

  • client : parameter which contains several messaging functions from @neoxr/wb and default functions from Baileys.

  • args : nput given after command in the form of an array is usually found in downloader feature which uses links such as ig, youtube, fb, etc. Parsing based on index. (Example: args[1], args[2], args[3], ....)

  • text : input that is given after command in the form of a string is usually found in search features that use queries/keywords such as lyrics, chords, yts, etc.

  • isPrefix : prefix used, if noprefix mode is active this parameter will be blank (it's no problem).

  • command : commands used can be used in an if else or switch case conditional when creating 1 plugin with several commands in it.

  • env : parameters that contain the configuration from the config.json file.

  • Scraper : parameter containing some of the scraper functions of @neoxr/wb module.

  • Func : parameter containing some of the utilites functions of @neoxr/wb module.

Down Side Options

  • error : not very useful :v

  • limit : limit the use of features with limits, to set the number of limits give integer data and for default is boolean true for 1.

  • premium : to create special features for premium users.

  • restrict : limit input, restricted input is in the form of badwords in db.setting.toxic.

  • cache : option to auto update when done recode.

  • __filename : file path for auto update

Other :

cmd.async(m, { client, args, text, isPrefix: prefix, prefixes, command, groupMetadata, participants, users, chats, groupSet, setting, isOwner, isAdmin, isBotAdmin, plugins, blockList, env, ctx, Func, Scraper })

Event Plugin

Event Plugin is a plugin that runs automatically without using the command.

exports.run = {
   async: async (m, {
      client,
      body,
      prefixes
   }) => {
      try {
         // do something
      } catch (e) {
         return client.reply(m.chat, Func.jsonFormat(e), m)
      }
   },
   error: false,
   cache: true,
   location: __filename
}
  • body : chat in the form of text or emoticons, this plugin is usually used for auto response or group protectors such as anti-links, anti-toxic etc.

  • prefixes : parameter which contains all prefixes in the form of an array, to use them parse based on index. (Example: prefixes[0]).

Other :

event.async(m, { client, body, prefixes, groupMetadata, participants, users, chats, groupSet, setting, isOwner, isAdmin, isBotAdmin, plugins, blockList, env, ctx, Func, Scraper })

Others please learn by yourself from other plugins.

Check this repository regularly to get updates because the progress base is not 100% yet, if you find an error, please make an issue. Thanks.

alya-bot's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.