S
S
Suinny2018-10-22 00:08:29
Python
Suinny, 2018-10-22 00:08:29

How to link a VK community subscription check to a specific team ??

the bot needs to register a check for a subscription to a specific "coupon" command, with return 1 it should respond to the command, with 0 require a subscription. It's a little unclear how to do this.

def foo(hello):
    if hello.groups.isMember(group_id = 'zenbosen'):
        return 1
    hello.groups.join(group_id = 'zenbosen')  # ID Группы. Подписываемся
    return 'подпишись {0}'.format(hello.users.get()[0]['first_name'])

def hello():
   message = 'Ответ на\n"Купон'
   return message, ''

hello_command = command_system.Command()

hello_command.keys = ['купон']

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