From now on, you can rebuild the Rubika application
SDK >= 49
PROGRAMMER : MOHAMMAD AFRWZEH
-
fix downloadFile method
-
add downloadAvatar method
npm install expo-rubika
import {Crypto} from "expo-rubika";
let encryption = new Crypto(auth,privateKey)
import {Client} from "expo-rubika";
let bot = new Client(auth, privateKey, platform)
import {Client} from "expo-rubika";
let bot = new Client(auth, privateKey, platform)
bot.onMessage(update=>{
console.log(update)
},{
onClose:(e)=>{
console.log("ws closed.")
}
//more events
})
import {Login} from "expo-rubika";
let login = new Login(platform,regestring,appName) //platform : android or web
// regestring value is true or false : true for auto register auth
let sendCodeData = await login.sendCode(phoneNumber)
/*
more code ...
*/
import {Rubino} from "expo-rubika";
let rubino = new Rubino(auth,platform)
//platform in Rubino is : android or ios or pwa
- android
- ios
- pwa
- web
- getMethods
- getMethodInfo
- getEvents
- getFileBuffer
- getFileMime
- getFileName
- getFileSize
- getChatTypeByGuid
- getAudioInfo
- getImageDimensions
- getMusicInfo
- getNowTime
- getStateTime
- getVideoInfo
- getVideoThumbnail
- responseToBuffer
- concatBuffer
- createFileInline
- createImageThumbnail
import {Client, Tools} from "expo-rubika"
let bot = new Client(auth,privateKey,platform)
let methods = Tools.getMethods(bot) // [method1,method2,...]
import {Client, Tools} from "expo-rubika"
let bot = new Client(auth,privateKey,platform)
let methods = Tools.getMethodInfo(bot.sendMessage)
whats is options argument ?
options argument is object for handling events
import {Client} from "expo-rubika";
let bot = new Client(auth, privateKey, platform)
await bot.sendMessage(chat_id,text,null,null,{
onStartRequest:(e)=>{e.cancelRequest()}
})
- onStartRequestFile (upload)
- onEndRequestFile (upload)
- onSuccessRequestFile (upload)
- onErrorRequestFile (upload)
- onStartUpload (upload)
- onUploadPartSend (upload)
- onEndUpload (upload)
- onErrorUpload (upload)
- onUploadCanceled (upload)
- onErrorRequest (methods)
- onStartRequest (methods)
- onSendRequest (methods)
- onCancelRequest (methods)
- onOpen (onMessage)
- onError (onMessage)
- onClose (onMessage)
- onMessage (onMessage)
- onDownloadStart (download)
- onDownloadPart (download)
- onDownloadEnd (download)
- onDownloadCanceled (download)
support markdown text syntax in send message methods
import {Client} from "expo-rubika";
let bot = new Client(auth, privateKey, platform)
await bot.sendMessage(chat_id,"__italic__ **bold** ``mono`` ~~strike~~ --underline-- @@Mention@@(url or chat_id) ##spoiler##")