📈Example CHAT V1
example code of chat v1, Version 2.1.0
from PyCAI2 import PyCAI2
owner_id = '54dbda---------'
char = "piwvxvcMQFwb----------"
room_id = "TiqLm-------------"
voice_target = "E:\\FOLDER\\FOLDER\\FOLDER\\FOLDER\\FOLDER"
clinet = PyCAI2(owner_id)
message = input("You: ")
# VOICE FUNCTION
clinet.chat.voice(characterId=char,
room_id=room_id,
text=message,
voice_pth=voice_target)
# GET HISTORIES
clinet.chat.get_histories(char=char)
# GET HISTORY
history_id = clinet.chat.get_histories(char=char)
clinet.chat.get_history(history_id=history_id)
# SEND MESSAGE
clinet.chat.send_message(char=char,text=message)
# NEW CHAT
clinet.chat.new_chat(char=char)
Last updated