Exemplo n.º 1
0
    async def scream(self, tools: objects.tools, package: objects.package):
        if set(tools.getBotMentions()) & set(package.params.mentions) != set():
            await tools.api.messages.send(random_id=tools.gen_random(),
                                          peer_id=package.peer_id,
                                          message=self.gen())

            return None
Exemplo n.º 2
0
 async def helpy(self, tools: objects.tools, package: objects.package):
     await tools.api.messages.send(
         random_id=tools.gen_random(),
         peer_id=package.peer_id,
         message=("Допустимые клички: \n{listitem} " +
                  "\n{listitem} ".join(tools.mentions)).format(
                      listitem=tools.values.LISTITEM))
Exemplo n.º 3
0
    async def second(self, tools: objects.tools, package: objects.package):
        await tools.api.messages.send(
            random_id = tools.gen_random(),
            peer_id = package.peer_id,
            message = 'выхожу из фреймворка...'
        )

        raise exceptions.Quit("test") # -> to finish your framework (closing all projects that was launched by tppm)
Exemplo n.º 4
0
 async def second2(self, tools: objects.tools, package: objects.package):
     await tools.api.messages.send(
         random_id = tools.gen_random(),
         peer_id = package.peer_id,
         message = 'перезагружаю...'
     )
     
     raise exceptions.LibraryReload("Reload") # -> framework will reload your library
Exemplo n.º 5
0
    async def generate(self, tools: objects.tools, package: objects.package):
        counter = int(package.items[1])

        if counter == 0:
            await tools.api.messages.send(random_id=tools.gen_random(),
                                          peer_id=package.peer_id,
                                          message=self.err)

        else:
            if package.items[0] == 'спам':
                for count in range(counter):
                    await tools.api.messages.send(random_id=tools.gen_random(),
                                                  peer_id=package.peer_id,
                                                  message=self.mention)

            else:
                for count in range(counter):
                    await tools.api.messages.send(random_id=tools.gen_random(),
                                                  peer_id=package.peer_id,
                                                  message=self.gen())
Exemplo n.º 6
0
 async def start(self, tools: objects.tools):
     self.message = """OLD TOOLS METHODS
Exemplo n.º 7
0
 async def tools_info(self, tools: objects.tools, package: objects.package):
     await tools.api.messages.send(
         random_id = tools.gen_random(),
         peer_id = package.peer_id,
         message = self.message
     )
Exemplo n.º 8
0
 async def ContextCommands(self, tools: objects.tools,
                           package: objects.package):
     await tools.api.messages.send(random_id=tools.gen_random(),
                                   peer_id=package.peer_id,
                                   message="А чё")
Exemplo n.º 9
0
 async def help(self, tools: objects.tools, package: objects.package):
     await tools.api.messages.send(random_id=tools.gen_random(),
                                   peer_id=package.peer_id,
                                   message=self.description)
Exemplo n.º 10
0
 async def start(self, tools: objects.tools):
     self.description = self.description.format(
         listitem=tools.values.LISTITEM, mention=tools.getBotLink())
     self.err = self.err.format(mention=tools.getBotLink())