Example #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
Example #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))
    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)
 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
Example #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())
Example #6
0
 async def start(self, tools: objects.tools):
     self.message = """OLD TOOLS METHODS
Example #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
     )
 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="А чё")
Example #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)
Example #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())