def addPutasPhraseAndUpdate(message): try: myfile = filemanager.MyFile('putasphrases', False, False, True) mytext = message.text + '\n' myfile.write_line(mytext.split(' ', 1)[1]) loadPutasPhrases() return True except: return False
def delPhraseAndUpdate(message): try: linenum = int(message.text.split(' ', 1)[1]) - 1 myglobals.PHRASES.pop(linenum) myfile = filemanager.MyFile('phrases', False, True, False) myfile.write_all(myglobals.PHRASES) loadPhrases() return True except: return False
def addPutasAndUpdate(message): try: myfile = filemanager.MyFile('putas', False, False, True) mytext = message.text + '\n' if '@' in mytext: myfile.write_line(mytext.split(' ', 1)[1]) loadPutas() return True else: return False except: return False
def loadChannels(): myfile = filemanager.MyFile('channels', True, False, False) myglobals.CHANNELS = myfile.read_lines()
def saveChannel(channel, write, append): myfile = filemanager.MyFile('channels', False, write, append) myfile.write_line(str(channel) + "\n") loadChannels()
def loadPutas(): myfile = filemanager.MyFile('putas', True, False, False) myglobals.PUTAS = myfile.read_lines()
def loadPutasPhrases(): myfile = filemanager.MyFile('putasphrases', True, False, False) myglobals.PUTASPHRASES = myfile.read_lines()