123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361 |
- package main
- import (
- "fmt"
- "os"
- "regexp"
- "strconv"
- "strings"
- "syscall"
- "time"
- talkservice "github.com/bashery/linethrift"
- "github.com/bashery/botline/oop"
- "github.com/kardianos/osext"
- "github.com/tidwall/gjson"
- )
- func SendMycreator(from string) bool {
- if InArray2(MAKERS, from) {
- return true
- } else if UserBot.GetCreator(from) {
- return true
- }
- return false
- }
- func SendMyseller(from string) bool {
- if InArray2(MAKERS, from) {
- return true
- } else if UserBot.GetCreator(from) {
- return true
- } else if UserBot.GetSeller(from) {
- return true
- }
- return false
- }
- func SendMybuyer(from string) bool {
- if InArray2(MAKERS, from) {
- return true
- } else if UserBot.GetCreator(from) {
- return true
- } else if UserBot.GetSeller(from) {
- return true
- } else if UserBot.GetBuyer(from) {
- return true
- }
- return false
- }
- func SendMyowner(from string) bool {
- if InArray2(MAKERS, from) {
- return true
- } else if UserBot.GetCreator(from) {
- return true
- } else if UserBot.GetSeller(from) {
- return true
- } else if UserBot.GetBuyer(from) {
- return true
- } else if UserBot.GetOwner(from) {
- return true
- }
- return false
- }
- func SendMymaster(from string) bool {
- if InArray2(MAKERS, from) {
- return true
- } else if UserBot.GetCreator(from) {
- return true
- } else if UserBot.GetSeller(from) {
- return true
- } else if UserBot.GetBuyer(from) {
- return true
- } else if UserBot.GetOwner(from) {
- return true
- } else if UserBot.GetMaster(from) {
- return true
- }
- return false
- }
- func SendMyadmin(from string) bool {
- if InArray2(MAKERS, from) {
- return true
- } else if UserBot.GetCreator(from) {
- return true
- } else if UserBot.GetSeller(from) {
- return true
- } else if UserBot.GetBuyer(from) {
- return true
- } else if UserBot.GetOwner(from) {
- return true
- } else if UserBot.GetMaster(from) {
- return true
- } else if UserBot.GetAdmin(from) {
- return true
- }
- return false
- }
- func SendMygowner(group string, from string) bool {
- Room := oop.GetRoom(group)
- if InArray2(MAKERS, from) {
- return true
- } else if UserBot.GetCreator(from) {
- return true
- } else if UserBot.GetSeller(from) {
- return true
- } else if UserBot.GetBuyer(from) {
- return true
- } else if UserBot.GetOwner(from) {
- return true
- } else if UserBot.GetMaster(from) {
- return true
- } else if UserBot.GetAdmin(from) {
- return true
- } else if InArray2(Room.Gowner, from) == true {
- return true
- }
- return false
- }
- func SendMygadmin(group string, from string) bool {
- Room := oop.GetRoom(group)
- if InArray2(MAKERS, from) {
- return true
- } else if UserBot.GetCreator(from) {
- return true
- } else if UserBot.GetSeller(from) {
- return true
- } else if UserBot.GetBuyer(from) {
- return true
- } else if UserBot.GetOwner(from) {
- return true
- } else if UserBot.GetMaster(from) {
- return true
- } else if UserBot.GetAdmin(from) {
- return true
- } else if InArray2(Room.Gowner, from) {
- return true
- } else if InArray2(Room.Gadmin, from) {
- return true
- }
- return false
- }
- func InArrayInt64(arr []int64, str int64) bool {
- for _, tar := range arr {
- if tar == str {
- return true
- }
- }
- return false
- }
- func GetCodeprem(num int, sinder string, group string) bool {
- if num == 0 {
- if InArray2(MAKERS, sinder) {
- return true
- }
- } else if num == 1 {
- if SendMycreator(sinder) {
- return true
- }
- } else if num == 2 {
- if SendMyseller(sinder) {
- return true
- }
- } else if num == 3 {
- if SendMybuyer(sinder) {
- return true
- }
- } else if num == 4 {
- if SendMyowner(sinder) {
- return true
- }
- } else if num == 5 {
- if SendMymaster(sinder) {
- return true
- }
- return false
- } else if num == 6 {
- if SendMyadmin(sinder) {
- return true
- }
- } else if num == 7 {
- if SendMygowner(group, sinder) {
- return true
- }
- } else if num == 8 {
- if SendMygadmin(group, sinder) {
- return true
- }
- }
- return false
- }
- func PerCheckList() string {
- list := ""
- var test1 string
- if SetHelper.Rngcmd != nil {
- list += "✠ 𝗟𝗶𝘀𝘁 𝗽𝗲𝗿𝗺 :\n\n"
- for i := range SetHelper.Rngcmd {
- if SetHelper.Rngcmd[i] == 0 {
- test1 = "Maker"
- list += fmt.Sprintf("%v : %v\n", i, test1)
- } else if SetHelper.Rngcmd[i] == 1 {
- test1 = "Creator"
- list += fmt.Sprintf("%v : %v\n", i, test1)
- } else if SetHelper.Rngcmd[i] == 2 {
- test1 = "Seller"
- list += fmt.Sprintf("%v : %v\n", i, test1)
- } else if SetHelper.Rngcmd[i] == 3 {
- test1 = "Buyer"
- list += fmt.Sprintf("%v : %v\n", i, test1)
- } else if SetHelper.Rngcmd[i] == 4 {
- test1 = "Owner"
- list += fmt.Sprintf("%v : %v\n", i, test1)
- } else if SetHelper.Rngcmd[i] == 5 {
- test1 = "Master"
- list += fmt.Sprintf("%v : %v\n", i, test1)
- } else if SetHelper.Rngcmd[i] == 6 {
- test1 = "Admin"
- list += fmt.Sprintf("%v : %v\n", i, test1)
- } else if SetHelper.Rngcmd[i] == 7 {
- test1 = "Gowner"
- list += fmt.Sprintf("%v : %v\n", i, test1)
- } else if SetHelper.Rngcmd[i] == 8 {
- test1 = "Gadmin"
- list += fmt.Sprintf("%v : %v\n", i, test1)
- }
- }
- }
- return list
- }
- func Addpermcmd(client *oop.Account, to string, test1 string, test2 string) {
- x := 0
- numr := 0
- list := ""
- if test1 == "maker" {
- x = 0
- } else if test1 == "creator" {
- x = 1
- } else if test1 == "seller" {
- x = 2
- } else if test1 == "buyer" {
- x = 3
- } else if test1 == "owner" {
- x = 4
- } else if test1 == "master" {
- x = 5
- } else if test1 == "admin" {
- x = 6
- } else if test1 == "gowner" {
- x = 7
- } else if test1 == "gadmin" {
- x = 8
- } else {
- list += "Rank not found.\nUse .perm <rank> <command>\nAvailable ranks: \nbuyer/owner/master/admin/gowner/gadmin."
- }
- if list != "Rank not found.\nUse .perm <rank> <command>\nAvailable ranks: \nbuyer/owner/master/admin/gowner/gadmin." {
- cmd2 := test2
- _, value := SetHelper.Rngcmd[cmd2]
- if value == true {
- if SetHelper.Rngcmd[cmd2] != x {
- SetHelper.Rngcmd[cmd2] = x
- numr = 5
- }
- } else {
- list += "Command not found.\nUse ths Command First."
- }
- }
- if list != "Rank not found.\nUse .perm <rank> <command>\nAvailable ranks: \nbuyer/owner/master/admin/gowner/gadmin." {
- if list != "Command not found.\nUse ths Command First." {
- if numr != 5 {
- cmd1 := test1
- cmd2 := test2
- list += fmt.Sprintf("%v is already a %v command.\n", cmd2, cmd1)
- } else {
- cmd1 := test1
- cmd2 := test2
- list += fmt.Sprintf("Changed permission to %v for: %v \n", cmd1, cmd2)
- }
- client.SendMessage(to, list)
- } else {
- client.SendMessage(to, list+"\n")
- }
- } else {
- client.SendMessage(to, list+"\n")
- }
- }
- func GetComs(gr int, data string) int {
- defer oop.PanicOnly()
- _, value := SetHelper.Rngcmd[data]
- if value == false {
- SetHelper.Rngcmd[data] = gr
- }
- xx := SetHelper.Rngcmd[data]
- return xx
- }
- func CheckAccount(user string) *oop.Account {
- for _, cl := range ClientBot {
- if cl.MID == user {
- return cl
- }
- }
- return nil
- }
- func Checkuser(client *oop.Account, group string) ([]*oop.Account, []string) {
- list := []string{}
- err, _, memlist := client.GetGroupMembers(group)
- if err != nil {
- return nil, list
- }
- exe := []*oop.Account{}
- for mid, _ := range memlist {
- if InArray2(Squadlist, mid) {
- cl := CheckAccount(mid)
- if !cl.Limited {
- exe = append(exe, cl)
- }
- } else if MemUser(group, mid) {
- list = append(list, mid)
- }
- }
- if len(exe) != 0 && len(list) != 0 {
- return exe, list
- }
- return nil, list
- }
- func CheckBan(client *oop.Account, group string) []string {
- list := []string{}
- err, _, memlist := client.GetGroupMembers(group)
- if err != nil {
- return list
- }
- for mid, _ := range memlist {
- if MemUser(group, mid) {
- if MemBan(group, mid) {
- list = append(list, mid)
- }
- }
- }
- return list
- }
- func GETgrade(num int) string {
- if num == 0 {
- return "Maker"
- } else if num == 1 {
- return "Creator"
- } else if num == 2 {
- return "seller"
- } else if num == 3 {
- return "Buyer"
- } else if num == 4 {
- return "Owner"
- } else if num == 5 {
- return "Master"
- } else if num == 6 {
- return "Admin"
- } else if num == 7 {
- return "Gowner"
- } else if num == 8 {
- return "Gadmin"
- }
- return "None"
- }
- func Canceljoin(Client *oop.Account, Group string) {
- defer panicHandle("canceljoin")
- _, _, pind := Client.GetChatList(Group)
- for _, i := range pind {
- if oop.IsPending(Client, Group, i) == true {
- Client.CancelChatInvitations(Group, i)
- }
- }
- }
- func Nukjoin(Client *oop.Account, Optime int64, Group string) {
- defer panicHandle("Nukejoin")
- _, ok := Ceknuke.Get(Optime)
- if !ok {
- Ceknuke.Set(Optime, 1)
- } else {
- return
- }
- exe, list := Checkuser(Client, Group)
- if exe != nil {
- no := 0
- i := 0
- lm := len(list)
- acts := []*oop.Account{}
- var cl *oop.Account
- for ; i < lm; i++ {
- if no >= len(exe) {
- no = 0
- }
- acts = append(acts, exe[no])
- no += 1
- }
- for n, target := range list {
- go func(n int, target string) {
- cl = acts[n]
- cl.DeleteOtherFromChats(Group, target)
- }(n, target)
- }
- }
- }
- func RemoveSticker(items []*Stickers, item *Stickers) []*Stickers {
- defer oop.PanicOnly()
- newitems := []*Stickers{}
- for _, i := range items {
- if i != item {
- newitems = append(newitems, i)
- }
- }
- return newitems
- }
- func AutopurgeEnd(client *oop.Account, Group string, mem []string) {
- defer panicHandle("AutopurgeEnd")
- for _, target := range mem {
- client.DeleteOtherFromChats(Group, target)
- }
- }
- func AppendLastSticker(s []*Stickers, e *Stickers) []*Stickers {
- defer oop.PanicOnly()
- s = RemoveSticker(s, e)
- s = append(s, e)
- if len(s) >= 1000 {
- s = s[100:]
- return s
- }
- return s
- }
- func CheckMessage(waktu int64, typ int8) bool {
- if typ == 1 {
- for _, wkt := range timeSend {
- if wkt == waktu {
- return false
- break
- }
- }
- timeSend = append(timeSend, waktu)
- return true
- }
- return false
- }
- func Remove(s []string, r string) []string {
- new := make([]string, len(s))
- copy(new, s)
- for i, v := range new {
- if v == r {
- return append(new[:i], new[i+1:]...)
- }
- }
- return s
- }
- func fmtDuration(d time.Duration) string {
- d = d.Round(time.Second)
- x := d
- h := d / time.Hour
- d -= h * time.Hour
- m := d / time.Minute
- d -= m * time.Minute
- if x < 60*time.Second {
- return fmt.Sprintf("%v", x)
- } else if x < 3600*time.Second {
- return fmt.Sprintf("%02dMinutes's", m)
- } else if x < 86400*time.Second {
- return fmt.Sprintf("%02dHour's %02dMinute's", h%24, m)
- } else {
- return fmt.Sprintf("%02dDay's %02dHour's %02dMinute's", h/24, h%24, m)
- }
- }
- func CancelEnd(client *oop.Account, Group string, mem []string) {
- defer panicHandle("CancelEnd")
- for _, target := range mem {
- client.CancelChatInvitations(Group, target)
- }
- }
- func Setpurgealln(client *oop.Account, to string, invits []string) {
- for _, cc := range invits {
- if oop.IsMembers(client, to, cc) == true {
- client.DeleteOtherFromChats(to, cc)
- } else if oop.IsPending(client, to, cc) == true {
- client.CancelChatInvitations(to, cc)
- }
- }
- }
- func SelectBot(client *oop.Account, to string) (*oop.Account, error) {
- err, _, memlist := client.GetGroupMembers(to)
- if err != nil {
- return nil, err
- }
- exe := []*oop.Account{}
- for mid, _ := range memlist {
- if InArray2(Squadlist, mid) {
- cl := GetKorban(mid)
- if !cl.Limited {
- exe = append(exe, cl)
- }
- }
- }
- if len(exe) != 0 {
- return exe[0], err
- }
- return nil, err
- }
- func CheckBot(client *oop.Account, to string) (*oop.Account, error) {
- err, _, memlist := client.GetGroupMembers(to)
- if err != nil {
- return nil, err
- }
- exe := []*oop.Account{}
- for mid, _ := range memlist {
- if InArray2(Squadlist, mid) {
- cl := GetKorban(mid)
- if !cl.Limited {
- exe = append(exe, cl)
- }
- }
- }
- if len(exe) != 0 {
- return exe[0], err
- }
- return nil, err
- }
- func GetKorban(user string) *oop.Account {
- for _, cl := range ClientBot {
- if cl.MID == user {
- return cl
- }
- }
- return nil
- }
- func squadMention(mlist []string) (m *oop.Account, b bool) {
- for _, l := range mlist {
- if InArray2(Squadlist, l) {
- cl := GetKorban(l)
- return cl, true
- }
- }
- return nil, false
- }
- func StripOut(kata string) string {
- kata = strings.TrimSpace(kata)
- return kata
- }
- func Setinviteto(client *oop.Account, to string, invits []string) {
- news := []string{}
- for _, cc := range invits {
- if oop.IsMembers(client, to, cc) == false && oop.IsPending(client, to, cc) == false {
- news = append(news, cc)
- }
- }
- if len(news) != 0 {
- client.InviteIntoChatPollVer(to, news)
- }
- }
- func Setinvitetomsg(client *oop.Account, to string, invits []string) []string {
- defer panicHandle("Setinvitetomsg")
- bans := []string{}
- news := []string{}
- room := oop.GetRoom(to)
- exe := room.HaveClient
- for _, cc := range invits {
- if oop.IsMembers(client, to, cc) == false && oop.IsPending(client, to, cc) == false {
- if !MemBan(to, cc) {
- if oop.IsFriends(client, cc) == false {
- client.FindAndAddContactsByMidnew(cc)
- time.Sleep(250 * time.Millisecond)
- }
- news = append(news, cc)
- } else {
- bans = append(bans, cc)
- }
- }
- }
- if len(news) != 0 && len(exe) != 0 {
- celek := len(news)
- no := 0
- bat := 5
- ClAct := len(exe)
- if ClAct != 0 {
- if celek < bat {
- for _, cl := range exe {
- cl.GetRecommendationIds()
- for _, mid := range news {
- oop.AddContact3(cl, mid)
- }
- fl, _ := cl.GetAllContactIds()
- bb := []string{}
- for _, mid := range news {
- if InArray2(fl, mid) {
- bb = append(bb, mid)
- news = Remove(news, mid)
- }
- }
- if len(bb) != 0 {
- cl.InviteIntoGroupNormal(to, bb)
- }
- if len(news) == 0 {
- break
- }
- }
- } else {
- hajar := []string{}
- z := celek / bat
- y := z + 1
- for i := 0; i < y; i++ {
- if no >= ClAct {
- no = 0
- }
- client := exe[no]
- if i == z {
- hajar = news[i*bat:]
- } else {
- hajar = news[i*bat : (i+1)*bat]
- }
- if len(hajar) != 0 {
- client.GetRecommendationIds()
- for _, mid := range hajar {
- oop.AddContact3(client, mid)
- }
- fl, _ := client.GetAllContactIds()
- bb := []string{}
- for _, mid := range hajar {
- if InArray2(fl, mid) {
- bb = append(bb, mid)
- }
- }
- if len(bb) != 0 {
- client.InviteIntoGroupNormal(to, bb)
- }
- }
- no += 1
- }
- }
- }
- }
- return bans
- }
- func gettxt(from string, client *oop.Account, pesan string, rname string, sname string, Mid string, MentionMsg []string, group string) string {
- var txt string
- ca, ok := squadMention(MentionMsg)
- if ok {
- pr, _ := ca.GetContact(ca.MID)
- name := pr.DisplayName
- Vs := fmt.Sprintf("@%v", name)
- Vs = strings.ToLower(Vs)
- Vs = strings.TrimSuffix(Vs, " ")
- txt = strings.Replace(pesan, Vs, "", 1)
- txt = strings.TrimPrefix(txt, " ")
- for _, men := range MentionMsg {
- prs, _ := ca.GetContact(men)
- names := prs.DisplayName
- jj := fmt.Sprintf("@%v", names)
- jj = strings.ToLower(jj)
- jj = strings.TrimSuffix(jj, " ")
- txt = strings.Replace(txt, jj, "", 1)
- txt = StripOut(txt)
- }
- used = rname
- }
- if strings.HasPrefix(pesan, rname) {
- txt = strings.Replace(pesan, rname, "", 1)
- used = rname
- } else if strings.HasPrefix(pesan, sname) {
- txt = strings.Replace(pesan, sname, "", 1)
- used = sname
- }
- txt = StripOut(txt)
- return txt
- }
- func LogLast(op *talkservice.Operation, midds string) {
- defer oop.PanicOnly()
- if op.Type == 26 {
- if op.Message.ContentType == 18 {
- return
- }
- }
- LastActive.Set(midds, op)
- }
- func LogOp(op *talkservice.Operation, client *oop.Account) {
- defer oop.PanicOnly()
- tipe := op.Type
- pelaku := op.Param2
- if tipe == 124 {
- if InArray2(Squadlist, pelaku) {
- return
- }
- LogLast(op, pelaku)
- } else if tipe == 133 {
- if InArray2(Squadlist, pelaku) {
- return
- }
- LogLast(op, pelaku)
- } else if tipe == 130 {
- if InArray2(Squadlist, pelaku) {
- return
- }
- LogLast(op, pelaku)
- } else if tipe == 122 {
- if InArray2(Squadlist, pelaku) {
- return
- }
- LogLast(op, pelaku)
- } else if tipe == 55 {
- if InArray2(Squadlist, pelaku) {
- return
- }
- LogLast(op, pelaku)
- } else if tipe == 128 {
- if InArray2(Squadlist, pelaku) {
- return
- }
- LogLast(op, pelaku)
- } else if tipe == 26 {
- msg := op.Message
- if InArray2(Squadlist, msg.From_) {
- return
- }
- LogLast(op, msg.From_)
- }
- }
- func Setkickto(client *oop.Account, to string, invits []string) {
- defer panicHandle("Setkickto")
- for _, cc := range invits {
- if oop.IsMembers(client, to, cc) == true {
- client.DeleteOtherFromChats(to, cc)
- }
- }
- }
- func addCon(cons []string) {
- n := 0
- for _, con := range cons {
- for _, cl := range ClientBot {
- fl, _ := cl.GetAllContactIds()
- if !InArray2(fl, con) && con != cl.MID && !cl.Limitadd {
- cl.FindAndAddContactsByMidnew2(con)
- time.Sleep(3 * time.Second)
- }
- }
- n += 1
- }
- }
- func ReloginProgram() error {
- file, err := osext.Executable()
- if err != nil {
- return err
- }
- err = syscall.Exec(file, os.Args, os.Environ())
- if err != nil {
- return err
- }
- return nil
- }
- func GenerateTimeLog(client *oop.Account, to string) {
- loc, _ := time.LoadLocation("Asia/Jakarta")
- a := time.Now().In(loc)
- yyyy := strconv.Itoa(a.Year())
- MM := a.Month().String()
- dd := strconv.Itoa(a.Day())
- hh := a.Hour()
- mm := a.Minute()
- ss := a.Second()
- var hhconv string
- var mmconv string
- var ssconv string
- if hh < 10 {
- hhconv = "0" + strconv.Itoa(hh)
- } else {
- hhconv = strconv.Itoa(hh)
- }
- if mm < 10 {
- mmconv = "0" + strconv.Itoa(mm)
- } else {
- mmconv = strconv.Itoa(mm)
- }
- if ss < 10 {
- ssconv = "0" + strconv.Itoa(ss)
- } else {
- ssconv = strconv.Itoa(ss)
- }
- times := "↳Date : " + dd + "-" + MM + "-" + yyyy + "\n↳Time : " + hhconv + ":" + mmconv + ":" + ssconv
- client.SendMessage(to, times)
- }
- func SelectallBot(client *oop.Account, to string) ([]*oop.Account, error) {
- err, _, memlist := client.GetGroupMembers(to)
- if err != nil {
- return nil, err
- }
- exe := []*oop.Account{}
- for mid, _ := range memlist {
- if InArray2(Squadlist, mid) {
- cl := GetKorban(mid)
- exe = append(exe, cl)
- }
- }
- if len(exe) != 0 {
- return exe, err
- }
- return nil, err
- }
- func Setcancelto(client *oop.Account, to string, invits []string) {
- defer panicHandle("Setcancelto")
- for _, x := range invits {
- if oop.IsPending(client, to, x) == true {
- client.CancelChatInvitations(to, x)
- }
- }
- }
- func cekOp(optime int64) bool {
- for _, tar := range oplist {
- if tar == optime {
- return false
- }
- }
- oplist = append(oplist, optime)
- return true
- }
- func cekOpinvite(optime int64) bool {
- for _, tar := range oplistinvite {
- if tar == optime {
- return false
- }
- }
- oplistinvite = append(oplistinvite, optime)
- return true
- }
- func AppendLastD(s [][]string, e []string) [][]string {
- defer oop.PanicOnly()
- s = append(s, e)
- if len(s) >= 1000 {
- s = s[100:]
- return s
- }
- return s
- }
- func AppendLast(s []string, e string) []string {
- defer oop.PanicOnly()
- s = Remove(s, e)
- s = append(s, e)
- if len(s) >= 1000 {
- s = s[100:]
- return s
- }
- return s
- }
- func LlistCheck(client *oop.Account, to string, typec string, nCount int, sender string, rplay string, mentionlist []string) (ss []string) {
- saodd := []string{}
- if len(mentionlist) != 0 {
- for a := range mentionlist {
- if !InArray2(saodd, mentionlist[a]) && !InArray2(Squadlist, mentionlist[a]) {
- saodd = append(saodd, mentionlist[a])
- }
- }
- return saodd
- } else if rplay != "" {
- if !InArray2(saodd, rplay) {
- saodd = append(saodd, rplay)
- }
- return saodd
- } else if typec == "lmid" {
- g, ok := Lastmid.Get(to)
- if !ok {
- g = [][]string{}
- Lastmid.Set(to, g)
- } else {
- num := nCount
- c := g.([][]string)
- lk := len(c)
- if lk != 0 {
- no := 0
- for i := lk - 1; i >= 0; i-- {
- if no < num {
- saodd = append(saodd, c[i]...)
- }
- no++
- }
- return saodd
- }
- }
- } else if typec == "linvite" {
- g, ok := Lastinvite.Get(to)
- if !ok {
- g = []string{}
- Lastinvite.Set(to, g)
- } else {
- num := nCount
- c := g.([]string)
- lk := len(c)
- if lk != 0 {
- no := 0
- for i := lk - 1; i >= 0; i-- {
- if no < num {
- saodd = append(saodd, c[i])
- }
- no++
- }
- return saodd
- }
- }
- } else if typec == "lkick" {
- g, ok := Lastkick.Get(to)
- if !ok {
- g = []string{}
- Lastkick.Set(to, g)
- } else {
- num := nCount
- c := g.([]string)
- lk := len(c)
- if lk != 0 {
- no := 0
- for i := lk - 1; i >= 0; i-- {
- if no < num {
- saodd = append(saodd, c[i])
- }
- no++
- }
- return saodd
- }
- }
- } else if typec == "lcancel" {
- g, ok := Lastcancel.Get(to)
- if !ok {
- g = []string{}
- Lastcancel.Set(to, g)
- } else {
- num := nCount
- c := g.([]string)
- lk := len(c)
- if lk != 0 {
- no := 0
- for i := lk - 1; i >= 0; i-- {
- if no < num {
- saodd = append(saodd, c[i])
- }
- no++
- }
- return saodd
- }
- }
- } else if typec == "lqr" {
- g, ok := Lastupdate.Get(to)
- if !ok {
- g = []string{}
- Lastupdate.Set(to, g)
- } else {
- num := nCount
- c := g.([]string)
- lk := len(c)
- if lk != 0 {
- no := 0
- for i := lk - 1; i >= 0; i-- {
- if no < num {
- saodd = append(saodd, c[i])
- }
- no++
- }
- return saodd
- }
- }
- } else if typec == "ljoin" {
- g, ok := Lastjoin.Get(to)
- if !ok {
- g = []string{}
- Lastjoin.Set(to, g)
- } else {
- num := nCount
- c := g.([]string)
- lk := len(c)
- if lk != 0 {
- no := 0
- for i := lk - 1; i >= 0; i-- {
- if no < num {
- saodd = append(saodd, c[i])
- }
- no++
- }
- return saodd
- }
- }
- } else if typec == "ltag" {
- g, ok := Lasttag.Get(to)
- if !ok {
- g = []string{}
- Lasttag.Set(to, g)
- } else {
- num := nCount
- c := g.([]string)
- lk := len(c)
- if lk != 0 {
- no := 0
- for i := lk - 1; i >= 0; i-- {
- if no < num {
- saodd = append(saodd, c[i])
- }
- no++
- }
- return saodd
- }
- }
- } else if typec == "lcon" {
- g, ok := Lastcon.Get(to)
- if !ok {
- g = []string{}
- Lastcon.Set(to, g)
- } else {
- num := nCount
- c := g.([]string)
- lk := len(c)
- if lk != 0 {
- no := 0
- for i := lk - 1; i >= 0; i-- {
- if no < num {
- saodd = append(saodd, c[i])
- }
- no++
- }
- return saodd
- }
- }
- } else if typec == "lleave" {
- g, ok := Lastleave.Get(to)
- if !ok {
- g = []string{}
- Lastleave.Set(to, g)
- } else {
- num := nCount
- c := g.([]string)
- lk := len(c)
- if lk != 0 {
- no := 0
- for i := lk - 1; i >= 0; i-- {
- if no < num {
- saodd = append(saodd, c[i])
- }
- no++
- }
- return saodd
- }
- }
- } else if typec == "@me" {
- if !InArray2(saodd, sender) {
- saodd = append(saodd, sender)
- }
- return saodd
- } else if typec == "@all" {
- Member := client.GetChatListMem(to)
- for i := 0; i < len(Member); i++ {
- if !InArray2(saodd, Member[i]) {
- saodd = append(saodd, Member[i])
- }
- }
- return saodd
- } else if typec == "@pending" {
- _, _, pind := client.GetChatList(to)
- for _, i := range pind {
- if !InArray2(saodd, i) {
- saodd = append(saodd, i)
- }
- }
- return saodd
- }
- return saodd
- }
- func savejoin(Pelaku string, Optime int64) {
- defer oop.PanicOnly()
- ix := IndexOf(Detectjoin.User, Pelaku)
- if ix == -1 {
- Detectjoin.User = append(Detectjoin.User, Pelaku)
- Detectjoin.Time = append(Detectjoin.Time, Optime)
- } else {
- Detectjoin.Time[ix] = Optime
- }
- }
- func LogGet(op *talkservice.Operation) {
- defer oop.PanicOnly()
- tipe := op.Type
- pelaku := op.Param2
- korban := op.Param3
- if tipe == 124 || tipe == 123 {
- var invites []string
- if tipe == 124 {
- invites = strings.Split(korban, "\x1e")
- } else {
- invites = strings.Split(pelaku, "\x1e")
- }
- ll := len(invites)
- if ll != 0 {
- g, ok := Lastinvite.Get(op.Param1)
- if !ok {
- Lastinvite.Set(op.Param1, invites)
- } else {
- c := g.([]string)
- for _, can := range invites {
- c = AppendLast(c, can)
- }
- Lastinvite.Set(op.Param1, c)
- }
- }
- } else if tipe == 133 {
- g, ok := Lastkick.Get(op.Param1)
- if !ok {
- g = []string{op.Param3}
- Lastkick.Set(op.Param1, g)
- } else {
- c := g.([]string)
- c = AppendLast(c, op.Param3)
- Lastkick.Set(op.Param1, c)
- }
- } else if tipe == 132 {
- g, ok := Lastkick.Get(op.Param1)
- if !ok {
- g = []string{op.Param2}
- Lastkick.Set(op.Param1, g)
- } else {
- c := g.([]string)
- c = AppendLast(c, op.Param2)
- Lastkick.Set(op.Param1, c)
- }
- } else if tipe == 130 {
- g, ok := Lastjoin.Get(op.Param1)
- if !ok {
- g = []string{op.Param2}
- Lastjoin.Set(op.Param1, g)
- } else {
- c := g.([]string)
- c = AppendLast(c, op.Param2)
- Lastjoin.Set(op.Param1, c)
- }
- } else if tipe == 125 {
- g, ok := Lastcancel.Get(op.Param1)
- if !ok {
- g = []string{op.Param2}
- Lastcancel.Set(op.Param1, g)
- } else {
- c := g.([]string)
- c = AppendLast(c, op.Param2)
- Lastcancel.Set(op.Param1, c)
- }
- } else if tipe == 126 {
- g, ok := Lastcancel.Get(op.Param1)
- if !ok {
- g = []string{op.Param3}
- Lastcancel.Set(op.Param1, g)
- } else {
- c := g.([]string)
- c = AppendLast(c, op.Param3)
- Lastcancel.Set(op.Param1, c)
- }
- } else if tipe == 122 {
- g, ok := Lastupdate.Get(op.Param1)
- if !ok {
- g = []string{op.Param2}
- Lastupdate.Set(op.Param1, g)
- } else {
- c := g.([]string)
- c = AppendLast(c, op.Param2)
- Lastupdate.Set(op.Param1, c)
- }
- } else if tipe == 128 {
- g, ok := Lastleave.Get(op.Param1)
- if !ok {
- g = []string{op.Param2}
- Lastleave.Set(op.Param1, g)
- } else {
- c := g.([]string)
- c = AppendLast(c, op.Param2)
- Lastleave.Set(op.Param1, c)
- }
- } else if tipe == 26 {
- var MentionMsg = MentionList(op)
- msg := op.Message
- if InArray2(Squadlist, msg.From_) {
- return
- }
- if len(MentionMsg) != 0 {
- g, ok := Lasttag.Get(msg.To)
- if !ok {
- g = MentionMsg
- Lasttag.Set(msg.To, g)
- } else {
- c := g.([]string)
- for _, men := range MentionMsg {
- c = AppendLast(c, men)
- }
- Lasttag.Set(msg.To, c)
- }
- } else if msg.ContentType == 13 {
- mids := msg.ContentMetadata["mid"]
- g, ok := Lastcon.Get(msg.To)
- if !ok {
- g = []string{mids}
- Lastcon.Set(msg.To, g)
- } else {
- c := g.([]string)
- c = AppendLast(c, mids)
- Lastcon.Set(msg.To, c)
- }
- } else if msg.ContentType == 7 {
- var ids []string
- var pids []string
- zx := msg.ContentMetadata
- vok, cook := zx["REPLACE"]
- if cook {
- ress := gjson.Get(vok, "sticon")
- mp := ress.Map()
- yo := mp["resources"]
- vls := yo.Array()
- for _, vl := range vls {
- mm := vl.Map()
- pids = append(pids, mm["productId"].String())
- ids = append(ids, mm["sticonId"].String())
- }
- } else {
- ids = []string{zx["STKID"]}
- pids = []string{zx["STKPKGID"]}
- }
- g, ok := Laststicker.Get(msg.To)
- if !ok {
- g = []*Stickers{&Stickers{Id: ids[0], Pid: pids[0]}}
- Laststicker.Set(msg.To, g)
- } else {
- c := g.([]*Stickers)
- c = AppendLastSticker(c, &Stickers{Id: ids[0], Pid: pids[0]})
- Laststicker.Set(msg.To, c)
- }
- } else if msg.ContentType == 0 {
- if strings.Contains(msg.Text, "u") {
- regex, _ := regexp.Compile(`u\w{32}`)
- links := regex.FindAllString(msg.Text, -1)
- mmd := []string{}
- for _, a := range links {
- if len(a) == 33 {
- mmd = append(mmd, a)
- }
- }
- if len(mmd) != 0 {
- g, ok := Lastmid.Get(msg.To)
- if !ok {
- g = [][]string{mmd}
- Lastmid.Set(msg.To, g)
- } else {
- c := g.([][]string)
- c = AppendLastD(c, mmd)
- Lastmid.Set(msg.To, c)
- }
- }
- }
- }
- }
- }
- func BanAll(memlist []string) {
- ilen := len(memlist)
- for i := 0; i < ilen; i++ {
- Banned.AddBan(memlist[i])
- }
- }
- func botDuration(d time.Duration) string {
- d = d.Round(time.Second)
- h := d / time.Hour
- d -= h * time.Hour
- m := d / time.Minute
- d -= m * time.Minute
- return fmt.Sprintf("%2d Days, %2d Hours, %2d Mins.", h/24, h%24, m)
- }
- func (self *kickop) ceko(pelaku int64) bool {
- if !InArrayInt64(self.Opinv, pelaku) {
- self.Opinv = append(self.Opinv, pelaku)
- return true
- }
- return false
- }
- func (self *kickop) cek(pelaku string) bool {
- if !InArray2(self.Kick, pelaku) {
- self.Kick = append(self.Kick, pelaku)
- return true
- }
- return false
- }
- func (self *kickop) del(pelaku string) {
- self.Kick = Remove(self.Kick, pelaku)
- }
- func (self *kickop) ceki(pelaku string) bool {
- defer oop.PanicOnly()
- if !InArray2(self.Inv, pelaku) {
- self.Inv = append(self.Inv, pelaku)
- return true
- }
- return false
- }
- func (self *kickop) deli(pelaku string) {
- self.Inv = Remove(self.Inv, pelaku)
- }
- func (self *kickop) clear() {
- self.Inv = []string{}
- self.Kick = []string{}
- self.Opinv = []int64{}
- }
- func Checklistexpel(client *oop.Account, to string, targets []string, pl int, sinder string) {
- Room := oop.GetRoom(to)
- if len(targets) > 1 {
- target := []string{}
- conts := 0
- conts2 := 0
- for _, from := range targets {
- if InArray2(MAKERS, from) {
- if !InArray2(MAKERS, sinder) {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetCreator(from) {
- if InArray2(MAKERS, sinder) {
- target = append(target, from)
- UserBot.DelCreator(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetSeller(from) {
- if SendMycreator(sinder) {
- target = append(target, from)
- UserBot.DelSeller(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetBuyer(from) {
- if SendMyseller(sinder) {
- target = append(target, from)
- UserBot.DelBuyer(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetOwner(from) {
- if SendMybuyer(sinder) {
- target = append(target, from)
- UserBot.DelOwner(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetMaster(from) {
- if SendMyowner(sinder) {
- target = append(target, from)
- UserBot.DelMaster(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetAdmin(from) {
- if SendMyadmin(sinder) {
- target = append(target, from)
- UserBot.DelAdmin(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if InArray2(Room.Gowner, from) {
- if SendMyadmin(sinder) {
- target = append(target, from)
- Room.Gowner = Remove(Room.Gowner, from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if InArray2(Room.Gadmin, from) {
- if SendMygowner(to, sinder) {
- target = append(target, from)
- Room.Gadmin = Remove(Room.Gadmin, from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetBot(from) {
- if SendMyowner(sinder) {
- target = append(target, from)
- UserBot.DelBot(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- }
- if len(target) != 0 {
- list := ""
- if pl == 1 {
- list += "Expeled from Buyer\n"
- } else if pl == 2 {
- list += "Expeled from Owner\n"
- } else if pl == 3 {
- list += "Expeled from Master\n"
- } else if pl == 4 {
- list += "Expeled from Admin\n"
- } else if pl == 5 {
- list += "Expeled from Bot\n"
- } else if pl == 6 {
- list += "Expeled from Gowner\n"
- } else if pl == 7 {
- list += "Expeled from Gadmin\n"
- } else if pl == 8 {
- list += "Expeled from Access\n"
- } else if pl == 9 {
- list += "Expeled from Creator\n"
- } else if pl == 17 {
- list += "Expeled from Seller\n"
- }
- for i := range target {
- list += "\n" + strconv.Itoa(i+1) + ". " + "@!"
- }
- client.SendPollMention(to, list, target)
- if pl == 2 {
- logAccess(client, to, sinder, "unowner", target, 2)
- } else if pl == 3 {
- logAccess(client, to, sinder, "unmaster", target, 2)
- } else if pl == 4 {
- logAccess(client, to, sinder, "unadmin", target, 2)
- } else if pl == 5 {
- logAccess(client, to, sinder, "unbot", target, 2)
- } else if pl == 6 {
- logAccess(client, to, sinder, "ungowner", target, 2)
- } else if pl == 7 {
- logAccess(client, to, sinder, "ungadmin", target, 2)
- } else if pl == 8 {
- logAccess(client, to, sinder, "expel", target, 2)
- }
- } else if conts != 0 {
- list := "Sorry, your grade is too low.\n"
- client.SendMessage(to, list)
- } else if conts2 != 0 {
- list := "Users not have access.\n"
- client.SendMessage(to, list)
- }
- } else {
- target := []string{}
- conts := 0
- conts2 := 0
- for _, from := range targets {
- if InArray2(MAKERS, from) {
- if !InArray2(MAKERS, sinder) {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetCreator(from) {
- if InArray2(MAKERS, sinder) {
- target = append(target, from)
- UserBot.DelCreator(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetSeller(from) {
- if SendMycreator(sinder) {
- target = append(target, from)
- UserBot.DelSeller(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetBuyer(from) {
- if SendMyseller(sinder) {
- target = append(target, from)
- UserBot.DelBuyer(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetOwner(from) {
- if SendMybuyer(sinder) {
- target = append(target, from)
- UserBot.DelOwner(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetMaster(from) {
- if SendMyowner(sinder) {
- target = append(target, from)
- UserBot.DelMaster(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetAdmin(from) {
- if SendMyadmin(sinder) {
- target = append(target, from)
- UserBot.DelAdmin(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if InArray2(Room.Gowner, from) {
- if SendMyadmin(sinder) {
- target = append(target, from)
- Room.Gowner = Remove(Room.Gowner, from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if InArray2(Room.Gadmin, from) {
- if SendMygowner(to, sinder) {
- target = append(target, from)
- Room.Gadmin = Remove(Room.Gadmin, from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- if UserBot.GetBot(from) {
- if SendMyowner(sinder) {
- target = append(target, from)
- UserBot.DelBot(from)
- } else {
- conts++
- }
- } else {
- conts2++
- }
- }
- if len(target) != 0 {
- list := ""
- if pl == 1 {
- list += "Removed from Buyer\n"
- } else if pl == 2 {
- list += "Removed from Owner\n"
- } else if pl == 3 {
- list += "Removed from Master\n"
- } else if pl == 4 {
- list += "Expeled from Admin\n"
- } else if pl == 5 {
- list += "Expeled from Bot\n"
- } else if pl == 6 {
- list += "Expeled from Gowner\n"
- } else if pl == 7 {
- list += "Expeled from Gadmin\n"
- } else if pl == 8 {
- list += "Expeled from Access\n"
- } else if pl == 9 {
- list += "Expeled from Creator\n"
- } else if pl == 17 {
- list += "Expeled from Seller\n"
- }
- for i := range target {
- list += "\n" + strconv.Itoa(i+1) + ". " + "@!"
- }
- client.SendPollMention(to, list, target)
- if pl == 2 {
- logAccess(client, to, sinder, "unowner", target, 2)
- } else if pl == 3 {
- logAccess(client, to, sinder, "unmaster", target, 2)
- } else if pl == 4 {
- logAccess(client, to, sinder, "unadmin", target, 2)
- } else if pl == 5 {
- logAccess(client, to, sinder, "unbot", target, 2)
- } else if pl == 6 {
- logAccess(client, to, sinder, "ungowner", target, 2)
- } else if pl == 7 {
- logAccess(client, to, sinder, "ungadmin", target, 2)
- } else if pl == 8 {
- logAccess(client, to, sinder, "expel", target, 2)
- }
- } else if conts != 0 {
- list := "Sorry, your grade is too low.\n"
- client.SendMessage(to, list)
- } else if conts2 != 0 {
- list := "Users not have access.\n"
- client.SendMessage(to, list)
- }
- }
- }
- func Checkqr() {
- Qrwar = true
- time.Sleep(1 * time.Second)
- Qrwar = false
- }
- func Cmdlistcheck() string {
- list2 := "✠ 𝗟𝗶𝘀𝘁 𝗖𝗺𝗱 :\n\n"
- list := ""
- if Commands.Botname != "" {
- list += fmt.Sprintf(" - Botname: %s\n", Commands.Botname)
- }
- if Commands.Upallimage != "" {
- list += fmt.Sprintf(" - Upallimage: %s\n", Commands.Upallimage)
- }
- if Commands.Upallcover != "" {
- list += fmt.Sprintf(" - Upallcover: %s\n", Commands.Upallcover)
- }
- if Commands.Unsend != "" {
- list += fmt.Sprintf(" - Unsend: %s\n", Commands.Unsend)
- }
- if Commands.Upvallimage != "" {
- list += fmt.Sprintf(" - Upvallimage: %s\n", Commands.Upvallimage)
- }
- if Commands.Upvallcover != "" {
- list += fmt.Sprintf(" - Upvallcover: %s\n", Commands.Upvallcover)
- }
- if Commands.Appname != "" {
- list += fmt.Sprintf(" - Appname: %s\n", Commands.Appname)
- }
- if Commands.Useragent != "" {
- list += fmt.Sprintf(" - Useragent: %s\n", Commands.Useragent)
- }
- if Commands.Hostname != "" {
- list += fmt.Sprintf(" - Hostname: %s\n", Commands.Hostname)
- }
- if Commands.Friends != "" {
- list += fmt.Sprintf(" - Friends: %s\n", Commands.Friends)
- }
- if Commands.Adds != "" {
- list += fmt.Sprintf(" - Adds: %s\n", Commands.Adds)
- }
- if Commands.Limits != "" {
- list += fmt.Sprintf(" - Limits: %s\n", Commands.Limits)
- }
- if Commands.Addallbots != "" {
- list += fmt.Sprintf(" - Addallbots: %s\n", Commands.Addallbots)
- }
- if Commands.Addallsquads != "" {
- list += fmt.Sprintf(" - Addallsquads: %s\n", Commands.Addallsquads)
- }
- if Commands.Leave != "" {
- list += fmt.Sprintf(" - Leave: %s\n", Commands.Leave)
- }
- if Commands.Respon != "" {
- list += fmt.Sprintf(" - Respon: %s\n", Commands.Respon)
- }
- if Commands.Ping != "" {
- list += fmt.Sprintf(" - Ping: %s\n", Commands.Ping)
- }
- if Commands.Count != "" {
- list += fmt.Sprintf(" - Count: %s\n", Commands.Count)
- }
- if Commands.Limitout != "" {
- list += fmt.Sprintf(" - 1111111: %s\n", Commands.Limitout)
- }
- if Commands.Access != "" {
- list += fmt.Sprintf(" - Access: %s\n", Commands.Access)
- }
- if Commands.Allbanlist != "" {
- list += fmt.Sprintf(" - Allbanlist: %s\n", Commands.Allbanlist)
- }
- if Commands.Allgaccess != "" {
- list += fmt.Sprintf(" - Allgaccess: %s\n", Commands.Allgaccess)
- }
- if Commands.Gaccess != "" {
- list += fmt.Sprintf(" - Gaccess: %s\n", Commands.Gaccess)
- }
- if Commands.Checkram != "" {
- list += fmt.Sprintf(" - Checkram: %s\n", Commands.Checkram)
- }
- if Commands.Backups != "" {
- list += fmt.Sprintf(" - Backups: %s\n", Commands.Backups)
- }
- if Commands.Upimage != "" {
- list += fmt.Sprintf(" - Upimage: %s\n", Commands.Upimage)
- }
- if Commands.Upcover != "" {
- list += fmt.Sprintf(" - Upcover: %s\n", Commands.Upcover)
- }
- if Commands.Upvimage != "" {
- list += fmt.Sprintf(" - Upvimage: %s\n", Commands.Upvimage)
- }
- if Commands.Upvcover != "" {
- list += fmt.Sprintf(" - Upvcover: %s\n", Commands.Upvcover)
- }
- if Commands.Bringall != "" {
- list += fmt.Sprintf(" - Bringall: %s\n", Commands.Bringall)
- }
- if Commands.Purgeall != "" {
- list += fmt.Sprintf(" - Purgeall: %s\n", Commands.Purgeall)
- }
- if Commands.Banlist != "" {
- list += fmt.Sprintf(" - Banlist: %s\n", Commands.Banlist)
- }
- if Commands.Clearban != "" {
- list += fmt.Sprintf(" - Clearban: %s\n", Commands.Clearban)
- }
- if Commands.Stayall != "" {
- list += fmt.Sprintf(" - Stayall: %s\n", Commands.Stayall)
- }
- if Commands.Clearchat != "" {
- list += fmt.Sprintf(" - Clearchat: %s\n", Commands.Clearchat)
- }
- if Commands.Here != "" {
- list += fmt.Sprintf(" - Here: %s\n", Commands.Here)
- }
- if Commands.Speed != "" {
- list += fmt.Sprintf(" - Speed: %s\n", Commands.Speed)
- }
- if Commands.Status != "" {
- list += fmt.Sprintf(" - Status: %s\n", Commands.Status)
- }
- if Commands.Tagall != "" {
- list += fmt.Sprintf(" - Tagall: %s\n", Commands.Tagall)
- }
- if Commands.Kick != "" {
- list += fmt.Sprintf(" - Kick: %s\n", Commands.Kick)
- }
- if Commands.Max != "" {
- list += fmt.Sprintf(" - Protect Max: %s\n", Commands.Max)
- }
- if Commands.None != "" {
- list += fmt.Sprintf(" - Protect None: %s\n", Commands.None)
- }
- if Commands.Kickall != "" {
- list += fmt.Sprintf(" - Kickall: %s\n", Commands.Kickall)
- }
- if Commands.Cancelall != "" {
- list += fmt.Sprintf(" - Cancelall: %s\n", Commands.Cancelall)
- }
- if list != "" {
- return list2 + list
- } else {
- return "Not found set Cmd.\n"
- }
- }
- func bToMb(b uint64) uint64 {
- return b / 1024 / 1024
- }
- func TimeDown(Fucking int) bool {
- switch Fucking {
- case 0:
- time.Sleep(200 * time.Millisecond)
- return true
- case 1:
- time.Sleep(400 * time.Millisecond)
- return true
- case 2:
- time.Sleep(600 * time.Millisecond)
- return true
- case 3:
- time.Sleep(800 * time.Millisecond)
- return true
- case 4:
- time.Sleep(1000 * time.Millisecond)
- return true
- case 5:
- time.Sleep(1200 * time.Millisecond)
- return true
- case 6:
- time.Sleep(1400 * time.Millisecond)
- return true
- case 7:
- time.Sleep(1600 * time.Millisecond)
- return true
- case 8:
- time.Sleep(1800 * time.Millisecond)
- return true
- case 9:
- time.Sleep(2000 * time.Millisecond)
- return true
- case 10:
- time.Sleep(2200 * time.Millisecond)
- return true
- case 11:
- time.Sleep(2400 * time.Millisecond)
- return true
- case 12:
- time.Sleep(2600 * time.Millisecond)
- return true
- case 13:
- time.Sleep(2800 * time.Millisecond)
- return true
- case 14:
- time.Sleep(3000 * time.Millisecond)
- return true
- case 15:
- time.Sleep(3200 * time.Millisecond)
- return true
- case 16:
- time.Sleep(3400 * time.Millisecond)
- return true
- case 17:
- time.Sleep(3600 * time.Millisecond)
- return true
- case 18:
- time.Sleep(3800 * time.Millisecond)
- return true
- case 19:
- time.Sleep(4000 * time.Millisecond)
- return true
- case 20:
- time.Sleep(4200 * time.Millisecond)
- return true
- case 21:
- time.Sleep(4400 * time.Millisecond)
- return true
- case 22:
- time.Sleep(4600 * time.Millisecond)
- return true
- case 23:
- time.Sleep(4800 * time.Millisecond)
- return true
- default:
- return false
- }
- }
- func LeaveallGroups(client *oop.Account, to string) []string {
- allg := []string{}
- for i := range ClientBot {
- groups, _ := ClientBot[i].GetGroupIdsJoined()
- grup, _ := ClientBot[i].GetGroups(groups)
- for _, gi := range grup {
- if gi.ChatMid != to {
- ClientBot[i].LeaveGroup(gi.ChatMid)
- time.Sleep(1 * time.Second)
- if !InArray2(allg, gi.ChatMid) {
- allg = append(allg, gi.ChatMid)
- }
- }
- }
- }
- return allg
- }
- func logAccess(client *oop.Account, group, from, tipe string, targets []string, tempat int64) {
- defer panicHandle("logAccess")
- if !LogMode || SendMyseller(from) {
- return
- }
- nm, _, _ := client.GetChatList(group)
- var ts = ""
- if tipe == "ban" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! banned %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! banned %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "unban" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! unbaned %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! unbaned %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "owner" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! promoted owner %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! promoted owner %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "unowner" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! expeled owner %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! expeled owner %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "bot" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! promoted bot %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! promoted bot %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "unbot" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! expeled bot %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! expeled bot %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "mute" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! muted %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! muted %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "unmute" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! unmuted %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! unmuted %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "fuck" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! fuck %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! fuck %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "master" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! promoted Master %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! promoted Master %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "unmaster" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! expeled Master %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! expeled Master %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "admin" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! promoted admin %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! promoted admin %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "unadmin" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! expeled admin %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! expeled admin %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "gowner" {
- if len(targets) == 0 {
- return
- }
- ts += fmt.Sprintf("@! promoted gowner %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else if tipe == "ungowner" {
- if len(targets) == 0 {
- return
- }
- ts += fmt.Sprintf("@! expeled gowner %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else if tipe == "gadmin" {
- if len(targets) == 0 {
- return
- }
- ts += fmt.Sprintf("@! promoted gadmin %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else if tipe == "ungadmin" {
- if len(targets) == 0 {
- return
- }
- ts += fmt.Sprintf("@! expeled gadmin %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else if tipe == "expel" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! expeled access %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! expeled access %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "clearowner" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! cleared all owner %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! cleared all owner %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "clearmaster" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! cleared all master %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! cleared all master %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "clearadmin" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! cleared all admin %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! cleared all admin %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "clearban" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! cleared all banlist %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! cleared all banlist %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "clearbot" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! cleared all bot %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! cleared all bot %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "clearmute" {
- if len(targets) == 0 {
- return
- }
- if tempat == 1 {
- ts += fmt.Sprintf("@! cleared all mutelist %v user's:\n", len(targets))
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else {
- ts += fmt.Sprintf("@! cleared all mutelist %v user's from \n%s\n\nTarget:", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- }
- } else if tipe == "kick" {
- if len(targets) == 0 {
- return
- }
- ts += fmt.Sprintf("@! kick %v user's from\n%s\n\n", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else if tipe == "cancel" {
- if len(targets) == 0 {
- return
- }
- ts += fmt.Sprintf("@! cancel %v invitation's from\n%s\n\n", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else if tipe == "invite" {
- if len(targets) == 0 {
- return
- }
- ts += fmt.Sprintf("@! invite %v user's from\n%s\n\n", len(targets), nm)
- cuh, _ := client.GetContacts(targets)
- for _, prs := range cuh {
- name := prs.DisplayName
- ts += fmt.Sprintf("\n %s", name)
- }
- } else if tipe == "Kickall" {
- ts += fmt.Sprintf("@! Nukeall %v user's from\n%s", len(targets), nm)
- } else if tipe == "purgeall" {
- ts += fmt.Sprintf("@! purgeall %v user's from\n%s", len(targets), nm)
- } else if tipe == "purge" {
- ts += fmt.Sprintf("@! purge %v user's in:\n%s", len(targets), nm)
- } else if tipe == "cancelall" {
- ts += fmt.Sprintf("@! cancelall %v invitation's from\n%s", len(targets), nm)
- } else if tipe == "leave" {
- ts += fmt.Sprintf("@! bot's leave from\n%s", nm)
- } else if tipe == "bringbot" {
- ts += fmt.Sprintf("@! Invite bot's\n%s", nm)
- } else if tipe == "addfrind" {
- ts += fmt.Sprintf("@! he added %v as friend\nMid : \n%s", group, from)
- }
- room := oop.GetRoom(LogGroup)
- if len(room.Client) != 0 {
- exe, err := SelectBot(room.Client[0], LogGroup)
- if err == nil {
- if exe != nil {
- exe.SendMention(LogGroup, ts, []string{from})
- }
- } else {
- LogMode = false
- LogGroup = ""
- }
- }
- }
|