Code Monkey home page Code Monkey logo

Comments (4)

apiad avatar apiad commented on July 23, 2024

Hi,

You have to do one thing first, which is running the actual bot, it's explained further down in the Readme (https://github.com/apiad/logbot#setting-up-your-own) but basically it is just:

  • export TOKEN=<yourtoken>
  • python -m logbot

That will run the bot that will connect to Telegram and it will listen at localhost:6778 for the Client, which is what you run with the code you're showing. I used to have running on a public URL but it is down now.

Hope this helps, let me know if you need any clarification.
Cheers!

from logbot.

DrPaprikaa avatar DrPaprikaa commented on July 23, 2024

Thanks for the very quick answer !

Is it possible to store the token in a file of my project and not use the export option ?
Should I always start the bot (via python -m logbot) before running my script that contains the c.send("Hello World") part or is it a one-time thing ?

I'm saying all this trying to understand how it works, since my script is currently running on my PC but will eventually be running remotely from a Rasperry Pi.

from logbot.

apiad avatar apiad commented on July 23, 2024

Sure, don't be afraid to ask. I'm just happy someone is using this.

Usually, bots are run once and stay up. However, you can turn it off if you want, it all depends on your computational constraints. In this case, since the only user will be you, and you know exactly when you want the bot to be online, I think it's the same. However, if you plan to have the bot listening on some public IP so that different people can log to it, leaving it up will be the way to go. It's very lightweight in any case so there is no need, I think, to turn it off. Whatever is simpler for you.

Regarding the environment variables, I, unfortunately, didn't add a CLI option, but what you can do is in the bash line do everything, like:

TOKEN=<yourtoken> PORT=<yourport> python -m logbot

This is a bash thing, not anything specifically related to logbot. If it makes it any easier for you I can simply add a --token ... option to the CLI, but it's not going to save you any extra typing from the previous form. I haven't thought of config files but I could add that as well. Let me know if this is something you would like to have.

Cheers.

from logbot.

DrPaprikaa avatar DrPaprikaa commented on July 23, 2024

Thanks for the reply, I'll be looking into it !

from logbot.

Related Issues (1)

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.