def print_history(self, response, channel_name):
os.system("clear; figlet '" + channel_name + "' | lolcat")
response["messages"].reverse()
text = ""
for i in response["messages"]:
if "user" in i:
text += "\033[31m" + self.find_user_name(i["user"]) + "\033[0m" + "\t\t"
elif "username" in i:
text += "\033[31m" + (i["username"].encode('ascii', 'ignore').decode('ascii')) + "\033[0m" + "\t"
text += "\033[93m" + time.ctime(float(i["ts"])) + "\033[0m" + "\n"
# replace username_id with username
if "<@" in i["text"]:
i["text"] = "<" + i["text"].split("|")[1]
text += (i["text"].encode('ascii', 'ignore').decode('ascii')) + "\n\n"
os.system("echo ' " + text + "'")
text = ""
评论列表
文章目录