Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

telegram Bot #385

Closed
ratdriftbot opened this issue Oct 28, 2021 · 6 comments
Closed

telegram Bot #385

ratdriftbot opened this issue Oct 28, 2021 · 6 comments

Comments

@ratdriftbot
Copy link

escho 7.txt
Where is my mistakes?
Где мои ошибки?

@Epy
Copy link

Epy commented Oct 31, 2021

Seems to be spam ?

@ratdriftbot
Copy link
Author

ratdriftbot commented Oct 31, 2021 via email

@geofbaum
Copy link

geofbaum commented Nov 1, 2021

@ratdriftbot No offense to you or your code but I think @Epy isn't referring to the fact that you opened this issue asking for help with your mistake. It's more so about the fact that you opened another one solely to mention this one, and then mentioned this one again on two other issues. All of this is without any further information regarding your actual issue that doesn't require someone to click on a possibly dubious link. If you want help you need to put in the errors your seeing and your code into the actual Issue you're raising not simply adding a link and asking what's wrong.

All of the above screams spam and/or bot so if you'd like help you need to be able to post the appropriate errors and your code in this issue if you'd like help from others trying to fix it.

@csparpa
Copy link
Owner

csparpa commented Nov 1, 2021

@ratdriftbot @Epy @geofbaum I've been bold enough to click on the link.. a txt file is shown containing @ratdriftbot 's code. But yes, it'd be better not to post here links to external resources unless absolutely necessary: code can indeed be posted here

@ratdriftbot - please, remove your OWM and Telegram API keys from that file and change them in your production settings, as they might have been compromised then

As regards the code - here is the relevant part

@bot.message_handler(content_types=['text'])
def weather(message):
    mgr = owm.weather_manager()
    observation = mgr.weather_at_place(message.text)
    w = observation.weather()   # <-------
    temp = w.temperature('celsius')["temp"]

    answer = "In city" + message.text + "Now" + w.detailed_status +"\n"
   # ...

Seems like the error is when you get the weather object: it should be w = observation.weather instead of w = observation.weather()

@Epy
Copy link

Epy commented Nov 1, 2021

Sorry for the mistake

You asked for help, no problem with that, but put a link to your post 3 times on unrelated or empty new subjects; these are spammers methods.

@csparpa
Copy link
Owner

csparpa commented Nov 10, 2021

@ratdriftbot is the code snippet working for you? Shall we close this issue ?

@csparpa csparpa closed this as completed Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants