View difference between Paste ID: MrHjtwSq and rQtUva8Q
SHOW: | | - or go back to the newest paste.
1-
#Comando start
1+
Edu <- [-32461390]: /stop
2-
@bot.message_handler(commands=['start'])
2+
Exception in thread WorkerThread7:
3-
def command_start(m):
3+
Traceback (most recent call last):
4-
    cid = m.chat.id
4+
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
5-
    consulta = "select id from usuarios where id=%d"%(cid)
5+
    self.run()
6
  File "/usr/local/lib/python2.7/dist-packages/telebot/__init__.py", line 42, in run
7-
    resultado = cursor.fetchone()
7+
    task(*args, **kwargs)
8-
    if resultado == None: # Con esta sentencia, hacemos que solo se ejecute lo de abajo cuando un usuario hace uso del bot por primera vez.
8+
  File "/home/ubuntu/workspace/LCS_bot/LCS_bot.py", line 298, in command_start
9-
        consulta="insert into usuarios values(%d)"%(cid)
9+
10-
        cursor.execute(consulta)
10+
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute
11-
        bot.send_message( cid, "Bienvenido a @League_of_Legends_bot\nWelcome to @League_of_Legends_bot\n______________________\nEste es un bot en español desarrollado por @Edurolp\nThis is a bot in Spanish designed by @Edurolp\n______________________\nEspero que te guste ^^\nI hope you like it ^^")
11+
    self.errorhandler(self, exc, value)
12-
        command_help(m) # Forzamos mensaje de bienvenida al usar el bot por primera vez.
12+
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
13-
        print "-> [" + str(cid) + "]: Comando /start utilizado"
13+
    raise errorclass, errorvalue
14-
        alias = "@" + str(m.from_user.username)
14+
IntegrityError: (1062, "Duplicate entry '-32461390' for key 'PRIMARY'")