Code Monkey home page Code Monkey logo

butcher's Introduction

Butcher is a telegram bot. It can save trades in a remote SQLite database

About

This project is a simple ASP.NET Core application, which provides webhook endpoint for the Telegram Bot.

You can find useful information on setting up webhook for your bot in official docs:

Setup

Please make sure you have .NET 6 or newer installed. You can download .NET runtime from the official site. This is a short description how you can test your bot locally. The description presumes that you already have a bot and it’s token. If not, please create one. You’ll find several explanations on the internet how to do this.

Bot configuration

You have to specify your Bot token in appsettings.json. Replace {BotToken} in appsettings.json with actual Bot token. Also you have to specify endpoint, to which Telegram will send new updates with HostAddress parameter:

"BotConfiguration": {
    "BotToken": "{BotToken}",
    "HostAddress": "https://mydomain.com"
}

you can specify separate development configuration with appsettings.Development.json.

Ngrok

Ngrok gives you the opportunity to access your local machine from a temporary subdomain provided by ngrok. This domain can later send to the telegram API as URL for the webhook. Install ngrok from this page: ngrok - download or via homebrew cask:

brew install --cask ngrok

and start ngrok on port 8443.

ngrok http 8443 

Telegram API only supports the ports 443, 80, 88 or 8443. Feel free to change the port in the config of the project.

Set Webhook

From ngrok you get an URL to your local server. It’s important to use the https one. You can manually set webhook with setWebhook API call, providing this URL as form-data (key: url, value: https://yoursubdomain.ngrok.io/api/update).

Run Bot

Now you can start the Bot in a local instance. Check if the port of the application matches the port on which ngrok is running.

Now your bot should answer with the text from every message you send to it.

butcher's People

Contributors

mortzi avatar

Watchers

 avatar

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.