Files
Opening a files :
open()
Opening Editor files :
openLocal()
Logging
Normal logs :
print()
Errors logs :
error()
Time
Sleep :
sleep(time)
Thread
Async function :
thread func
Await for a async function :
wait
Importing other .ihat files
import syntax is :
import fileNameWithoutExtentionTo imort file under directory use :
import dirname/fileNameWithoutExtentionYou can nested dirname juste add them like
import dirname/nesteds dirname/fileNameWithoutExtention
extentionAPI
extentionAPI : call ichat api parms :
('apikey','bot name')extentionAPI.command : register command parms :
('commandName','callback on message')extentionAPI.command callback : returned :
message Object (more info in the message Object)extentionAPI.onMessage : called when user get a message return a
message Object (more info in the message Object)extentionAPI.embed : send embed parms that support line break and some markdown parms :
('message')extentionAPI.send : send message like a user parms :
('message')
Message Object
Message Object view
{ message : String }
Simple file opening
var file = open('example.txt') file.write('HI') print(file.read())
Basic extension
var ichat = extentionAPI('DevApiKey','BotName/ExtensionName') func welcome() { print('Welcome') ichat.send('Welcome to IC-hat') } ichat.command('welcome',welcome) // register command by passing command name and callback function
Get api key
To obtain an API key, visit this page. Here, you can set the key you want to use for your account.
Please note that unpublished extensions require an API key and they are a limited to the connected chat Tab only.
Get Logs
advenced logs are not available