def listusers(l, b, i): """ !d List all users who have files !r user """ b.l_say("Users:", i, 0) for f in os.listdir(os.path.join("..", "files", "users")): b.l_say(" %s" % (_random() + f.replace(".json", "")), i, 0) return True
def search(l, b, i): results = [] for note in listdir(path.join('..','files','notes')): if ' '.join(i.args[1:]) in note.replace('.txt',''): results.append(_random()+note+WHITE) if results == []: results.append('None') b.l_say('Notes that matched your query: %s' % ', '.join(results), i, 0) return True
def checko(l, b, i): letters = [] for f in os.listdir(os.path.join("..", "files", "mail")): if i.args[1] in f: try: mail = _random() + f.split(i.args[0] + " - ")[1].replace(".txt", "") letters.append(mail) except: continue if letters == []: b.l_say("User has mail :(", i, 0) return True b.l_say("Use %s.mail read <mail>%s: %s" % (GREY, WHITE, (WHITE + ", ").join(letters)), i, 0) return True
def list(l, b, i): notes = [] for file in listdir(path.join('..','files','notes')): notes.append(_random()+file.replace('.txt','')+WHITE) b.l_say(', '.join(notes), i, 0) return True