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