Profilo di 
  
    pilotdamiano98
  
  
    
  
    
      
    
  
      
  
      
    | Nome | pilotdamiano98 | 
|---|---|
| Indirizzo email | n/a | 
| Messaggi | 4 | 
- 
      - 2021-04-04 14:54:04
- Re: ERRORE DI SINTASSI
- Forum >> Principianti
- grazie mille. il sintax checker non da errori, però non capisco come mai una volta messo su pythonanywhere, il mio bot non risponde alla frase impostata.
 mistero  
 
- 
      - 2021-04-04 13:56:46
- Re: ERRORE DI SINTASSI
- Forum >> Principianti
- Ciao Daniele. Non so se intendi ciò che ho fatto nella risposta sopra. Spero di sì.
 
 
 
 Comunque, la prima riga è semplicemente perché l'ho copiato dalla bash console di pythonanywhere.
 
 I due punti dopo if me ne sono accorto e li ho corretti subito, ma da errore di identazione. "Expected an indented block"
 
 
 --- Ultima modifica di pilotdamiano98 in data 2021-04-04 13:57:45 ---
 
 --- Ultima modifica di pilotdamiano98 in data 2021-04-04 13:58:16 ---
 --- Ultima modifica di pilotdamiano98 in data 2021-04-04 13:58:41 ---
 
- 
      - 2021-04-04 13:54:42
- Re: ERRORE DI SINTASSI
- Forum >> Principianti
- # This is a simple echo bot using the decorator mechanism. # It echoes any incoming text messages. import telebot API_TOKEN = 'your_api_token' bot = telebot.TeleBot(API_TOKEN) # Handle '/start' and '/help' @bot.message_handler(commands=['help', 'start']) def send_welcome(message): bot.reply_to(message, """\ Hi there, I am EchoBot. I am here to echo your kind words back to you. Just say anything nice and I'll say the exact same thing to you!\ """) # Handle all other messages with content_type 'text' (content_types defaults to ['text']) @bot.message_handler(func=lambda message: True) def echo_message(message): if message.text=='Spazzola suprema': bot.reply_to(message,'🎉 COMPLIMENTI Sei il Re Spazzola Suprema di oggi!') 
 
- 
      - 2021-04-04 11:13:14
- ERRORE DI SINTASSI
- Forum >> Principianti
- salve. stavo provando a creare un semplicissimo bot telegram e programmarlo con python. quando vado a caricare il codice su pythonanywhere, mi da errore di sintassi. il codice è il seguente (per ovvi motivi ho tolto il token API):
 
 >>> #!/usr/bin/python
 
 
 
 
 # This is a simple echo bot using the decorator mechanism.
 
 # It echoes any incoming text messages.
 
 
 
 
 import telebot
 
 
 
 
 API_TOKEN = 'your_api_token'
 
 
 
 
 bot = telebot.TeleBot(API_TOKEN)
 
 
 
 
 
 
 
 # Handle '/start' and '/help'
 
 @bot.message_handler(commands=['help', 'start'])
 
 def send_welcome(message):
 
 bot.reply_to(message, """\
 
 Hi there, I am EchoBot.
 
 I am here to echo your kind words back to you. Just say anything nice and I'll say the exact same thing to you!\
 
 """)
 
 
 
 
 
 
 
 # Handle all other messages with content_type 'text' (content_types defaults to ['text'])
 
 @bot.message_handler(func=lambda message: True)
 
 def echo_message(message):
 
 if message.text=='Spazzola suprema'
 
 bot.reply_to(message,'🎉 COMPLIMENTI Sei il Re Spazzola Suprema di oggi!')
 
 
 
 
 
 
 
 bot.polling()
 
 © 2021 GitHub, Inc.
 
 
 
  