Giter VIP home page Giter VIP logo

chatterm's Introduction

Bot Chat Term



Simple Chat Bot with smart Ai supported by regexp in every one of his dictionaries Built Using Bash Script

How to use in your script

#!/usr/bin/bash

source __main__.sh; {
        eval Bot || { cat <<< "[!] Gagal setup"; exit; }
}

while read -p "input : " inp; do
        Bot.config "sc/config.ash" "$inp"
        reply=$(Bot.App.run)
        if test "$inp" == "keluar"; then
                exit
        else echo "Bot   : $reply"; continue; fi
done

Fungsi:

  • Bot
  • : fungsi Bot merupakan oop dari Bot Chat
  • Bot.config "#path" "#variabel input"
  • : Bot.config berfungsi untuk menerima input dan mengimport kosa kata
  • Bot.App.run
  • : berfungsi untuk mengirimkan data dari config ke Ai serta menjalankan bot

    • bagaimana cara mengedit config nya?
      : anda bisa mengedit config pada directory sc dengan menggunakan text editor seperti nano atau lain nya, dan untuk syntax config nya menggunakan syntax bash pada umum nya untuk dictionary nya menggunakan array dengan nama msg#angka urut dan index [0,0,1] = sebagai input, [0,0,2] = sebagai output, dan input variabel user bisa di panggil di script misal nya seperti kolom di bawah ini

    simple config.sh

    # semisal saya mengeksekusi bot dengan nama variabel input, read -p "input : " input
    # jadi sesuaikan nama variabel dengan input pengguna jika ingin membuat fitur seperti di bawah ini
    
    # ini merupakan fungsi
    function random_number(){
      local get_arg=$(grep -o '[0-9]' <<< "$input")
      local newarray=(${get_arg})
      local getsize=$(sed 's/[[:space:]]/\n/g' <<< "${!newarray[@]}"|sort -nr|head -1)
    
      shuf -i 0-${getsize} -n 1
    }
    
    # ini merupakan konektor / database bot
    msg1=([0,0,1]="\"halo [a-z0-9]*$\" \"hai [a-z0-9]*$\"" [0,0,2]="\"hai juga\" \"halo juga\"")
    msg2=([0,0,1]="\"tolong berikan saya angka (acak|random) [a-z0-9]*$\"" [0,0,2]="\"$(random_number)\"")

    requirement : apt install jq curl html2text



    berhasil di termux

    chatterm's People

    Contributors

    bayu12345677 avatar

    Stargazers

     avatar  avatar

    Watchers

     avatar

    Forkers

    5l1v3r1

    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.