Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

devancakra/Cryptodax-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Source Love License: MIT GitHub last commit PHP

Cryptodax-Bot

API Programming Assignment
Indodax Cryptocurrency Reading Through PHP-Based Telegram Bot



Project Requirements

Part Description
Features Read, Error Handling
Code PHP
Framework Botman
Tools XAMPP (PHP Version 7.4) & Ngrok



Download & Install

  1. XAMPP with PHP version 7.4

    https://bit.ly/XAMPP_PHP7_Installer
    

  2. Ngrok

    https://bit.ly/NGROK_Installer
    

  3. Composer

    https://bit.ly/Composer_Installer
    

  4. Git

    https://bit.ly/GIT_Installer
    



Get Started

  1. Download this repository and extract it.

  2. Move the Cryptodax-Bot directory into the htdocs directory, whose details you can find out as follows: C:\xampp\htdocs.

  3. Open XAMPP, then start the Apache section.

  4. Create an Ngrok account first on the following page: https://dashboard.ngrok.com/login.

  5. Connect the ngrok account in the following way:

    ngrok config add-authtoken [YOUR NGROK AUTHTOKEN]

  6. Open the ngrok.yml file in the C:\Users\[User Name]\AppData\Local\ngrok directory, then set the tunnels to be used for multiple ports in one go by writing this command in it:

    version: "2"
    authtoken: [YOUR NGROK AUTHTOKEN]
    tunnels:
      tunnel-1:
        proto: http
        addr: 80
        schemes: ["https"]
      tunnel-2:
        proto: http
        addr: 80
        schemes: ["http", "https"]

  7. Type the following command into NGROK.exe and press enter:

    ngrok start --all

  8. Copy your Telegram Bot API from @BotFather and paste it into the following folder (directory): Cryptodax-Bot -> private -> token.txt.

  9. Open CMD (Command Prompt) and type the command with the following rules to run the bot:
    curl -d url=[URL Https NGROK]/[Folders If Any]/bot.php -X POST https://api.telegram.org/bot[TOKEN]/setWebhook

    • Writing example:

    curl -d url=https://e6e5-2001-448a-5021-617-ecb0-7d4d-1d9e-27f2.ngrok-free.app/Cryptodax-Bot/bot.php -X POST https://api.telegram.org/bot1496456979:AAE7MCBAeRznBN3G-E4J65GgVYzHo0oZmog/setWebhook 

    • The result will appear (Bot sign is already working / active): {"ok":true,"result":true,"description":"Webhook was set"}.

  10. If you want to complete the running webhook session, then please open the browser by typing the following command:

    https://api.telegram.org/bot[TOKEN]/setWebhook



Issues that frequently arise

  1. The problem that usually occurs with Botman-based telegram bots is when the user has left the bot for a long period of time, this can cause the API Token to expire. This problem is usually characterized by an abnormal state of the telegram bot, for example when the user gives the command /start or other commands, this bot still does not respond. The solution to this problem is that you only need to create a new telegram bot again (automatically get a new API Token), then for the program code, please set it based on your own needs.

  1. If the problem in point 1 is not resolved, then you should :

    • Delete 3 files in the C:\xampp\htdocs\Cryptodax-Bot directory, namely composer.json, composer.lock, and vendor.

    • Install the Botman depedency via GitBash by giving the following command:

    composer require "botman/driver-telegram"



Highlight

Telegram Bot
TGbot-1 TGbot-2 TGbot-3 TGbot-4
TGbot-5 TGbot-6 TGbot-7 TGbot-8
TGbot-9 TGbot-10 TGbot-11 TGbot-12



Demonstration of Application

Via Telegram: @cryptodax_bot



Appreciation

If this work is useful to you, then support this work as a form of appreciation to the author by clicking the ⭐Star button at the top of the repository.



Disclaimer

This application has been created by including third-party sources. Third parties here are service providers, whose services are in the form of libraries, frameworks, and others. I thank you very much for the service. It has proven to be very helpful and implementable.



LICENSE

MIT License - Copyright © 2020 - Devan Cakra Mudra Wijaya

Permission is hereby granted without charge to any person obtaining a copy of this software and the software-related documentation files to deal in them without restriction, including without limitation the right to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons receiving the Software to be furnished therewith on the following terms:

The above copyright notice and this permission notice must accompany all copies or substantial portions of the Software.

IN ANY EVENT, THE AUTHOR OR COPYRIGHT HOLDER HEREIN RETAINS FULL OWNERSHIP RIGHTS. THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, THEREFORE IF ANY DAMAGE, LOSS, OR OTHERWISE ARISES FROM THE USE OR OTHER DEALINGS IN THE SOFTWARE, THE AUTHOR OR COPYRIGHT HOLDER SHALL NOT BE LIABLE, AS THE USE OF THE SOFTWARE IS NOT COMPELLED AT ALL, SO THE RISK IS YOUR OWN.

About

API Programming Class | UPN Veteran Jatim | Indodax Cryptocurrency Reading Through PHP-Based Telegram Bot | Assignment

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages