S
S
Stanislav2021-03-16 02:20:07
Python
Stanislav, 2021-03-16 02:20:07

Error: TeleBot: "Infinity polling exception: __init__() takes 1 positional argument but 2 were given". What should I do and how to decide?

import telebot
import random

bot = telebot.TeleBot('token')
spisochek = list()

@bot.message_handler(commands=['reg'])
class Bibi(object):
def __init__(self):
def registration(message):
spisochek = list()
self.spisochek = spisochek
nameid = message.from_user.username
spisochek.append(nameid)
bot.send_message(message.chat.id, spisochek)

@bot.message_handler(commands=['spisochek'])
def listochek (message):
bot.send_message(message.chat.id, self.spisochek)

bot.infinity_polling(True)

I'm new to python, and I'm not familiar with classes at all, explain - help. I'm still young - green!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question