mainbot.go 193 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199
  1. package main
  2. import (
  3. "encoding/json"
  4. "fmt"
  5. "os"
  6. "os/exec"
  7. "regexp"
  8. "sort"
  9. "strconv"
  10. "strings"
  11. "sync"
  12. "time"
  13. "unicode/utf8"
  14. "github.com/bashery/botline/oop"
  15. talkservice "github.com/bashery/linethrift"
  16. "github.com/panjf2000/ants"
  17. "github.com/shirou/gopsutil/mem"
  18. "github.com/tidwall/gjson"
  19. )
  20. func Bot(op *talkservice.Operation, client *oop.Account, ch chan int) {
  21. defer panicHandle("Bot")
  22. msg := op.Message
  23. if msg.ToType != 2 {
  24. return
  25. }
  26. if _, ok := Commandss.Get(op.CreatedTime); ok {
  27. return
  28. } else {
  29. Commandss.Set(op.CreatedTime, client)
  30. }
  31. if time.Now().Sub(timeabort) >= 60*time.Second {
  32. abort()
  33. }
  34. Rname := MsRname
  35. Sname := MsSname
  36. sender := op.Message.From_
  37. text := op.Message.Text
  38. receiver := op.Message.To
  39. var pesan = strings.ToLower(text)
  40. var to string
  41. mentions := mentions{}
  42. if op.Message.ToType == 0 {
  43. to = sender
  44. } else {
  45. to = receiver
  46. }
  47. if len(Sinderremote) != 0 {
  48. if InArray2(Sinderremote, sender) {
  49. if remotegrupid != "" {
  50. remotegrupidto = to
  51. to = remotegrupid
  52. }
  53. }
  54. }
  55. mentionlist := []string{}
  56. json.Unmarshal([]byte(op.Message.ContentMetadata["MENTION"]), &mentions)
  57. for _, mention := range mentions.MENTIONEES {
  58. if !InArray2(mentionlist, mention.Mid) {
  59. mentionlist = append(mentionlist, mention.Mid)
  60. }
  61. }
  62. var Rplay = ""
  63. var room *oop.LineRoom
  64. var bks = []*oop.Account{}
  65. room = oop.GetRoom(to)
  66. bks = room.Client
  67. if len(bks) == 0 {
  68. GetSquad(client, to)
  69. room = oop.GetRoom(to)
  70. bks = room.Client
  71. }
  72. sort.Slice(room.Ava, func(i, j int) bool {
  73. return room.Ava[i].Client.KickPoint < room.Ava[j].Client.KickPoint
  74. })
  75. bk := []*oop.Account{}
  76. bk2 := []*oop.Account{}
  77. for _, n := range bks {
  78. bk = append(bk, n)
  79. if !n.Limited {
  80. bk2 = append(bk2, n)
  81. }
  82. }
  83. clen := len(bk2)
  84. if clen != 0 {
  85. client = bk2[0]
  86. room.Exe = bk2[0]
  87. room.Limit = false
  88. } else {
  89. room.Limit = true
  90. }
  91. if room.AntiTag && MemUser(to, msg.From_) && len(mentionlist) != 0 && !room.Automute {
  92. if room.Limit {
  93. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot Can't kick in AntiTag")
  94. return
  95. }
  96. if client.Limited == false {
  97. client.DeleteOtherFromChats(to, msg.From_)
  98. } else {
  99. for _, bot := range bk {
  100. if bot.Limited == false {
  101. bot.DeleteOtherFromChats(to, msg.From_)
  102. break
  103. }
  104. }
  105. }
  106. }
  107. if op.Message.RelatedMessageId != "" && len(mentionlist) == 0 {
  108. asu, _ := client.GetRecentMessagesV2(op.Message.To)
  109. for _, xx := range asu {
  110. if xx.ID == op.Message.RelatedMessageId {
  111. Rplay = xx.From_
  112. break
  113. }
  114. }
  115. }
  116. if ChangPict && !AllCheng && !StartChangeImg {
  117. if len(mentionlist) != 0 {
  118. changepic = []*oop.Account{}
  119. for _, ym := range mentionlist {
  120. if InArray2(Squadlist, ym) {
  121. cl := GetKorban(ym)
  122. if !oop.Checkarri(changepic, cl) {
  123. changepic = append(changepic, cl)
  124. }
  125. }
  126. }
  127. if len(changepic) != 0 {
  128. client.SendMessage(to, "Send your image.")
  129. StartChangeImg = true
  130. }
  131. timeabort = time.Now()
  132. }
  133. } else if ChangCover && !AllCheng && !StartChangeImg {
  134. if len(mentionlist) != 0 {
  135. changepic = []*oop.Account{}
  136. for _, ym := range mentionlist {
  137. if InArray2(Squadlist, ym) {
  138. cl := GetKorban(ym)
  139. if !oop.Checkarri(changepic, cl) {
  140. changepic = append(changepic, cl)
  141. }
  142. }
  143. }
  144. if len(changepic) != 0 {
  145. client.SendMessage(to, "Send your image.")
  146. StartChangeImg = true
  147. }
  148. timeabort = time.Now()
  149. }
  150. } else if ChangVpict && !AllCheng && !StartChangeImg {
  151. if len(mentionlist) != 0 {
  152. changepic = []*oop.Account{}
  153. for _, ym := range mentionlist {
  154. if InArray2(Squadlist, ym) {
  155. cl := GetKorban(ym)
  156. if !oop.Checkarri(changepic, cl) {
  157. changepic = append(changepic, cl)
  158. }
  159. }
  160. }
  161. if len(changepic) != 0 {
  162. client.SendMessage(to, "Send your video.")
  163. StartChangevImg = true
  164. }
  165. timeabort = time.Now()
  166. }
  167. } else if ChangVcover && !AllCheng && !StartChangeImg {
  168. if len(mentionlist) != 0 {
  169. changepic = []*oop.Account{}
  170. for _, ym := range mentionlist {
  171. if InArray2(Squadlist, ym) {
  172. cl := GetKorban(ym)
  173. if !oop.Checkarri(changepic, cl) {
  174. changepic = append(changepic, cl)
  175. }
  176. }
  177. }
  178. if len(changepic) != 0 {
  179. client.SendMessage(to, "Send your video.")
  180. StartChangevImg = true
  181. }
  182. timeabort = time.Now()
  183. }
  184. } else if ChangName {
  185. if len(mentionlist) != 0 {
  186. changepic = []*oop.Account{}
  187. for _, ym := range mentionlist {
  188. if InArray2(Squadlist, ym) {
  189. cl := GetKorban(ym)
  190. if !oop.Checkarri(changepic, cl) {
  191. changepic = append(changepic, cl)
  192. }
  193. }
  194. }
  195. if len(changepic) != 0 {
  196. if MsgName != "" {
  197. for i := range changepic {
  198. if TimeDown(i) {
  199. star := MsgName
  200. changepic[i].UpdateProfileName(star)
  201. changepic[i].SendMessage(to, "Profile name updated.")
  202. }
  203. }
  204. } else {
  205. client.SendMessage(to, "Add name first.")
  206. }
  207. ChangName = false
  208. MsgName = ""
  209. }
  210. timeabort = time.Now()
  211. }
  212. } else if ChangeBio {
  213. if len(mentionlist) != 0 {
  214. changepic = []*oop.Account{}
  215. for _, ym := range mentionlist {
  216. if InArray2(Squadlist, ym) {
  217. cl := GetKorban(ym)
  218. if !oop.Checkarri(changepic, cl) {
  219. changepic = append(changepic, cl)
  220. }
  221. }
  222. }
  223. if len(changepic) != 0 {
  224. if MsgBio != "" {
  225. for i := range changepic {
  226. if TimeDown(i) {
  227. star := MsgBio
  228. changepic[i].UpdateProfileBio(star)
  229. changepic[i].SendMessage(to, "Profile status updated.")
  230. }
  231. }
  232. } else {
  233. client.SendMessage(to, "Add Bio first.")
  234. }
  235. ChangeBio = false
  236. MsgBio = ""
  237. }
  238. timeabort = time.Now()
  239. }
  240. }
  241. if op.Message.ContentType == 1 {
  242. if StartChangeImg && len(changepic) != 0 {
  243. if !MemUser(to, sender) {
  244. if ChangPict {
  245. path, err := client.DownloadObjectMsg(msg.ID)
  246. if path != "" {
  247. var wg sync.WaitGroup
  248. wg.Add(len(changepic))
  249. for n, p := range changepic {
  250. if TimeDown(n) {
  251. go func(p *oop.Account) {
  252. if StartChangevImg2 {
  253. err := p.UpdatePictureProfile(path, "v")
  254. if err != nil {
  255. fmt.Println(err)
  256. p.SendMessage(to, "Update dual profile failure.")
  257. } else {
  258. p.SendMessage(to, "Update video picture done.")
  259. }
  260. } else {
  261. err := p.UpdatePictureProfile(path, "p")
  262. if err != nil {
  263. fmt.Println(err)
  264. p.SendMessage(to, "Update picture profile failure.")
  265. } else {
  266. p.SendMessage(to, "Update Image picture done.")
  267. }
  268. }
  269. wg.Done()
  270. }(p)
  271. }
  272. }
  273. wg.Wait()
  274. os.Remove(path)
  275. } else {
  276. fmt.Println(err)
  277. if StartChangevImg2 {
  278. client.SendMessage(to, "Download video picture Failure.")
  279. } else {
  280. client.SendMessage(to, "Download Image picture Failure.")
  281. }
  282. }
  283. StartChangevImg2 = false
  284. StartChangeImg = false
  285. ChangPict = false
  286. } else if ChangCover {
  287. path, err := client.DownloadObjectMsg(msg.ID)
  288. if path != "" {
  289. var wg sync.WaitGroup
  290. wg.Add(len(changepic))
  291. for n, p := range changepic {
  292. if TimeDown(n) {
  293. go func(p *oop.Account) {
  294. if StartChangevImg2 {
  295. err := p.UpdateCoverWithVideo(path)
  296. if err != nil {
  297. fmt.Println(err)
  298. p.SendMessage(to, "Update video cover failure.")
  299. } else {
  300. p.SendMessage(to, "Update video cover done.")
  301. time.Sleep(2 * time.Second)
  302. }
  303. } else {
  304. err := p.UpdateCover(path)
  305. if err != nil {
  306. fmt.Println(err)
  307. p.SendMessage(to, "Update picture cover failure.")
  308. } else {
  309. p.SendMessage(to, "Update Image cover done.")
  310. time.Sleep(2 * time.Second)
  311. }
  312. }
  313. wg.Done()
  314. }(p)
  315. }
  316. }
  317. wg.Wait()
  318. os.Remove(path)
  319. } else {
  320. fmt.Println(err)
  321. if StartChangevImg2 {
  322. client.SendMessage(to, "Download video cover Failure.")
  323. } else {
  324. client.SendMessage(to, "Download Image cover Failure.")
  325. }
  326. }
  327. StartChangevImg2 = false
  328. StartChangeImg = false
  329. ChangCover = false
  330. }
  331. timeabort = time.Now()
  332. }
  333. }
  334. } else if op.Message.ContentType == 2 {
  335. if StartChangevImg && len(changepic) != 0 {
  336. if !MemUser(to, sender) {
  337. if ChangVpict {
  338. path, err := client.DownloadObjectMsg(msg.ID)
  339. if path != "" {
  340. var wg sync.WaitGroup
  341. wg.Add(len(changepic))
  342. for _, p := range changepic {
  343. go func(p *oop.Account) {
  344. err := p.UpdateVideoProfile(path)
  345. if err != nil {
  346. fmt.Println(err)
  347. p.SendMessage(to, "Update video profile failure.")
  348. }
  349. wg.Done()
  350. }(p)
  351. }
  352. wg.Wait()
  353. client.SendMessage(to, "Upload video done, now send your image.")
  354. os.Remove(path)
  355. StartChangevImg2 = true
  356. ChangPict = true
  357. StartChangeImg = true
  358. ChangVpict = false
  359. StartChangevImg = false
  360. } else {
  361. fmt.Println(err)
  362. client.SendMessage(to, "Download Image Failure.")
  363. }
  364. } else if ChangVcover {
  365. path, err := client.DownloadObjectMsg(msg.ID)
  366. if path != "" {
  367. var wg sync.WaitGroup
  368. wg.Add(len(changepic))
  369. for _, p := range changepic {
  370. go func(p *oop.Account) {
  371. p.UpdateCoverVideo(path)
  372. wg.Done()
  373. }(p)
  374. }
  375. wg.Wait()
  376. client.SendMessage(to, "Upload video done, now send your image.")
  377. os.Remove(path)
  378. StartChangevImg2 = true
  379. StartChangeImg = true
  380. ChangCover = true
  381. StartChangevImg = false
  382. ChangVcover = false
  383. } else {
  384. fmt.Println(err)
  385. client.SendMessage(to, "Download Image Failure.")
  386. }
  387. }
  388. timeabort = time.Now()
  389. }
  390. }
  391. } else if msg.ContentType == 0 && msg.Text != "" {
  392. if room.Automute && MemUser(to, msg.From_) {
  393. if client.Limited == false {
  394. client.DeleteOtherFromChats(to, msg.From_)
  395. } else {
  396. for _, bot := range bk {
  397. if bot.Limited == false {
  398. bot.DeleteOtherFromChats(to, msg.From_)
  399. break
  400. }
  401. }
  402. }
  403. } else {
  404. if MemBan2(to, msg.From_) && MemUser(to, msg.From_) {
  405. if client.Limited == false {
  406. client.DeleteOtherFromChats(to, msg.From_)
  407. } else {
  408. for _, bot := range bk {
  409. if bot.Limited == false {
  410. bot.DeleteOtherFromChats(to, msg.From_)
  411. break
  412. }
  413. }
  414. }
  415. }
  416. }
  417. cmds := gettxt(sender, client, pesan, Rname, Sname, client.MID, mentionlist, to)
  418. text := op.Message.Text
  419. newsend := ""
  420. var pesan = strings.ToLower(text)
  421. for _, cmd := range strings.Split(cmds, ",") {
  422. if strings.HasPrefix(cmd, "creator") && cmd != "creators" {
  423. if GetCodeprem(0, sender, to) {
  424. if CheckExprd(client, to, sender) {
  425. listuser := []string{}
  426. nCount := 0
  427. x := 13
  428. fl := strings.Split(cmd, " ")
  429. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  430. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  431. matches := re.FindStringSubmatch(typec)
  432. if len(matches) == 3 {
  433. typec = matches[1]
  434. nCount, _ = strconv.Atoi(matches[2])
  435. }
  436. if nCount == 0 {
  437. nCount = 1
  438. }
  439. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  440. if len(lists) != 0 {
  441. for i := range lists {
  442. if !InArray2(listuser, lists[i]) {
  443. listuser = append(listuser, lists[i])
  444. }
  445. }
  446. Checklistaccess(client, to, listuser, x, sender)
  447. }
  448. }
  449. }
  450. } else if cmd == "creators" {
  451. rngcmd := GetComs(1, "creators")
  452. if GetCodeprem(rngcmd, sender, to) {
  453. if CheckExprd(client, to, sender) {
  454. if len(UserBot.Creator) != 0 {
  455. list := " ✠ 𝗖𝗿𝗲𝗮𝘁𝗼𝗿𝘀 ✠ \n"
  456. for num, xd := range UserBot.Creator {
  457. num++
  458. rengs := strconv.Itoa(num)
  459. new := client.Getcontactuser(xd)
  460. if new != nil {
  461. list += "\n " + rengs + ". Closed Account"
  462. } else {
  463. x, _ := client.GetContact(xd)
  464. list += "\n " + rengs + ". " + x.DisplayName
  465. }
  466. }
  467. newsend += list + "\n"
  468. } else {
  469. newsend += "Creator list is empty.\n"
  470. }
  471. }
  472. }
  473. } else if cmd == "clearcreator" {
  474. if GetCodeprem(0, sender, to) {
  475. if CheckExprd(client, to, sender) {
  476. if len(UserBot.Creator) != 0 {
  477. newsend += fmt.Sprintf("Cleared %v Creatorlist\n", len(UserBot.Creator))
  478. UserBot.ClearCreator()
  479. } else {
  480. newsend += "Creator list is empty.\n"
  481. }
  482. }
  483. }
  484. } else if strings.HasPrefix(cmd, "uncreator") {
  485. if GetCodeprem(0, sender, to) {
  486. if CheckExprd(client, to, sender) {
  487. listuser := []string{}
  488. nCount := 0
  489. x := 9
  490. fl := strings.Split(cmd, " ")
  491. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  492. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  493. matches := re.FindStringSubmatch(typec)
  494. if len(matches) == 3 {
  495. typec = matches[1]
  496. nCount, _ = strconv.Atoi(matches[2])
  497. }
  498. if nCount == 0 {
  499. nCount = 1
  500. }
  501. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  502. if len(lists) != 0 {
  503. for i := range lists {
  504. if !InArray2(listuser, lists[i]) {
  505. listuser = append(listuser, lists[i])
  506. }
  507. }
  508. Checklistexpel(client, to, listuser, x, sender)
  509. } else {
  510. result := strings.Split((cmd), " ")
  511. if len(result) > 1 {
  512. result2, err := strconv.Atoi(result[1])
  513. if err != nil {
  514. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  515. return
  516. } else {
  517. if result2 > 0 {
  518. su := "uncreator"
  519. str := ""
  520. if strings.HasPrefix(text, Rname+" ") {
  521. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  522. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  523. } else if strings.HasPrefix(text, Sname+" ") {
  524. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  525. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  526. } else if strings.HasPrefix(text, Rname) {
  527. str = strings.Replace(text, Rname+su+" ", "", 1)
  528. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  529. } else if strings.HasPrefix(text, Sname) {
  530. str = strings.Replace(text, Sname+su+" ", "", 1)
  531. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  532. }
  533. st := StripOut(str)
  534. hapuss := oop.Archimed(st, UserBot.Creator)
  535. if len(hapuss) == 0 {
  536. newsend += "User not found.\n"
  537. } else {
  538. Checklistexpel(client, to, hapuss, x, sender)
  539. }
  540. }
  541. }
  542. } else {
  543. newsend += "User not found.\n"
  544. }
  545. }
  546. }
  547. }
  548. } else if strings.HasPrefix(cmd, "seller") && cmd != "sellers" {
  549. if GetCodeprem(1, sender, to) {
  550. if CheckExprd(client, to, sender) {
  551. listuser := []string{}
  552. nCount := 0
  553. x := 17
  554. fl := strings.Split(cmd, " ")
  555. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  556. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  557. matches := re.FindStringSubmatch(typec)
  558. if len(matches) == 3 {
  559. typec = matches[1]
  560. nCount, _ = strconv.Atoi(matches[2])
  561. }
  562. if nCount == 0 {
  563. nCount = 1
  564. }
  565. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  566. if len(lists) != 0 {
  567. for i := range lists {
  568. if !InArray2(listuser, lists[i]) {
  569. listuser = append(listuser, lists[i])
  570. }
  571. }
  572. Checklistaccess(client, to, listuser, x, sender)
  573. }
  574. }
  575. }
  576. } else if cmd == "sellers" {
  577. if GetCodeprem(2, sender, to) {
  578. if CheckExprd(client, to, sender) {
  579. if len(UserBot.Seller) != 0 {
  580. list := " ✠ 𝗦𝗲𝗹𝗹𝗲𝗿𝘀 ✠ \n"
  581. for num, xd := range UserBot.Seller {
  582. num++
  583. rengs := strconv.Itoa(num)
  584. new := client.Getcontactuser(xd)
  585. if new != nil {
  586. list += "\n " + rengs + ". Closed Account"
  587. } else {
  588. x, _ := client.GetContact(xd)
  589. list += "\n " + rengs + ". " + x.DisplayName
  590. }
  591. }
  592. newsend += list + "\n"
  593. } else {
  594. newsend += "Seller list is empty.\n"
  595. }
  596. }
  597. }
  598. } else if cmd == "clearseller" {
  599. if GetCodeprem(1, sender, to) {
  600. if CheckExprd(client, to, sender) {
  601. if len(UserBot.Seller) != 0 {
  602. newsend += fmt.Sprintf("Cleared %v sellerlist\n", len(UserBot.Seller))
  603. UserBot.ClearSeller()
  604. } else {
  605. newsend += "Seller list is empty.\n"
  606. }
  607. }
  608. }
  609. } else if strings.HasPrefix(cmd, "unseller") {
  610. if GetCodeprem(1, sender, to) {
  611. if CheckExprd(client, to, sender) {
  612. listuser := []string{}
  613. nCount := 0
  614. x := 17
  615. fl := strings.Split(cmd, " ")
  616. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  617. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  618. matches := re.FindStringSubmatch(typec)
  619. if len(matches) == 3 {
  620. typec = matches[1]
  621. nCount, _ = strconv.Atoi(matches[2])
  622. }
  623. if nCount == 0 {
  624. nCount = 1
  625. }
  626. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  627. if len(lists) != 0 {
  628. for i := range lists {
  629. if !InArray2(listuser, lists[i]) {
  630. listuser = append(listuser, lists[i])
  631. }
  632. }
  633. Checklistexpel(client, to, listuser, x, sender)
  634. } else {
  635. result := strings.Split((cmd), " ")
  636. if len(result) > 1 {
  637. result2, err := strconv.Atoi(result[1])
  638. if err != nil {
  639. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  640. return
  641. } else {
  642. if result2 > 0 {
  643. su := "unseller"
  644. str := ""
  645. if strings.HasPrefix(text, Rname+" ") {
  646. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  647. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  648. } else if strings.HasPrefix(text, Sname+" ") {
  649. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  650. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  651. } else if strings.HasPrefix(text, Rname) {
  652. str = strings.Replace(text, Rname+su+" ", "", 1)
  653. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  654. } else if strings.HasPrefix(text, Sname) {
  655. str = strings.Replace(text, Sname+su+" ", "", 1)
  656. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  657. }
  658. st := StripOut(str)
  659. hapuss := oop.Archimed(st, UserBot.Seller)
  660. if len(hapuss) == 0 {
  661. newsend += "User not found.\n"
  662. } else {
  663. Checklistexpel(client, to, hapuss, x, sender)
  664. }
  665. }
  666. }
  667. } else {
  668. newsend += "User not found.\n"
  669. }
  670. }
  671. }
  672. }
  673. } else if cmd == "listcmd" {
  674. rngcmd := GetComs(4, "listcmd")
  675. if GetCodeprem(rngcmd, sender, to) {
  676. if CheckExprd(client, to, sender) {
  677. list := Cmdlistcheck()
  678. client.SendMessage(to, list)
  679. }
  680. }
  681. } else if strings.HasPrefix(cmd, "expel") {
  682. if GetCodeprem(7, sender, to) {
  683. if CheckExprd(client, to, sender) {
  684. listuser := []string{}
  685. nCount := 0
  686. x := 8
  687. fl := strings.Split(cmd, " ")
  688. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  689. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  690. matches := re.FindStringSubmatch(typec)
  691. if len(matches) == 3 {
  692. typec = matches[1]
  693. nCount, _ = strconv.Atoi(matches[2])
  694. }
  695. if nCount == 0 {
  696. nCount = 1
  697. }
  698. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  699. if len(lists) != 0 {
  700. for i := range lists {
  701. if !InArray2(listuser, lists[i]) {
  702. listuser = append(listuser, lists[i])
  703. }
  704. }
  705. Checklistexpel(client, to, listuser, x, sender)
  706. }
  707. }
  708. }
  709. } else if cmd == "access" || cmd == Commands.Access && Commands.Access != "" {
  710. rngcmd := GetComs(4, "access")
  711. if GetCodeprem(rngcmd, sender, to) {
  712. if CheckExprd(client, to, sender) {
  713. allmanagers := []string{}
  714. listadm := "✠ 𝗔𝗰𝗰𝗲𝘀𝘀 𝗹𝗶𝘀𝘁 ✠"
  715. if len(UserBot.Owner) != 0 {
  716. listadm += "\n\n 👑 𝗼𝘄𝗻𝗲𝗿𝘀 👑"
  717. for num, xd := range UserBot.Owner {
  718. num++
  719. rengs := strconv.Itoa(num)
  720. allmanagers = append(allmanagers, xd)
  721. new := client.Getcontactuser(xd)
  722. if new != nil {
  723. listadm += "\n " + rengs + ". Closed Account"
  724. } else {
  725. x, _ := client.GetContact(xd)
  726. listadm += "\n " + rengs + ". " + x.DisplayName
  727. }
  728. }
  729. }
  730. if len(UserBot.Master) != 0 {
  731. listadm += "\n\n 🎩 𝗺𝗮𝘀𝘁𝗲𝗿𝘀 🎩"
  732. for num, xd := range UserBot.Master {
  733. num++
  734. rengs := strconv.Itoa(num)
  735. allmanagers = append(allmanagers, xd)
  736. new := client.Getcontactuser(xd)
  737. if new != nil {
  738. listadm += "\n " + rengs + ". Closed Account"
  739. } else {
  740. x, _ := client.GetContact(xd)
  741. listadm += "\n " + rengs + ". " + x.DisplayName
  742. }
  743. }
  744. }
  745. if len(UserBot.Admin) != 0 {
  746. listadm += "\n\n 🎓 𝗮𝗱𝗺𝗶𝗻𝘀 🎓"
  747. for num, xd := range UserBot.Admin {
  748. num++
  749. rengs := strconv.Itoa(num)
  750. allmanagers = append(allmanagers, xd)
  751. new := client.Getcontactuser(xd)
  752. if new != nil {
  753. listadm += "\n " + rengs + ". Closed Account"
  754. } else {
  755. x, _ := client.GetContact(xd)
  756. listadm += "\n " + rengs + ". " + x.DisplayName
  757. }
  758. }
  759. }
  760. if len(allmanagers) != 0 {
  761. newsend += listadm + "\n"
  762. } else {
  763. newsend += "𝗔ccess is empty.\n"
  764. }
  765. }
  766. }
  767. } else if cmd == "allbanlist" || cmd == Commands.Allbanlist && Commands.Allbanlist != "" {
  768. rngcmd := GetComs(4, "allbanlist")
  769. if GetCodeprem(rngcmd, sender, to) {
  770. if CheckExprd(client, to, sender) {
  771. listadm := AllBanList(client)
  772. if listadm != "✠ 𝗔𝗹𝗹 𝗯𝗮𝗻𝗹𝗶𝘀𝘁𝘀 ✠" {
  773. newsend += listadm + "\n"
  774. } else {
  775. newsend += "𝗔ccess is empty.\n"
  776. }
  777. }
  778. }
  779. } else if cmd == "gaccess" || cmd == Commands.Gaccess && Commands.Gaccess != "" {
  780. rngcmd := GetComs(7, "gaccess")
  781. if GetCodeprem(rngcmd, sender, to) {
  782. if CheckExprd(client, to, sender) {
  783. allmanagers := []string{}
  784. listadm := "✠ 𝗚𝗮𝗰𝗰𝗲𝘀𝘀 𝗹𝗶𝘀𝘁 ✠"
  785. if len(room.Gowner) != 0 {
  786. listadm += "\n\n👑 𝗴𝗼𝘄𝗻𝗲𝗿𝘀 👑"
  787. for num, xd := range room.Gowner {
  788. num++
  789. rengs := strconv.Itoa(num)
  790. allmanagers = append(allmanagers, xd)
  791. new := client.Getcontactuser(xd)
  792. if new != nil {
  793. listadm += "\n " + rengs + ". Closed Account"
  794. } else {
  795. x, _ := client.GetContact(xd)
  796. listadm += "\n " + rengs + ". " + x.DisplayName
  797. }
  798. }
  799. }
  800. if len(room.Gadmin) != 0 {
  801. listadm += "\n\n 🎓 𝗴𝗮𝗱𝗺𝗶𝗻𝘀 🎓"
  802. for num, xd := range room.Gadmin {
  803. num++
  804. rengs := strconv.Itoa(num)
  805. allmanagers = append(allmanagers, xd)
  806. new := client.Getcontactuser(xd)
  807. if new != nil {
  808. listadm += "\n " + rengs + ". Closed Account"
  809. } else {
  810. x, _ := client.GetContact(xd)
  811. listadm += "\n " + rengs + ". " + x.DisplayName
  812. }
  813. }
  814. }
  815. if len(allmanagers) != 0 {
  816. newsend += listadm + "\n"
  817. } else {
  818. newsend += "Gaccess is empty.\n"
  819. }
  820. }
  821. }
  822. } else if strings.HasPrefix(cmd, "buyer") && cmd != "buyers" {
  823. if GetCodeprem(2, sender, to) {
  824. if CheckExprd(client, to, sender) {
  825. listuser := []string{}
  826. nCount := 0
  827. x := 1
  828. fl := strings.Split(cmd, " ")
  829. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  830. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  831. matches := re.FindStringSubmatch(typec)
  832. if len(matches) == 3 {
  833. typec = matches[1]
  834. nCount, _ = strconv.Atoi(matches[2])
  835. }
  836. if nCount == 0 {
  837. nCount = 1
  838. }
  839. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  840. if len(lists) != 0 {
  841. for i := range lists {
  842. if !InArray2(listuser, lists[i]) {
  843. listuser = append(listuser, lists[i])
  844. }
  845. }
  846. Checklistaccess(client, to, listuser, x, sender)
  847. }
  848. }
  849. }
  850. } else if strings.HasPrefix(cmd, "setdate ") {
  851. if GetCodeprem(1, sender, to) {
  852. if CheckExprd(client, to, sender) {
  853. ha := strings.Split((cmd), "setdate ")
  854. haj := ha[1]
  855. haj = StripOut(haj)
  856. has := strings.Split(haj, "-")
  857. if len(has) == 3 {
  858. yy, _ := strconv.Atoi(has[0])
  859. mm, _ := strconv.Atoi(has[1])
  860. dd, _ := strconv.Atoi(has[2])
  861. var time2 = time.Date(yy, time.Month(mm), dd, 00, 00, 0, 0, time.UTC)
  862. times := time2.Format(time.RFC3339)
  863. Data.Dalltime = times
  864. str := fmt.Sprintf("⚙️ Date:\n %v-%v-%v", yy, mm, dd)
  865. ta := time2.Sub(time.Now())
  866. str += fmt.Sprintf("\n⚙️ Remaining:\n %v", botDuration(ta))
  867. newsend += str + "\n"
  868. }
  869. }
  870. }
  871. } else if cmd == "addweek" {
  872. if GetCodeprem(1, sender, to) {
  873. if CheckExprd(client, to, sender) {
  874. d := fmt.Sprintf("%v", Data.Dalltime)
  875. has := strings.Split(d, "-")
  876. has2 := strings.Split(has[2], "T")
  877. yy, _ := strconv.Atoi(has[0])
  878. mm, _ := strconv.Atoi(has[1])
  879. timeup, _ := strconv.Atoi(has2[0])
  880. batas := time.Date(yy, time.Month(mm), timeup, 00, 00, 0, 0, time.UTC)
  881. mont := 24 * time.Hour
  882. mont = 7 * mont
  883. t := batas.Add(mont)
  884. Data.Dalltime = t.Format(time.RFC3339)
  885. ta := t.Sub(time.Now())
  886. str := fmt.Sprintf("⚙️ Remaining:\n\n %v", botDuration(ta))
  887. newsend += str + "\n"
  888. }
  889. }
  890. } else if cmd == "addday" {
  891. if GetCodeprem(1, sender, to) {
  892. if CheckExprd(client, to, sender) {
  893. d := fmt.Sprintf("%v", Data.Dalltime)
  894. has := strings.Split(d, "-")
  895. has2 := strings.Split(has[2], "T")
  896. yy, _ := strconv.Atoi(has[0])
  897. mm, _ := strconv.Atoi(has[1])
  898. timeup, _ := strconv.Atoi(has2[0])
  899. batas := time.Date(yy, time.Month(mm), timeup, 00, 00, 0, 0, time.UTC)
  900. mont := 24 * time.Hour
  901. t := batas.Add(mont)
  902. Data.Dalltime = t.Format(time.RFC3339)
  903. ta := t.Sub(time.Now())
  904. str := fmt.Sprintf("⚙️ Remaining:\n\n %v", botDuration(ta))
  905. newsend += str + "\n"
  906. }
  907. }
  908. } else if cmd == "addmonth" {
  909. if GetCodeprem(1, sender, to) {
  910. if CheckExprd(client, to, sender) {
  911. d := fmt.Sprintf("%v", Data.Dalltime)
  912. has := strings.Split(d, "-")
  913. has2 := strings.Split(has[2], "T")
  914. yy, _ := strconv.Atoi(has[0])
  915. mm, _ := strconv.Atoi(has[1])
  916. timeup, _ := strconv.Atoi(has2[0])
  917. batas := time.Date(yy, time.Month(mm), timeup, 00, 00, 0, 0, time.UTC)
  918. mont := 24 * time.Hour
  919. mont = 30 * mont
  920. t := batas.Add(mont)
  921. Data.Dalltime = t.Format(time.RFC3339)
  922. ta := t.Sub(time.Now())
  923. str := fmt.Sprintf("⚙️ Remaining:\n\n %v", botDuration(ta))
  924. newsend += str + "\n"
  925. }
  926. }
  927. } else if cmd == "reboot" {
  928. if GetCodeprem(1, sender, to) {
  929. if CheckExprd(client, to, sender) {
  930. SaveBackup()
  931. client.SendMessage(to, "Waiting Rebooting...")
  932. ReloginProgram()
  933. }
  934. }
  935. } else if strings.HasPrefix(cmd, "unbuyer") {
  936. if GetCodeprem(2, sender, to) {
  937. if CheckExprd(client, to, sender) {
  938. listuser := []string{}
  939. nCount := 0
  940. x := 1
  941. fl := strings.Split(cmd, " ")
  942. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  943. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  944. matches := re.FindStringSubmatch(typec)
  945. if len(matches) == 3 {
  946. typec = matches[1]
  947. nCount, _ = strconv.Atoi(matches[2])
  948. }
  949. if nCount == 0 {
  950. nCount = 1
  951. }
  952. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  953. if len(lists) != 0 {
  954. for i := range lists {
  955. if !InArray2(listuser, lists[i]) {
  956. listuser = append(listuser, lists[i])
  957. }
  958. }
  959. Checklistexpel(client, to, listuser, x, sender)
  960. } else {
  961. result := strings.Split((cmd), " ")
  962. if len(result) > 1 {
  963. result2, err := strconv.Atoi(result[1])
  964. if err != nil {
  965. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  966. return
  967. } else {
  968. if result2 > 0 {
  969. su := "unbuyer"
  970. str := ""
  971. if strings.HasPrefix(text, Rname+" ") {
  972. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  973. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  974. } else if strings.HasPrefix(text, Sname+" ") {
  975. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  976. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  977. } else if strings.HasPrefix(text, Rname) {
  978. str = strings.Replace(text, Rname+su+" ", "", 1)
  979. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  980. } else if strings.HasPrefix(text, Sname) {
  981. str = strings.Replace(text, Sname+su+" ", "", 1)
  982. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  983. }
  984. st := StripOut(str)
  985. hapuss := oop.Archimed(st, UserBot.Buyer)
  986. if len(hapuss) == 0 {
  987. newsend += "User not found.\n"
  988. } else {
  989. Checklistexpel(client, to, hapuss, x, sender)
  990. }
  991. }
  992. }
  993. } else {
  994. newsend += "User not found.\n"
  995. }
  996. }
  997. }
  998. }
  999. } else if cmd == "checkram" || cmd == Commands.Checkram && Commands.Checkram != "" {
  1000. if GetCodeprem(0, sender, to) {
  1001. if CheckExprd(client, to, sender) {
  1002. v, _ := mem.VirtualMemory()
  1003. r := fmt.Sprintf(" ↳Cpu : %v core\n ↳Ram : %v mb\n ↳Free : %v mb\n ↳Cache : %v mb\n ↳UsedPercent : %f %%", cpu, bToMb(v.Used+v.Free+v.Buffers+v.Cached), bToMb(v.Free), bToMb(v.Buffers+v.Cached), v.UsedPercent)
  1004. newsend += r + "\n"
  1005. }
  1006. }
  1007. } else if cmd == "clearbuyer" {
  1008. if GetCodeprem(2, sender, to) {
  1009. if CheckExprd(client, to, sender) {
  1010. if len(UserBot.Buyer) != 0 {
  1011. newsend += fmt.Sprintf("Cleared %v buyerlist\n", len(UserBot.Buyer))
  1012. UserBot.ClearBuyer()
  1013. } else {
  1014. newsend += "Buyer list is empty.\n"
  1015. }
  1016. }
  1017. }
  1018. } else if cmd == "upimage" || cmd == Commands.Upimage && Commands.Upimage != "" {
  1019. rngcmd := GetComs(3, "upimage")
  1020. if GetCodeprem(rngcmd, sender, to) {
  1021. if CheckExprd(client, to, sender) {
  1022. ChangPict = true
  1023. newsend += "Which bot's you want to update Pict.\n"
  1024. }
  1025. }
  1026. } else if cmd == "upcover" || cmd == Commands.Upcover && Commands.Upcover != "" {
  1027. rngcmd := GetComs(3, "upcover")
  1028. if GetCodeprem(rngcmd, sender, to) {
  1029. if CheckExprd(client, to, sender) {
  1030. ChangCover = true
  1031. newsend += "Which bot's you want to update Cover ?.\n"
  1032. }
  1033. }
  1034. } else if cmd == "upvimage" || cmd == Commands.Upvimage && Commands.Upvimage != "" {
  1035. rngcmd := GetComs(3, "upvimage")
  1036. if GetCodeprem(rngcmd, sender, to) {
  1037. if CheckExprd(client, to, sender) {
  1038. ChangVpict = true
  1039. newsend += "Which bot's you want to update Pict ?.\n"
  1040. }
  1041. }
  1042. } else if cmd == "upvcover" || cmd == Commands.Upvcover && Commands.Upvcover != "" {
  1043. rngcmd := GetComs(3, "upvcover")
  1044. if GetCodeprem(rngcmd, sender, to) {
  1045. if CheckExprd(client, to, sender) {
  1046. ChangVcover = true
  1047. newsend += "Which bot's you want to update Cover ?.\n"
  1048. }
  1049. }
  1050. } else if strings.HasPrefix(cmd, "unsend ") {
  1051. rngcmd := GetComs(4, "unsend")
  1052. if GetCodeprem(rngcmd, sender, to) {
  1053. if CheckExprd(client, to, sender) {
  1054. result := strings.Split((cmd), " ")
  1055. if result[1] != "0" {
  1056. result2, err := strconv.Atoi(result[1])
  1057. if err != nil {
  1058. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  1059. return
  1060. } else {
  1061. if result2 > 0 {
  1062. Nganu, _ := client.GetRecentMessagesV2(op.Message.To)
  1063. Mid := []string{}
  1064. unsed := []string{}
  1065. for _, chat := range Nganu {
  1066. if InArray2(Squadlist, chat.From_) {
  1067. Mid = append(Mid, chat.ID)
  1068. }
  1069. }
  1070. for i := 0; i < len(Mid); i++ {
  1071. if i < result2 {
  1072. unsed = append(unsed, Mid[i])
  1073. }
  1074. }
  1075. if len(unsed) != 0 {
  1076. exess, _ := SelectallBot(client, to)
  1077. if exess != nil {
  1078. for i := range exess {
  1079. Nganu2, _ := exess[i].GetRecentMessagesV2(op.Message.To)
  1080. for _, chat := range Nganu2 {
  1081. if chat.From_ == exess[i].MID {
  1082. if InArray2(unsed, chat.ID) {
  1083. exess[i].UnsendChatnume(to, chat.ID)
  1084. }
  1085. }
  1086. }
  1087. }
  1088. }
  1089. }
  1090. } else {
  1091. client.SendMessage(to, "out of range.")
  1092. }
  1093. }
  1094. } else {
  1095. client.SendMessage(to, "Msg not fund number")
  1096. }
  1097. }
  1098. }
  1099. } else if cmd == "purgeall" || cmd == Commands.Purgeall && Commands.Purgeall != "" {
  1100. rngcmd := GetComs(4, "purgeall")
  1101. if GetCodeprem(rngcmd, sender, to) {
  1102. if CheckExprd(client, to, sender) {
  1103. gr, _ := client.GetGroupIdsJoined()
  1104. all := []string{}
  1105. for _, aa := range gr {
  1106. _, memlist, _ := client.GetChatList(aa)
  1107. lkicks := []string{}
  1108. for _, v := range memlist {
  1109. if MemUser(aa, v) {
  1110. lkicks = append(lkicks, v)
  1111. }
  1112. }
  1113. lkick := []string{}
  1114. for _, ban := range lkicks {
  1115. if MemBan(aa, ban) {
  1116. lkick = append(lkick, ban)
  1117. all = append(all, ban)
  1118. }
  1119. }
  1120. nom := []*oop.Account{}
  1121. ilen := len(lkick)
  1122. xx := 0
  1123. exe := []*oop.Account{}
  1124. for _, c := range oop.GetRoom(aa).Client {
  1125. if !c.Limited {
  1126. exe = append(exe, c)
  1127. }
  1128. }
  1129. if len(exe) != 0 {
  1130. for i := 0; i < ilen; i++ {
  1131. if xx < len(exe) {
  1132. nom = append(nom, exe[xx])
  1133. xx += 1
  1134. } else {
  1135. xx = 0
  1136. nom = append(nom, exe[xx])
  1137. }
  1138. }
  1139. for i := 0; i < ilen; i++ {
  1140. target := lkick[i]
  1141. cl := nom[i]
  1142. go cl.DeleteOtherFromChats(aa, target)
  1143. }
  1144. time.Sleep(1 * time.Second)
  1145. }
  1146. }
  1147. newsend += fmt.Sprintf("Success purgeall %v user in blacklist", len(all))
  1148. logAccess(client, to, sender, "purgeall", all, msg.ToType)
  1149. }
  1150. }
  1151. } else if strings.HasPrefix(cmd, "gleave") {
  1152. rngcmd := GetComs(4, "gleave")
  1153. if GetCodeprem(rngcmd, sender, to) {
  1154. if CheckExprd(client, to, sender) {
  1155. result := strings.Split((cmd), " ")
  1156. if len(result) > 1 {
  1157. result2, err := strconv.Atoi(result[1])
  1158. if err != nil {
  1159. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  1160. return
  1161. } else {
  1162. if result2 > 0 {
  1163. su := "gleave"
  1164. str := ""
  1165. if strings.HasPrefix(text, Rname+" ") {
  1166. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  1167. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  1168. } else if strings.HasPrefix(text, Sname+" ") {
  1169. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  1170. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  1171. } else if strings.HasPrefix(text, Rname) {
  1172. str = strings.Replace(text, Rname+su+" ", "", 1)
  1173. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  1174. } else if strings.HasPrefix(text, Sname) {
  1175. str = strings.Replace(text, Sname+su+" ", "", 1)
  1176. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  1177. }
  1178. st := StripOut(str)
  1179. hapuss := oop.Archimed(st, tempgroup)
  1180. if len(hapuss) == 0 {
  1181. client.SendMessage(to, "Please input the right number\nSee group number with command groups")
  1182. return
  1183. }
  1184. names := []string{}
  1185. for _, gid := range hapuss {
  1186. name, mem := client.GetGroupInvitation(gid)
  1187. names = append(names, name)
  1188. anu := []string{}
  1189. for m := range mem {
  1190. if InArray2(Squadlist, m) {
  1191. anu = append(anu, m)
  1192. }
  1193. }
  1194. if len(anu) != 0 {
  1195. for _, mid := range anu {
  1196. cl := GetKorban(mid)
  1197. cl.AcceptGroupInvitationNormal(gid)
  1198. oop.GetRoom(gid).ConvertGo(cl)
  1199. }
  1200. }
  1201. GetSquad(client, gid)
  1202. room := oop.GetRoom(gid)
  1203. bk = room.Client
  1204. for _, cl := range bk {
  1205. go cl.LeaveGroup(gid)
  1206. }
  1207. if LogGroup == gid {
  1208. LogMode = false
  1209. LogGroup = ""
  1210. }
  1211. oop.SquadRoom = oop.RemoveRoom(oop.SquadRoom, room)
  1212. }
  1213. strs := strings.Join(names, ", ")
  1214. client.SendMessage(to, "Bot's leave from group: \n\n"+strs)
  1215. }
  1216. }
  1217. } else {
  1218. newsend += "Group not found"
  1219. }
  1220. }
  1221. }
  1222. } else if strings.HasPrefix(cmd, "invme ") {
  1223. rngcmd := GetComs(4, "invme")
  1224. if GetCodeprem(rngcmd, sender, to) {
  1225. if CheckExprd(client, to, sender) {
  1226. result := strings.Split((cmd), " ")
  1227. if len(result) > 1 {
  1228. result2, err := strconv.Atoi(result[1])
  1229. if err != nil {
  1230. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  1231. return
  1232. } else {
  1233. if result2 > 0 {
  1234. if len(tempgroup) == 0 {
  1235. client.SendMessage(to, "Please input the right number\nSee group number with command groups")
  1236. return
  1237. }
  1238. nim, _ := strconv.Atoi(result[1])
  1239. nim = nim - 1
  1240. if result2 > 0 && result2 < len(tempgroup)+1 {
  1241. gid := tempgroup[nim]
  1242. GetSquad(client, gid)
  1243. room := oop.GetRoom(gid)
  1244. bk := room.Client
  1245. name, mem, inv := client.GetChatList(gid)
  1246. if InArray2(mem, msg.From_) {
  1247. client.SendMessage(to, "You was on group "+name)
  1248. return
  1249. } else {
  1250. if InArray2(inv, msg.From_) {
  1251. bk[0].CancelChatInvitations(gid, msg.From_)
  1252. }
  1253. for _, cl := range bk {
  1254. if !cl.Limited && !cl.Limitadd {
  1255. AddContact2(cl, msg.From_)
  1256. fl, _ := cl.GetAllContactIds()
  1257. if InArray2(fl, msg.From_) {
  1258. err := cl.InviteIntoGroupNormal(gid, []string{msg.From_})
  1259. if err != nil {
  1260. code := oop.GetCode(err)
  1261. if code != 35 && code != 10 {
  1262. client.SendMessage(to, "You has invited to group "+name)
  1263. return
  1264. }
  1265. } else {
  1266. client.SendMessage(to, "You has invited to group "+name)
  1267. return
  1268. }
  1269. }
  1270. }
  1271. }
  1272. newsend += "Sorry, all bot has invite banned"
  1273. }
  1274. } else {
  1275. newsend += "out of range."
  1276. }
  1277. }
  1278. }
  1279. } else {
  1280. newsend += "Group not found"
  1281. }
  1282. }
  1283. }
  1284. } else if strings.HasPrefix(cmd, "decline ") {
  1285. rngcmd := GetComs(1, "decline")
  1286. if GetCodeprem(rngcmd, sender, to) {
  1287. if CheckExprd(client, to, sender) {
  1288. result := strings.Split((cmd), " ")
  1289. if result[1] != "0" {
  1290. result2, err := strconv.Atoi(result[1])
  1291. if err != nil {
  1292. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  1293. return
  1294. } else {
  1295. if result2 > 0 {
  1296. num, _ := strconv.Atoi(result[1])
  1297. gr := []string{}
  1298. for i := range ClientBot {
  1299. grs, _ := ClientBot[i].GetGroupsInvited()
  1300. if len(grs) != 0 {
  1301. for _, a := range grs {
  1302. if !InArray2(gr, a) {
  1303. gr = append(gr, a)
  1304. }
  1305. }
  1306. }
  1307. }
  1308. grup, _ := client.GetGroups(gr)
  1309. tempgroup := []string{}
  1310. for _, gi := range grup {
  1311. if !InArray2(tempgroup, gi.ChatMid) {
  1312. tempgroup = append(tempgroup, gi.ChatMid)
  1313. }
  1314. }
  1315. if num > 0 && num <= len(tempgroup) {
  1316. exe := []*oop.Account{}
  1317. gen := tempgroup[num-1]
  1318. names, _, _ := client.GetChatList(tempgroup[num-1])
  1319. for i := range ClientBot {
  1320. if ClientMid[ClientBot[i].MID].Limited == false {
  1321. grs, _ := ClientBot[i].GetGroupsInvited()
  1322. if InArray2(grs, gen) {
  1323. exe = append(exe, ClientBot[i])
  1324. }
  1325. }
  1326. }
  1327. if len(exe) != 0 {
  1328. for i := range exe {
  1329. exe[i].RejectChatInvitation(gen)
  1330. }
  1331. newsend += fmt.Sprintf("Successfully declined invitation for: %v\n", names)
  1332. }
  1333. } else {
  1334. newsend += "out of range pendinglist.\n"
  1335. }
  1336. }
  1337. }
  1338. }
  1339. }
  1340. }
  1341. } else if strings.HasPrefix(cmd, "accept") && cmd != "acceptall" {
  1342. rngcmd := GetComs(4, "accept")
  1343. if GetCodeprem(rngcmd, sender, to) {
  1344. if CheckExprd(client, to, sender) {
  1345. result := strings.Split((cmd), " ")
  1346. if result[1] != "0" {
  1347. result2, err := strconv.Atoi(result[1])
  1348. if err != nil {
  1349. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  1350. return
  1351. } else {
  1352. if result2 > 0 {
  1353. su := "accept"
  1354. str := ""
  1355. if strings.HasPrefix(text, Rname+" ") {
  1356. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  1357. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  1358. } else if strings.HasPrefix(text, Sname+" ") {
  1359. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  1360. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  1361. } else if strings.HasPrefix(text, Rname) {
  1362. str = strings.Replace(text, Rname+su+" ", "", 1)
  1363. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  1364. } else if strings.HasPrefix(text, Sname) {
  1365. str = strings.Replace(text, Sname+su+" ", "", 1)
  1366. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  1367. }
  1368. st := StripOut(str)
  1369. hapuss := oop.Archimed(st, tempginv)
  1370. if len(hapuss) == 0 {
  1371. newsend += "Please input the right number\nSee group number with command groups"
  1372. } else {
  1373. names := []string{}
  1374. for _, gid := range hapuss {
  1375. name, mem := client.GetGroupInvitation(gid)
  1376. names = append(names, name)
  1377. anu := []string{}
  1378. for m := range mem {
  1379. if InArray2(Squadlist, m) {
  1380. anu = append(anu, m)
  1381. }
  1382. }
  1383. if len(anu) != 0 {
  1384. for _, mid := range anu {
  1385. cl := GetKorban(mid)
  1386. cl.AcceptGroupInvitationNormal(gid)
  1387. oop.GetRoom(gid).ConvertGo(cl)
  1388. }
  1389. }
  1390. }
  1391. str := strings.Join(names, ", ")
  1392. newsend += "Bot's join to group \n\n" + str
  1393. }
  1394. }
  1395. }
  1396. }
  1397. }
  1398. }
  1399. } else if cmd == "abort" {
  1400. rngcmd := GetComs(4, "abort")
  1401. if GetCodeprem(rngcmd, sender, to) {
  1402. if CheckExprd(client, to, sender) {
  1403. if remotegrupidto != "" {
  1404. client.SendMessage(remotegrupidto, "Done Have abort.")
  1405. } else {
  1406. newsend += "Done Have abort." + "\n"
  1407. }
  1408. abort()
  1409. }
  1410. }
  1411. } else if cmd == "declineall" {
  1412. rngcmd := GetComs(1, "declineall")
  1413. if GetCodeprem(rngcmd, sender, to) {
  1414. if CheckExprd(client, to, sender) {
  1415. tempgroup := []string{}
  1416. for i := range ClientBot {
  1417. grs, _ := ClientBot[i].GetGroupsInvited()
  1418. if len(grs) != 0 {
  1419. grup, _ := client.GetGroups(grs)
  1420. for _, gi := range grup {
  1421. if !InArray2(tempgroup, gi.ChatMid) {
  1422. tempgroup = append(tempgroup, gi.ChatMid)
  1423. }
  1424. ClientBot[i].RejectChatInvitation(gi.ChatMid)
  1425. }
  1426. time.Sleep(1 * time.Second)
  1427. }
  1428. }
  1429. if len(tempgroup) != 0 {
  1430. newsend += fmt.Sprintf("Successfully declined invitations: (%v)\n", len(tempgroup))
  1431. } else {
  1432. newsend += "pending list is empty.\n"
  1433. }
  1434. }
  1435. }
  1436. } else if cmd == "acceptall" {
  1437. rngcmd := GetComs(3, "acceptall")
  1438. if GetCodeprem(rngcmd, sender, to) {
  1439. if CheckExprd(client, to, sender) {
  1440. tempgroup := []string{}
  1441. for i := range ClientBot {
  1442. grs, _ := ClientBot[i].GetGroupsInvited()
  1443. if len(grs) != 0 {
  1444. grup, _ := client.GetGroups(grs)
  1445. for _, gi := range grup {
  1446. if !InArray2(tempgroup, gi.ChatMid) {
  1447. tempgroup = append(tempgroup, gi.ChatMid)
  1448. }
  1449. ClientBot[i].AcceptGroupInvitationNormal(gi.ChatMid)
  1450. oop.GetRoom(gi.ChatMid).ConvertGo(ClientBot[i])
  1451. time.Sleep(1 * time.Second)
  1452. }
  1453. }
  1454. }
  1455. if len(tempgroup) != 0 {
  1456. newsend += fmt.Sprintf("Success accept bot %v Group\n", len(tempgroup))
  1457. } else {
  1458. newsend += "pending list is empty.\n"
  1459. }
  1460. }
  1461. }
  1462. } else if strings.HasPrefix(cmd, "upstatus") {
  1463. rngcmd := GetComs(3, "upstatus")
  1464. if GetCodeprem(rngcmd, sender, to) {
  1465. if CheckExprd(client, to, sender) {
  1466. var str string
  1467. var su = "upstatus"
  1468. if strings.HasPrefix(text, Rname+" ") {
  1469. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  1470. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  1471. } else if strings.HasPrefix(text, Sname+" ") {
  1472. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  1473. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  1474. } else if strings.HasPrefix(text, Rname) {
  1475. str = strings.Replace(text, Rname+su+" ", "", 1)
  1476. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  1477. } else if strings.HasPrefix(text, Sname) {
  1478. str = strings.Replace(text, Sname+su+" ", "", 1)
  1479. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  1480. }
  1481. MsgBio = str
  1482. ChangeBio = true
  1483. timeabort = time.Now()
  1484. newsend += fmt.Sprintf("Which bot's should be Status %v", str)
  1485. }
  1486. }
  1487. } else if strings.HasPrefix(cmd, "upname") {
  1488. rngcmd := GetComs(3, "upname")
  1489. if GetCodeprem(rngcmd, sender, to) {
  1490. if CheckExprd(client, to, sender) {
  1491. var str string
  1492. var su = "upname"
  1493. if strings.HasPrefix(text, Rname+" ") {
  1494. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  1495. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  1496. } else if strings.HasPrefix(text, Sname+" ") {
  1497. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  1498. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  1499. } else if strings.HasPrefix(text, Rname) {
  1500. str = strings.Replace(text, Rname+su+" ", "", 1)
  1501. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  1502. } else if strings.HasPrefix(text, Sname) {
  1503. str = strings.Replace(text, Sname+su+" ", "", 1)
  1504. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  1505. }
  1506. aa := utf8.RuneCountInString(str)
  1507. if aa != 0 && aa <= 20 {
  1508. MsgName = str
  1509. ChangName = true
  1510. timeabort = time.Now()
  1511. newsend += fmt.Sprintf("Which bot's should be Name %v", str)
  1512. }
  1513. }
  1514. }
  1515. } else if cmd == "buyers" {
  1516. rngcmd := GetComs(3, "buyers")
  1517. if GetCodeprem(rngcmd, sender, to) {
  1518. if CheckExprd(client, to, sender) {
  1519. if len(UserBot.Buyer) != 0 {
  1520. list := " ✠ 𝗯𝘂𝘆𝗲𝗿𝘀 ✠ \n"
  1521. for num, xd := range UserBot.Buyer {
  1522. num++
  1523. rengs := strconv.Itoa(num)
  1524. new := client.Getcontactuser(xd)
  1525. if new != nil {
  1526. list += "\n " + rengs + ". Closed Account"
  1527. } else {
  1528. x, _ := client.GetContact(xd)
  1529. list += "\n " + rengs + ". " + x.DisplayName
  1530. }
  1531. }
  1532. newsend += list + "\n"
  1533. } else {
  1534. newsend += "Buyer list is empty.\n"
  1535. }
  1536. }
  1537. }
  1538. } else if cmd == "history" {
  1539. rngcmd := GetComs(4, "history")
  1540. if GetCodeprem(rngcmd, sender, to) {
  1541. if CheckExprd(client, to, sender) {
  1542. countK := 0
  1543. countinv := 0
  1544. countcancel := 0
  1545. for i := range ClientBot {
  1546. countK = countK + ClientBot[i].Ckick
  1547. countinv = countinv + ClientBot[i].Cinvite
  1548. countcancel = countcancel + ClientBot[i].Ccancel
  1549. }
  1550. list := fmt.Sprintf("History: \n\n Kick: %v \n Cancel: %v \n Invited: %v", countK, countcancel, countinv)
  1551. client.SendMessage(to, list)
  1552. }
  1553. }
  1554. } else if cmd == "clearhide" {
  1555. rngcmd := GetComs(4, "clearhide")
  1556. if GetCodeprem(rngcmd, sender, to) {
  1557. if CheckExprd(client, to, sender) {
  1558. if len(checkHaid) != 0 {
  1559. logAccess(client, to, sender, "clearhid", checkHaid, msg.ToType)
  1560. newsend += fmt.Sprintf("Cleared %v Hidelist\n", len(checkHaid))
  1561. checkHaid = []string{}
  1562. } else {
  1563. newsend += "Hide list is empty.\n"
  1564. }
  1565. }
  1566. }
  1567. } else if cmd == "hidelist" {
  1568. rngcmd := GetComs(4, "hidelist")
  1569. if GetCodeprem(rngcmd, sender, to) {
  1570. if CheckExprd(client, to, sender) {
  1571. if len(checkHaid) != 0 {
  1572. list := " ✠ Hide List ✠ \n"
  1573. for num, xd := range checkHaid {
  1574. num++
  1575. rengs := strconv.Itoa(num)
  1576. new := client.Getcontactuser(xd)
  1577. if new != nil {
  1578. list += "\n " + rengs + ". Closed Account"
  1579. } else {
  1580. x, _ := client.GetContact(xd)
  1581. list += "\n " + rengs + ". " + x.DisplayName
  1582. }
  1583. }
  1584. newsend += list + "\n"
  1585. } else {
  1586. newsend += "Hide list is empty.\n"
  1587. }
  1588. }
  1589. }
  1590. } else if strings.HasPrefix(cmd, "unhide") || strings.HasPrefix(cmd, "delhide") {
  1591. rngcmd := GetComs(4, "unhide")
  1592. if GetCodeprem(rngcmd, sender, to) {
  1593. if CheckExprd(client, to, sender) {
  1594. list := ""
  1595. listuser := []string{}
  1596. nCount1 := 0
  1597. nCount := 0
  1598. fl := strings.Split(cmd, " ")
  1599. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  1600. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  1601. matches := re.FindStringSubmatch(typec)
  1602. if len(matches) == 3 {
  1603. typec = matches[1]
  1604. nCount, _ = strconv.Atoi(matches[2])
  1605. }
  1606. if nCount == 0 {
  1607. nCount = 1
  1608. }
  1609. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  1610. if len(lists) != 0 {
  1611. for i := range lists {
  1612. if !InArray2(listuser, lists[i]) {
  1613. listuser = append(listuser, lists[i])
  1614. }
  1615. }
  1616. test1 := "User removed from hidelist:\n\n"
  1617. test2 := "User not exist in hidelist:\n\n"
  1618. for n, xx := range listuser {
  1619. if InArray2(checkHaid, xx) {
  1620. checkHaid = Remove(checkHaid, xx)
  1621. nCount1 = nCount1 + 1
  1622. }
  1623. rengs := strconv.Itoa(n + 1)
  1624. new := client.Getcontactuser(xx)
  1625. if new != nil {
  1626. list += rengs + ". Closed Account \n"
  1627. } else {
  1628. x, _ := client.GetContact(xx)
  1629. list += fmt.Sprintf("%v. %v\n", n+1, x.DisplayName)
  1630. }
  1631. }
  1632. if nCount1 != 0 {
  1633. client.SendMessage(to, test1+list)
  1634. } else {
  1635. client.SendMessage(to, test2+list)
  1636. }
  1637. } else {
  1638. result := strings.Split((cmd), " ")
  1639. if len(result) > 1 {
  1640. result2, err := strconv.Atoi(result[1])
  1641. if err != nil {
  1642. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  1643. return
  1644. } else {
  1645. if result2 > 0 {
  1646. su := "unhide"
  1647. str := ""
  1648. if strings.HasPrefix(text, Rname+" ") {
  1649. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  1650. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  1651. } else if strings.HasPrefix(text, Sname+" ") {
  1652. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  1653. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  1654. } else if strings.HasPrefix(text, Rname) {
  1655. str = strings.Replace(text, Rname+su+" ", "", 1)
  1656. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  1657. } else if strings.HasPrefix(text, Sname) {
  1658. str = strings.Replace(text, Sname+su+" ", "", 1)
  1659. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  1660. }
  1661. st := StripOut(str)
  1662. hapuss := oop.Archimed(st, checkHaid)
  1663. if len(hapuss) == 0 {
  1664. newsend += "User not found.\n"
  1665. } else {
  1666. for _, i := range hapuss {
  1667. if InArray2(checkHaid, i) {
  1668. checkHaid = Remove(checkHaid, i)
  1669. listuser = append(listuser, i)
  1670. }
  1671. }
  1672. if len(listuser) != 0 {
  1673. list += "User removed from hidelist:\n\n"
  1674. for n, xx := range listuser {
  1675. checkHaid = Remove(checkHaid, xx)
  1676. rengs := strconv.Itoa(n + 1)
  1677. new := client.Getcontactuser(xx)
  1678. if new != nil {
  1679. list += rengs + ". Closed Account \n"
  1680. } else {
  1681. x, _ := client.GetContact(xx)
  1682. list += fmt.Sprintf("%v. %v\n", n+1, x.DisplayName)
  1683. }
  1684. }
  1685. client.SendMessage(to, list)
  1686. }
  1687. }
  1688. }
  1689. }
  1690. } else {
  1691. newsend += "User not found.\n"
  1692. }
  1693. }
  1694. }
  1695. }
  1696. } else if strings.HasPrefix(cmd, "hide") && cmd != "hidelist" {
  1697. rngcmd := GetComs(4, "hide")
  1698. if GetCodeprem(rngcmd, sender, to) {
  1699. if CheckExprd(client, to, sender) {
  1700. listuser := []string{}
  1701. nCount := 0
  1702. nCount1 := 0
  1703. list := ""
  1704. fl := strings.Split(cmd, " ")
  1705. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  1706. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  1707. matches := re.FindStringSubmatch(typec)
  1708. if len(matches) == 3 {
  1709. typec = matches[1]
  1710. nCount, _ = strconv.Atoi(matches[2])
  1711. }
  1712. if nCount == 0 {
  1713. nCount = 1
  1714. }
  1715. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  1716. if len(lists) != 0 {
  1717. for i := range lists {
  1718. if !InArray2(listuser, lists[i]) {
  1719. listuser = append(listuser, lists[i])
  1720. }
  1721. }
  1722. test1 := "User added to hidelist:\n\n"
  1723. test2 := "User already exist in hidelist:\n\n"
  1724. for n, xx := range listuser {
  1725. if !InArray2(checkHaid, xx) {
  1726. checkHaid = append(checkHaid, xx)
  1727. nCount1 = nCount1 + 1
  1728. }
  1729. rengs := strconv.Itoa(n + 1)
  1730. new := client.Getcontactuser(xx)
  1731. if new != nil {
  1732. list += rengs + ". Closed Account \n"
  1733. } else {
  1734. x, _ := client.GetContact(xx)
  1735. list += fmt.Sprintf("%v. %v\n", n+1, x.DisplayName)
  1736. }
  1737. }
  1738. if nCount1 != 0 {
  1739. client.SendMessage(to, test1+list)
  1740. } else {
  1741. client.SendMessage(to, test2+list)
  1742. }
  1743. }
  1744. }
  1745. }
  1746. } else if strings.HasPrefix(cmd, "owner") && cmd != "owners" {
  1747. if GetCodeprem(3, sender, to) {
  1748. if CheckExprd(client, to, sender) {
  1749. listuser := []string{}
  1750. nCount := 0
  1751. x := 2
  1752. fl := strings.Split(cmd, " ")
  1753. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  1754. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  1755. matches := re.FindStringSubmatch(typec)
  1756. if len(matches) == 3 {
  1757. typec = matches[1]
  1758. nCount, _ = strconv.Atoi(matches[2])
  1759. }
  1760. if nCount == 0 {
  1761. nCount = 1
  1762. }
  1763. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  1764. if len(lists) != 0 {
  1765. for i := range lists {
  1766. if !InArray2(listuser, lists[i]) {
  1767. listuser = append(listuser, lists[i])
  1768. }
  1769. }
  1770. Checklistaccess(client, to, listuser, x, sender)
  1771. }
  1772. }
  1773. }
  1774. } else if strings.HasPrefix(cmd, "unowner") {
  1775. if GetCodeprem(3, sender, to) {
  1776. if CheckExprd(client, to, sender) {
  1777. listuser := []string{}
  1778. nCount := 0
  1779. x := 2
  1780. fl := strings.Split(cmd, " ")
  1781. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  1782. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  1783. matches := re.FindStringSubmatch(typec)
  1784. if len(matches) == 3 {
  1785. typec = matches[1]
  1786. nCount, _ = strconv.Atoi(matches[2])
  1787. }
  1788. if nCount == 0 {
  1789. nCount = 1
  1790. }
  1791. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  1792. if len(lists) != 0 {
  1793. for i := range lists {
  1794. if !InArray2(listuser, lists[i]) {
  1795. listuser = append(listuser, lists[i])
  1796. }
  1797. }
  1798. Checklistexpel(client, to, listuser, x, sender)
  1799. } else {
  1800. result := strings.Split((cmd), " ")
  1801. if len(result) > 1 {
  1802. result2, err := strconv.Atoi(result[1])
  1803. if err != nil {
  1804. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  1805. return
  1806. } else {
  1807. if result2 > 0 {
  1808. su := "unowner"
  1809. str := ""
  1810. if strings.HasPrefix(text, Rname+" ") {
  1811. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  1812. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  1813. } else if strings.HasPrefix(text, Sname+" ") {
  1814. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  1815. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  1816. } else if strings.HasPrefix(text, Rname) {
  1817. str = strings.Replace(text, Rname+su+" ", "", 1)
  1818. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  1819. } else if strings.HasPrefix(text, Sname) {
  1820. str = strings.Replace(text, Sname+su+" ", "", 1)
  1821. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  1822. }
  1823. st := StripOut(str)
  1824. hapuss := oop.Archimed(st, UserBot.Owner)
  1825. if len(hapuss) == 0 {
  1826. newsend += "User not found.\n"
  1827. } else {
  1828. Checklistexpel(client, to, hapuss, x, sender)
  1829. }
  1830. }
  1831. }
  1832. } else {
  1833. newsend += "User not found.\n"
  1834. }
  1835. }
  1836. }
  1837. }
  1838. } else if cmd == "clearowner" {
  1839. if GetCodeprem(3, sender, to) {
  1840. if CheckExprd(client, to, sender) {
  1841. if len(UserBot.Owner) != 0 {
  1842. logAccess(client, to, sender, "clearowner", UserBot.Owner, msg.ToType)
  1843. newsend += fmt.Sprintf("Cleared %v ownerlist\n", len(UserBot.Owner))
  1844. UserBot.ClearOwner()
  1845. } else {
  1846. newsend += "Owner list is empty.\n"
  1847. }
  1848. }
  1849. }
  1850. } else if cmd == "logmode on" {
  1851. rngcmd := GetComs(4, "logmode")
  1852. if GetCodeprem(rngcmd, sender, to) {
  1853. if CheckExprd(client, to, sender) {
  1854. if LogGroup == to {
  1855. LogMode = true
  1856. newsend += "Already enabled.\n"
  1857. } else {
  1858. LogMode = true
  1859. LogGroup = to
  1860. newsend += "Logmode is enabled.\n"
  1861. }
  1862. }
  1863. }
  1864. } else if cmd == "logmode off" {
  1865. rngcmd := GetComs(4, "logmode")
  1866. if GetCodeprem(rngcmd, sender, to) {
  1867. if CheckExprd(client, to, sender) {
  1868. if LogGroup == to {
  1869. LogMode = false
  1870. LogGroup = ""
  1871. newsend += "Logmode is disabled.\n"
  1872. } else {
  1873. newsend += "Already disabled.\n"
  1874. }
  1875. }
  1876. }
  1877. } else if strings.HasPrefix(cmd, "setsname ") {
  1878. rngcmd := GetComs(3, "setsname")
  1879. if GetCodeprem(rngcmd, sender, to) {
  1880. if CheckExprd(client, to, sender) {
  1881. result := strings.Replace(cmd, "setsname ", "", 1)
  1882. if result == "," || result == "" {
  1883. MsSname = ","
  1884. } else {
  1885. MsSname = result
  1886. }
  1887. newsend += "Sname set to: " + Sname + "\n"
  1888. }
  1889. }
  1890. } else if strings.HasPrefix(cmd, "setrname ") {
  1891. rngcmd := GetComs(3, "setrname")
  1892. if GetCodeprem(rngcmd, sender, to) {
  1893. if CheckExprd(client, to, sender) {
  1894. result := strings.Replace(cmd, "setrname ", "", 1)
  1895. if result == "," || result == "" {
  1896. MsRname = ","
  1897. } else {
  1898. MsRname = result
  1899. }
  1900. newsend += "Succes update Rname to " + Rname + "\n"
  1901. }
  1902. }
  1903. } else if strings.HasPrefix(cmd, "msgrespon") {
  1904. rngcmd := GetComs(3, "msgrespon")
  1905. if GetCodeprem(rngcmd, sender, to) {
  1906. if CheckExprd(client, to, sender) {
  1907. var str string
  1908. var su = "msgrespon"
  1909. if strings.HasPrefix(text, Rname+" ") {
  1910. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  1911. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  1912. } else if strings.HasPrefix(text, Sname+" ") {
  1913. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  1914. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  1915. } else if strings.HasPrefix(text, Rname) {
  1916. str = strings.Replace(text, Rname+su+" ", "", 1)
  1917. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  1918. } else if strings.HasPrefix(text, Sname) {
  1919. str = strings.Replace(text, Sname+su+" ", "", 1)
  1920. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  1921. }
  1922. MsgRespon = str
  1923. newsend += "Message respon set to: " + str + "\n"
  1924. }
  1925. }
  1926. } else if strings.HasPrefix(cmd, "upgname") {
  1927. rngcmd := GetComs(3, "upgname")
  1928. if GetCodeprem(rngcmd, sender, to) {
  1929. if CheckExprd(client, to, sender) {
  1930. var str string
  1931. var su = "upgname"
  1932. if strings.HasPrefix(text, Rname+" ") {
  1933. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  1934. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  1935. } else if strings.HasPrefix(text, Sname+" ") {
  1936. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  1937. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  1938. } else if strings.HasPrefix(text, Rname) {
  1939. str = strings.Replace(text, Rname+su+" ", "", 1)
  1940. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  1941. } else if strings.HasPrefix(text, Sname) {
  1942. str = strings.Replace(text, Sname+su+" ", "", 1)
  1943. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  1944. }
  1945. client.UpdateChatName(to, str)
  1946. newsend += "group name has been changed to: " + str + "\n"
  1947. }
  1948. }
  1949. } else if strings.HasPrefix(cmd, "setlogo") {
  1950. rngcmd := GetComs(3, "setlogo")
  1951. if GetCodeprem(rngcmd, sender, to) {
  1952. if CheckExprd(client, to, sender) {
  1953. var str string
  1954. var su = "setlogo"
  1955. if strings.HasPrefix(text, Rname+" ") {
  1956. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  1957. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  1958. } else if strings.HasPrefix(text, Sname+" ") {
  1959. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  1960. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  1961. } else if strings.HasPrefix(text, Rname) {
  1962. str = strings.Replace(text, Rname+su+" ", "", 1)
  1963. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  1964. } else if strings.HasPrefix(text, Sname) {
  1965. str = strings.Replace(text, Sname+su+" ", "", 1)
  1966. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  1967. }
  1968. Data.Logobot = str
  1969. newsend += "Menu logo set to: " + str + "\n"
  1970. }
  1971. }
  1972. } else if strings.HasPrefix(cmd, "msgwelcome") {
  1973. rngcmd := GetComs(3, "msgwelcome")
  1974. if GetCodeprem(rngcmd, sender, to) {
  1975. if CheckExprd(client, to, sender) {
  1976. var str string
  1977. var su = "msgwelcome"
  1978. if strings.HasPrefix(text, Rname+" ") {
  1979. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  1980. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  1981. } else if strings.HasPrefix(text, Sname+" ") {
  1982. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  1983. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  1984. } else if strings.HasPrefix(text, Rname) {
  1985. str = strings.Replace(text, Rname+su+" ", "", 1)
  1986. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  1987. } else if strings.HasPrefix(text, Sname) {
  1988. str = strings.Replace(text, Sname+su+" ", "", 1)
  1989. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  1990. }
  1991. room.WelcomeMsg = str
  1992. newsend += "Message Welcome set to: " + str + "\n"
  1993. }
  1994. }
  1995. } else if strings.HasPrefix(cmd, "msgleave") {
  1996. rngcmd := GetComs(3, "msgleave")
  1997. if GetCodeprem(rngcmd, sender, to) {
  1998. if CheckExprd(client, to, sender) {
  1999. var str string
  2000. var su = "msgleave"
  2001. if strings.HasPrefix(text, Rname+" ") {
  2002. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  2003. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  2004. } else if strings.HasPrefix(text, Sname+" ") {
  2005. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  2006. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  2007. } else if strings.HasPrefix(text, Rname) {
  2008. str = strings.Replace(text, Rname+su+" ", "", 1)
  2009. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  2010. } else if strings.HasPrefix(text, Sname) {
  2011. str = strings.Replace(text, Sname+su+" ", "", 1)
  2012. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  2013. }
  2014. room.MsgLeave = str
  2015. newsend += "Message Leave set to: " + str + "\n"
  2016. }
  2017. }
  2018. } else if strings.HasPrefix(cmd, "msgunban ") {
  2019. rngcmd := GetComs(3, "msgunban")
  2020. if GetCodeprem(rngcmd, sender, to) {
  2021. if CheckExprd(client, to, sender) {
  2022. result := strings.Replace(cmd, "msgunban ", "", 1)
  2023. MsgBan = result
  2024. newsend += "Message unban set to: " + result + "\n"
  2025. }
  2026. }
  2027. } else if strings.HasPrefix(cmd, "msglurk") {
  2028. rngcmd := GetComs(3, "msglurk")
  2029. if GetCodeprem(rngcmd, sender, to) {
  2030. if CheckExprd(client, to, sender) {
  2031. var str string
  2032. var su = "msglurk"
  2033. if strings.HasPrefix(text, Rname+" ") {
  2034. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  2035. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  2036. } else if strings.HasPrefix(text, Sname+" ") {
  2037. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  2038. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  2039. } else if strings.HasPrefix(text, Rname) {
  2040. str = strings.Replace(text, Rname+su+" ", "", 1)
  2041. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  2042. } else if strings.HasPrefix(text, Sname) {
  2043. str = strings.Replace(text, Sname+su+" ", "", 1)
  2044. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  2045. }
  2046. room.MsgLurk = str
  2047. newsend += "Message sider set to: " + str + "\n"
  2048. }
  2049. }
  2050. } else if strings.HasPrefix(cmd, "msgfresh ") {
  2051. rngcmd := GetComs(3, "msgfresh")
  2052. if GetCodeprem(rngcmd, sender, to) {
  2053. if CheckExprd(client, to, sender) {
  2054. result := strings.Replace(cmd, "msgfresh ", "", 1)
  2055. MsFresh = result
  2056. newsend += "Message fresh set to: " + result + "\n"
  2057. }
  2058. }
  2059. } else if strings.HasPrefix(cmd, "msglimit ") {
  2060. rngcmd := GetComs(3, "msglimit")
  2061. if GetCodeprem(rngcmd, sender, to) {
  2062. if CheckExprd(client, to, sender) {
  2063. result := strings.Replace(cmd, "msglimit ", "", 1)
  2064. MsLimit = result
  2065. newsend += "Message limit set to: " + result + "\n"
  2066. }
  2067. }
  2068. } else if strings.HasPrefix(cmd, "setkick ") {
  2069. rngcmd := GetComs(3, "setkick")
  2070. if GetCodeprem(rngcmd, sender, to) {
  2071. if CheckExprd(client, to, sender) {
  2072. anjay := strings.Split((cmd), " ")
  2073. num, err := strconv.Atoi(anjay[1])
  2074. if err != nil {
  2075. newsend += "Please use number!\n"
  2076. } else {
  2077. MaxKick = num
  2078. newsend += "Limiter kick set to " + anjay[1] + "\n"
  2079. }
  2080. }
  2081. }
  2082. } else if strings.HasPrefix(cmd, "setcancel ") {
  2083. rngcmd := GetComs(3, "setcancel")
  2084. if GetCodeprem(rngcmd, sender, to) {
  2085. anjay := strings.Split((cmd), " ")
  2086. num, err := strconv.Atoi(anjay[1])
  2087. if err != nil {
  2088. newsend += "Please use number!\n"
  2089. } else {
  2090. MaxCancel = num
  2091. newsend += "Limiter cancel set to " + anjay[1] + "\n"
  2092. }
  2093. }
  2094. } else if strings.HasPrefix(cmd, "setlimiter ") {
  2095. rngcmd := GetComs(3, "setlimiter")
  2096. if GetCodeprem(rngcmd, sender, to) {
  2097. if CheckExprd(client, to, sender) {
  2098. result := strings.Split((cmd), " ")
  2099. no, err := strconv.Atoi(result[1])
  2100. if err != nil {
  2101. newsend += "Please use number!\n"
  2102. } else {
  2103. MaxKick = no
  2104. MaxCancel = no
  2105. newsend += "Limiter successs set to " + result[1] + "\n"
  2106. }
  2107. }
  2108. }
  2109. } else if strings.HasPrefix(cmd, "fuck") && cmd != "fucklist" {
  2110. rngcmd := GetComs(4, "fuck")
  2111. if GetCodeprem(rngcmd, sender, to) {
  2112. if CheckExprd(client, to, sender) {
  2113. listuser := []string{}
  2114. nCount := 0
  2115. x := 9
  2116. fl := strings.Split(cmd, " ")
  2117. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  2118. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  2119. matches := re.FindStringSubmatch(typec)
  2120. if len(matches) == 3 {
  2121. typec = matches[1]
  2122. nCount, _ = strconv.Atoi(matches[2])
  2123. }
  2124. if nCount == 0 {
  2125. nCount = 1
  2126. }
  2127. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  2128. if len(lists) != 0 {
  2129. for i := range lists {
  2130. if !InArray2(listuser, lists[i]) {
  2131. listuser = append(listuser, lists[i])
  2132. }
  2133. }
  2134. Checklistaccess(client, to, listuser, x, sender)
  2135. }
  2136. }
  2137. }
  2138. } else if strings.HasPrefix(cmd, "mute") && cmd != "mutelist" {
  2139. rngcmd := GetComs(4, "mute")
  2140. if GetCodeprem(rngcmd, sender, to) {
  2141. if CheckExprd(client, to, sender) {
  2142. listuser := []string{}
  2143. nCount := 0
  2144. x := 11
  2145. fl := strings.Split(cmd, " ")
  2146. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  2147. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  2148. matches := re.FindStringSubmatch(typec)
  2149. if len(matches) == 3 {
  2150. typec = matches[1]
  2151. nCount, _ = strconv.Atoi(matches[2])
  2152. }
  2153. if nCount == 0 {
  2154. nCount = 1
  2155. }
  2156. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  2157. if len(lists) != 0 {
  2158. for i := range lists {
  2159. if !InArray2(listuser, lists[i]) {
  2160. listuser = append(listuser, lists[i])
  2161. }
  2162. }
  2163. Checklistaccess(client, to, listuser, x, sender)
  2164. }
  2165. }
  2166. }
  2167. } else if strings.HasPrefix(cmd, "whois") {
  2168. rngcmd := GetComs(4, "whois")
  2169. if GetCodeprem(rngcmd, sender, to) {
  2170. if CheckExprd(client, to, sender) {
  2171. listuser := []string{}
  2172. nCount := 0
  2173. x := 12
  2174. fl := strings.Split(cmd, " ")
  2175. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  2176. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  2177. matches := re.FindStringSubmatch(typec)
  2178. if len(matches) == 3 {
  2179. typec = matches[1]
  2180. nCount, _ = strconv.Atoi(matches[2])
  2181. }
  2182. if nCount == 0 {
  2183. nCount = 1
  2184. }
  2185. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  2186. if len(lists) != 0 {
  2187. for i := range lists {
  2188. if !InArray2(listuser, lists[i]) {
  2189. listuser = append(listuser, lists[i])
  2190. }
  2191. }
  2192. Checklistaccess(client, to, listuser, x, sender)
  2193. }
  2194. }
  2195. }
  2196. } else if strings.HasPrefix(cmd, "name") {
  2197. rngcmd := GetComs(4, "name")
  2198. if GetCodeprem(rngcmd, sender, to) {
  2199. if CheckExprd(client, to, sender) {
  2200. listuser := []string{}
  2201. nCount := 0
  2202. x := 16
  2203. fl := strings.Split(cmd, " ")
  2204. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  2205. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  2206. matches := re.FindStringSubmatch(typec)
  2207. if len(matches) == 3 {
  2208. typec = matches[1]
  2209. nCount, _ = strconv.Atoi(matches[2])
  2210. }
  2211. if nCount == 0 {
  2212. nCount = 1
  2213. }
  2214. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  2215. if len(lists) != 0 {
  2216. for i := range lists {
  2217. if !InArray2(listuser, lists[i]) {
  2218. listuser = append(listuser, lists[i])
  2219. }
  2220. }
  2221. Checklistaccess(client, to, listuser, x, sender)
  2222. }
  2223. }
  2224. }
  2225. } else if strings.HasPrefix(cmd, "mid") {
  2226. rngcmd := GetComs(4, "mid")
  2227. if GetCodeprem(rngcmd, sender, to) {
  2228. if CheckExprd(client, to, sender) {
  2229. listuser := []string{}
  2230. nCount := 0
  2231. x := 14
  2232. fl := strings.Split(cmd, " ")
  2233. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  2234. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  2235. matches := re.FindStringSubmatch(typec)
  2236. if len(matches) == 3 {
  2237. typec = matches[1]
  2238. nCount, _ = strconv.Atoi(matches[2])
  2239. }
  2240. if nCount == 0 {
  2241. nCount = 1
  2242. }
  2243. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  2244. if len(lists) != 0 {
  2245. for i := range lists {
  2246. if !InArray2(listuser, lists[i]) {
  2247. listuser = append(listuser, lists[i])
  2248. }
  2249. }
  2250. Checklistaccess(client, to, listuser, x, sender)
  2251. }
  2252. }
  2253. }
  2254. } else if strings.HasPrefix(cmd, "unmute") {
  2255. rngcmd := GetComs(4, "unmute")
  2256. if GetCodeprem(rngcmd, sender, to) {
  2257. if CheckExprd(client, to, sender) {
  2258. listuser := []string{}
  2259. nCount := 0
  2260. x := 4
  2261. fl := strings.Split(cmd, " ")
  2262. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  2263. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  2264. matches := re.FindStringSubmatch(typec)
  2265. if len(matches) == 3 {
  2266. typec = matches[1]
  2267. nCount, _ = strconv.Atoi(matches[2])
  2268. }
  2269. if nCount == 0 {
  2270. nCount = 1
  2271. }
  2272. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  2273. if len(lists) != 0 {
  2274. for i := range lists {
  2275. if !InArray2(listuser, lists[i]) {
  2276. listuser = append(listuser, lists[i])
  2277. }
  2278. }
  2279. checkunbanbots(client, to, listuser, x, sender)
  2280. } else {
  2281. result := strings.Split((cmd), " ")
  2282. if len(result) > 1 {
  2283. result2, err := strconv.Atoi(result[1])
  2284. if err != nil {
  2285. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  2286. return
  2287. } else {
  2288. if result2 > 0 {
  2289. su := "unmute"
  2290. str := ""
  2291. if strings.HasPrefix(text, Rname+" ") {
  2292. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  2293. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  2294. } else if strings.HasPrefix(text, Sname+" ") {
  2295. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  2296. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  2297. } else if strings.HasPrefix(text, Rname) {
  2298. str = strings.Replace(text, Rname+su+" ", "", 1)
  2299. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  2300. } else if strings.HasPrefix(text, Sname) {
  2301. str = strings.Replace(text, Sname+su+" ", "", 1)
  2302. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  2303. }
  2304. st := StripOut(str)
  2305. hapuss := oop.Archimed(st, Banned.Banlist)
  2306. if len(hapuss) == 0 {
  2307. newsend += "User not found.\n"
  2308. } else {
  2309. checkunbanbots(client, to, hapuss, x, sender)
  2310. }
  2311. }
  2312. }
  2313. } else {
  2314. newsend += "User not found.\n"
  2315. }
  2316. }
  2317. }
  2318. }
  2319. } else if cmd == "owners" {
  2320. if GetCodeprem(4, sender, to) {
  2321. if CheckExprd(client, to, sender) {
  2322. if len(UserBot.Owner) != 0 {
  2323. list := " 👑 𝗼𝘄𝗻𝗲𝗿𝘀 👑 \n"
  2324. for num, xd := range UserBot.Owner {
  2325. num++
  2326. rengs := strconv.Itoa(num)
  2327. new := client.Getcontactuser(xd)
  2328. if new != nil {
  2329. list += "\n " + rengs + ". Closed Account"
  2330. } else {
  2331. x, _ := client.GetContact(xd)
  2332. list += "\n " + rengs + ". " + x.DisplayName
  2333. }
  2334. }
  2335. newsend += list + "\n"
  2336. } else {
  2337. newsend += "Owner list is empty.\n"
  2338. }
  2339. }
  2340. }
  2341. } else if strings.HasPrefix(cmd, "unmaster") {
  2342. if GetCodeprem(4, sender, to) {
  2343. if CheckExprd(client, to, sender) {
  2344. listuser := []string{}
  2345. nCount := 0
  2346. x := 3
  2347. fl := strings.Split(cmd, " ")
  2348. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  2349. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  2350. matches := re.FindStringSubmatch(typec)
  2351. if len(matches) == 3 {
  2352. typec = matches[1]
  2353. nCount, _ = strconv.Atoi(matches[2])
  2354. }
  2355. if nCount == 0 {
  2356. nCount = 1
  2357. }
  2358. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  2359. if len(lists) != 0 {
  2360. for i := range lists {
  2361. if !InArray2(listuser, lists[i]) {
  2362. listuser = append(listuser, lists[i])
  2363. }
  2364. }
  2365. Checklistexpel(client, to, listuser, x, sender)
  2366. } else {
  2367. result := strings.Split((cmd), " ")
  2368. if len(result) > 1 {
  2369. result2, err := strconv.Atoi(result[1])
  2370. if err != nil {
  2371. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  2372. return
  2373. } else {
  2374. if result2 > 0 {
  2375. su := "unmaster"
  2376. str := ""
  2377. if strings.HasPrefix(text, Rname+" ") {
  2378. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  2379. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  2380. } else if strings.HasPrefix(text, Sname+" ") {
  2381. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  2382. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  2383. } else if strings.HasPrefix(text, Rname) {
  2384. str = strings.Replace(text, Rname+su+" ", "", 1)
  2385. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  2386. } else if strings.HasPrefix(text, Sname) {
  2387. str = strings.Replace(text, Sname+su+" ", "", 1)
  2388. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  2389. }
  2390. st := StripOut(str)
  2391. hapuss := oop.Archimed(st, UserBot.Master)
  2392. if len(hapuss) == 0 {
  2393. newsend += "User not found.\n"
  2394. } else {
  2395. Checklistexpel(client, to, hapuss, x, sender)
  2396. }
  2397. }
  2398. }
  2399. } else {
  2400. newsend += "User not found.\n"
  2401. }
  2402. }
  2403. }
  2404. }
  2405. } else if strings.HasPrefix(cmd, "ungowner") {
  2406. if GetCodeprem(4, sender, to) {
  2407. if CheckExprd(client, to, sender) {
  2408. listuser := []string{}
  2409. nCount := 0
  2410. x := 6
  2411. fl := strings.Split(cmd, " ")
  2412. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  2413. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  2414. matches := re.FindStringSubmatch(typec)
  2415. if len(matches) == 3 {
  2416. typec = matches[1]
  2417. nCount, _ = strconv.Atoi(matches[2])
  2418. }
  2419. if nCount == 0 {
  2420. nCount = 1
  2421. }
  2422. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  2423. if len(lists) != 0 {
  2424. for i := range lists {
  2425. if !InArray2(listuser, lists[i]) {
  2426. listuser = append(listuser, lists[i])
  2427. }
  2428. }
  2429. Checklistexpel(client, to, listuser, x, sender)
  2430. } else {
  2431. result := strings.Split((cmd), " ")
  2432. if len(result) > 1 {
  2433. result2, err := strconv.Atoi(result[1])
  2434. if err != nil {
  2435. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  2436. return
  2437. } else {
  2438. if result2 > 0 {
  2439. su := "ungowner"
  2440. str := ""
  2441. if strings.HasPrefix(text, Rname+" ") {
  2442. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  2443. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  2444. } else if strings.HasPrefix(text, Sname+" ") {
  2445. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  2446. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  2447. } else if strings.HasPrefix(text, Rname) {
  2448. str = strings.Replace(text, Rname+su+" ", "", 1)
  2449. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  2450. } else if strings.HasPrefix(text, Sname) {
  2451. str = strings.Replace(text, Sname+su+" ", "", 1)
  2452. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  2453. }
  2454. st := StripOut(str)
  2455. hapuss := oop.Archimed(st, room.Gowner)
  2456. if len(hapuss) == 0 {
  2457. newsend += "User not found.\n"
  2458. } else {
  2459. Checklistexpel(client, to, hapuss, x, sender)
  2460. }
  2461. }
  2462. }
  2463. } else {
  2464. newsend += "User not found.\n"
  2465. }
  2466. }
  2467. }
  2468. }
  2469. } else if cmd == "gojoin" {
  2470. rngcmd := GetComs(4, "gojoin")
  2471. if GetCodeprem(rngcmd, sender, to) {
  2472. if CheckExprd(client, to, sender) {
  2473. _, mem := client.GetGroupInvitation(to)
  2474. anu := []string{}
  2475. for m := range mem {
  2476. if InArray2(Squadlist, m) {
  2477. anu = append(anu, m)
  2478. }
  2479. }
  2480. if len(anu) != 0 {
  2481. for _, mid := range anu {
  2482. cl := GetKorban(mid)
  2483. cl.AcceptGroupInvitationNormal(to)
  2484. }
  2485. }
  2486. GetSquad(client, to)
  2487. }
  2488. }
  2489. } else if strings.HasPrefix(cmd, "master") && cmd != "masters" {
  2490. if GetCodeprem(4, sender, to) {
  2491. if CheckExprd(client, to, sender) {
  2492. listuser := []string{}
  2493. nCount := 0
  2494. x := 3
  2495. fl := strings.Split(cmd, " ")
  2496. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  2497. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  2498. matches := re.FindStringSubmatch(typec)
  2499. if len(matches) == 3 {
  2500. typec = matches[1]
  2501. nCount, _ = strconv.Atoi(matches[2])
  2502. }
  2503. if nCount == 0 {
  2504. nCount = 1
  2505. }
  2506. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  2507. if len(lists) != 0 {
  2508. for i := range lists {
  2509. if !InArray2(listuser, lists[i]) {
  2510. listuser = append(listuser, lists[i])
  2511. }
  2512. }
  2513. Checklistaccess(client, to, listuser, x, sender)
  2514. }
  2515. }
  2516. }
  2517. } else if strings.HasPrefix(cmd, "gowner") && cmd != "gowners" {
  2518. if GetCodeprem(6, sender, to) {
  2519. if CheckExprd(client, to, sender) {
  2520. listuser := []string{}
  2521. nCount := 0
  2522. x := 6
  2523. fl := strings.Split(cmd, " ")
  2524. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  2525. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  2526. matches := re.FindStringSubmatch(typec)
  2527. if len(matches) == 3 {
  2528. typec = matches[1]
  2529. nCount, _ = strconv.Atoi(matches[2])
  2530. }
  2531. if nCount == 0 {
  2532. nCount = 1
  2533. }
  2534. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  2535. if len(lists) != 0 {
  2536. for i := range lists {
  2537. if !InArray2(listuser, lists[i]) {
  2538. listuser = append(listuser, lists[i])
  2539. }
  2540. }
  2541. Checklistaccess(client, to, listuser, x, sender)
  2542. }
  2543. }
  2544. }
  2545. } else if strings.HasPrefix(cmd, "setcmd ") {
  2546. rngcmd := GetComs(4, "setcmd")
  2547. if GetCodeprem(rngcmd, sender, to) {
  2548. if CheckExprd(client, to, sender) {
  2549. txt := strings.ReplaceAll(cmd, "setcmd ", "")
  2550. texts := strings.Split(txt, " ")
  2551. if len(texts) > 1 {
  2552. new := Upsetcmd(texts[0], texts[1])
  2553. if new != "" {
  2554. newsend += new
  2555. } else {
  2556. newsend += "Cmd not found.\n"
  2557. }
  2558. } else {
  2559. newsend += "Cmd not found.\n"
  2560. }
  2561. }
  2562. }
  2563. } else if cmd == "restartcmd" {
  2564. rngcmd := GetComs(4, "restartcmd")
  2565. if GetCodeprem(rngcmd, sender, to) {
  2566. if CheckExprd(client, to, sender) {
  2567. Commands.Botname = ""
  2568. Commands.Upallimage = ""
  2569. Commands.Upallcover = ""
  2570. Commands.Unsend = ""
  2571. Commands.Upvallimage = ""
  2572. Commands.Upvallcover = ""
  2573. Commands.Appname = ""
  2574. Commands.Useragent = ""
  2575. Commands.Hostname = ""
  2576. Commands.Friends = ""
  2577. Commands.Adds = ""
  2578. Commands.Limits = ""
  2579. Commands.Addallbots = ""
  2580. Commands.Addallsquads = ""
  2581. Commands.Leave = ""
  2582. Commands.Respon = ""
  2583. Commands.Ping = ""
  2584. Commands.Count = ""
  2585. Commands.Limitout = ""
  2586. Commands.Access = ""
  2587. Commands.Allbanlist = ""
  2588. Commands.Allgaccess = ""
  2589. Commands.Gaccess = ""
  2590. Commands.Checkram = ""
  2591. Commands.Backups = ""
  2592. Commands.Upimage = ""
  2593. Commands.Upcover = ""
  2594. Commands.Upvimage = ""
  2595. Commands.Upvcover = ""
  2596. Commands.Bringall = ""
  2597. Commands.Purgeall = ""
  2598. Commands.Banlist = ""
  2599. Commands.Clearban = ""
  2600. Commands.Stayall = ""
  2601. Commands.Clearchat = ""
  2602. Commands.Here = ""
  2603. Commands.Speed = ""
  2604. Commands.Status = ""
  2605. Commands.Tagall = ""
  2606. Commands.Kick = ""
  2607. Commands.Max = ""
  2608. Commands.None = ""
  2609. Commands.Kickall = ""
  2610. Commands.Cancelall = ""
  2611. newsend += "Done restart all Cmd.\n"
  2612. }
  2613. }
  2614. } else if cmd == "cleargowner" {
  2615. if GetCodeprem(6, sender, to) {
  2616. if CheckExprd(client, to, sender) {
  2617. if len(room.Gowner) != 0 {
  2618. logAccess(client, to, sender, "cleargowner", room.Gowner, msg.ToType)
  2619. newsend += fmt.Sprintf("Cleared %v gownerlist\n", len(room.Gowner))
  2620. room.Gowner = []string{}
  2621. } else {
  2622. newsend += "Gowner list is empty.\n"
  2623. }
  2624. }
  2625. }
  2626. } else if cmd == "clearmaster" {
  2627. if GetCodeprem(4, sender, to) {
  2628. if CheckExprd(client, to, sender) {
  2629. if len(UserBot.Master) != 0 {
  2630. newsend += fmt.Sprintf("Cleared %v masterlist\n", len(UserBot.Master))
  2631. logAccess(client, to, sender, "clearmaster", UserBot.Master, msg.ToType)
  2632. UserBot.ClearMaster()
  2633. } else {
  2634. newsend += "Master list is empty.\n"
  2635. }
  2636. }
  2637. }
  2638. } else if cmd == "clearfuck" {
  2639. rngcmd := GetComs(4, "clearfuck")
  2640. if GetCodeprem(rngcmd, sender, to) {
  2641. if CheckExprd(client, to, sender) {
  2642. if len(Banned.Fucklist) != 0 {
  2643. logAccess(client, to, sender, "clearfuck", Banned.Fucklist, msg.ToType)
  2644. newsend += fmt.Sprintf("Cleared %v fucklist\n", len(Banned.Fucklist))
  2645. Banned.Fucklist = []string{}
  2646. } else {
  2647. newsend += "Fuck list is empty.\n"
  2648. }
  2649. }
  2650. }
  2651. } else if cmd == "clearmute" {
  2652. rngcmd := GetComs(4, "clearmute")
  2653. if GetCodeprem(rngcmd, sender, to) {
  2654. if CheckExprd(client, to, sender) {
  2655. if len(Banned.Mutelist) != 0 {
  2656. logAccess(client, to, sender, "clearmute", Banned.Mutelist, msg.ToType)
  2657. newsend += fmt.Sprintf("Cleared %v fucklist\n", len(Banned.Mutelist))
  2658. Banned.Mutelist = []string{}
  2659. } else {
  2660. newsend += "Mute list is empty.\n"
  2661. }
  2662. }
  2663. }
  2664. } else if cmd == "clear allprotect" {
  2665. if GetCodeprem(3, sender, to) {
  2666. if CheckExprd(client, to, sender) {
  2667. oop.ClearProtect()
  2668. newsend += "Cleared allprotected.\n"
  2669. }
  2670. }
  2671. } else if strings.HasPrefix(cmd, "perm ") {
  2672. if GetCodeprem(3, sender, to) {
  2673. if CheckExprd(client, to, sender) {
  2674. ditha := strings.ReplaceAll(cmd, "perm ", "")
  2675. cmdLil := strings.Split(ditha, " ")
  2676. Addpermcmd(client, to, cmdLil[0], cmdLil[1])
  2677. }
  2678. }
  2679. } else if cmd == "permlist" {
  2680. if GetCodeprem(3, sender, to) {
  2681. if CheckExprd(client, to, sender) {
  2682. list := PerCheckList()
  2683. if list != "" {
  2684. newsend += list
  2685. } else {
  2686. newsend += "Not have perm in list.\n"
  2687. }
  2688. }
  2689. }
  2690. } else if strings.HasPrefix(cmd, "autojoin") {
  2691. rngcmd := GetComs(4, "autojoin")
  2692. if GetCodeprem(rngcmd, sender, to) {
  2693. if CheckExprd(client, to, sender) {
  2694. var str string
  2695. var su = "autojoin"
  2696. if strings.HasPrefix(text, Rname+" ") {
  2697. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  2698. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  2699. } else if strings.HasPrefix(text, Sname+" ") {
  2700. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  2701. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  2702. } else if strings.HasPrefix(text, Rname) {
  2703. str = strings.Replace(text, Rname+su+" ", "", 1)
  2704. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  2705. } else if strings.HasPrefix(text, Sname) {
  2706. str = strings.Replace(text, Sname+su+" ", "", 1)
  2707. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  2708. }
  2709. if str == "invite" {
  2710. if Autojoin != "invite" {
  2711. Autojoin = "invite"
  2712. newsend += "Autojoin Invite enabled.\n"
  2713. } else {
  2714. newsend += "Autojoin Already Invite.\n"
  2715. }
  2716. } else if str == "qr" {
  2717. if Autojoin != "qr" {
  2718. Autojoin = "qr"
  2719. newsend += "Autojoin qr enabled.\n"
  2720. } else {
  2721. newsend += "Autojoin Already qr.\n"
  2722. }
  2723. } else if str == "off" {
  2724. if Autojoin != "off" {
  2725. Autojoin = "off"
  2726. newsend += fmt.Sprintf("Autojoin %s disabled.\n", Autojoin)
  2727. } else {
  2728. newsend += "Autojoin Already disabled.\n"
  2729. }
  2730. }
  2731. }
  2732. }
  2733. } else if cmd == "mutelist" {
  2734. rngcmd := GetComs(4, "mutelist")
  2735. if GetCodeprem(rngcmd, sender, to) {
  2736. if CheckExprd(client, to, sender) {
  2737. if len(Banned.Mutelist) != 0 {
  2738. list := "Mutelist:"
  2739. client.SendPollMention(to, list, Banned.Mutelist)
  2740. } else {
  2741. newsend += "Mute list is empty.\n"
  2742. }
  2743. }
  2744. }
  2745. } else if cmd == "fucklist" {
  2746. rngcmd := GetComs(4, "fucklist")
  2747. if GetCodeprem(rngcmd, sender, to) {
  2748. if CheckExprd(client, to, sender) {
  2749. if len(Banned.Fucklist) != 0 {
  2750. list := "Fucklist:"
  2751. client.SendPollMention(to, list, Banned.Fucklist)
  2752. } else {
  2753. newsend += "Fuck list is empty.\n"
  2754. }
  2755. }
  2756. }
  2757. } else if strings.HasPrefix(cmd, "groupcast") {
  2758. rngcmd := GetComs(4, "groupcast")
  2759. if GetCodeprem(rngcmd, sender, to) {
  2760. if CheckExprd(client, to, sender) {
  2761. su := "groupcast"
  2762. str := ""
  2763. if strings.HasPrefix(text, Rname+" ") {
  2764. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  2765. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  2766. } else if strings.HasPrefix(text, Sname+" ") {
  2767. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  2768. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  2769. } else if strings.HasPrefix(text, Rname) {
  2770. str = strings.Replace(text, Rname+su+" ", "", 1)
  2771. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  2772. } else if strings.HasPrefix(text, Sname) {
  2773. str = strings.Replace(text, Sname+su+" ", "", 1)
  2774. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  2775. }
  2776. if len(str) != 0 {
  2777. gr, _ := client.GetGroupIdsJoined()
  2778. for _, gi := range gr {
  2779. client.SendMessage(gi, str)
  2780. }
  2781. newsend += "Success broadcast to " + strconv.Itoa(len(gr)) + " group\n"
  2782. }
  2783. }
  2784. }
  2785. } else if strings.HasPrefix(cmd, "gourl ") {
  2786. rngcmd := GetComs(4, "gourl")
  2787. if GetCodeprem(rngcmd, sender, to) {
  2788. if CheckExprd(client, to, sender) {
  2789. result := strings.Split((cmd), " ")
  2790. num, err := strconv.Atoi(result[1])
  2791. if err != nil {
  2792. newsend += "invalid number.\n"
  2793. } else {
  2794. gr := []string{}
  2795. for i := range ClientBot {
  2796. grs, _ := ClientBot[i].GetGroupIdsJoined()
  2797. for _, a := range grs {
  2798. if !InArray2(gr, a) {
  2799. gr = append(gr, a)
  2800. }
  2801. }
  2802. }
  2803. groups, _ := client.GetGroups(gr)
  2804. tempgroup := []string{}
  2805. for _, gi := range groups {
  2806. tempgroup = append(tempgroup, gi.ChatMid)
  2807. }
  2808. if num > 0 && num <= len(tempgroup) {
  2809. gid := tempgroup[num-1]
  2810. tick, err := client.ReissueChatTicket(gid)
  2811. if err == nil {
  2812. var err error
  2813. mes := make(chan bool)
  2814. go func() {
  2815. err = client.UpdateChatQrV2(gid, false)
  2816. if err != nil {
  2817. mes <- false
  2818. } else {
  2819. mes <- true
  2820. }
  2821. }()
  2822. newsend += "https://line.me/R/ti/g/" + tick + "\n"
  2823. }
  2824. } else {
  2825. newsend += "out of range.\n"
  2826. }
  2827. }
  2828. }
  2829. }
  2830. } else if cmd == "groups" {
  2831. rngcmd := GetComs(3, "groups")
  2832. if GetCodeprem(rngcmd, sender, to) {
  2833. if CheckExprd(client, to, sender) {
  2834. gr := []string{}
  2835. for _, p := range ClientBot {
  2836. if !p.Frez {
  2837. grs, _ := p.GetGroupIdsJoined()
  2838. for _, a := range grs {
  2839. if !InArray2(gr, a) {
  2840. gr = append(gr, a)
  2841. }
  2842. }
  2843. }
  2844. }
  2845. nm := []string{}
  2846. grup, _ := client.GetGroups(gr)
  2847. ci := []string{}
  2848. for _, g := range grup {
  2849. ci = append(ci, strings.ToLower(g.ChatName))
  2850. }
  2851. sort.Strings(ci)
  2852. groups := []*talkservice.Chat{}
  2853. tempgroup = []string{}
  2854. for _, x := range ci {
  2855. for _, gi := range grup {
  2856. if strings.ToLower(gi.ChatName) == x {
  2857. if !InArrayChat(groups, gi) {
  2858. groups = append(groups, gi)
  2859. tempgroup = append(tempgroup, gi.ChatMid)
  2860. }
  2861. }
  2862. }
  2863. }
  2864. for c, a := range groups {
  2865. name, mem := a.ChatName, a.Extra.GroupExtra.MemberMids
  2866. c += 1
  2867. jm := 0
  2868. for mid := range mem {
  2869. if InArray2(Squadlist, mid) {
  2870. jm++
  2871. }
  2872. }
  2873. name = fmt.Sprintf("%v. %s (%v/%v)", c, name, jm, len(mem))
  2874. nm = append(nm, name)
  2875. GetSquad(client, a.ChatMid)
  2876. }
  2877. stf := "All Group List:\n\n"
  2878. str := strings.Join(nm, "\n")
  2879. anu := []string{}
  2880. for _, p := range ClientBot {
  2881. if !p.Frez {
  2882. grs, _ := p.GetGroupIdsInvited()
  2883. for _, a := range grs {
  2884. if !InArray2(gr, a) && !InArray2(anu, a) {
  2885. anu = append(anu, a)
  2886. }
  2887. }
  2888. }
  2889. }
  2890. grup, _ = client.GetGroups(anu)
  2891. ci = []string{}
  2892. for _, g := range grup {
  2893. ci = append(ci, strings.ToLower(g.ChatName))
  2894. }
  2895. sort.Strings(ci)
  2896. groups = []*talkservice.Chat{}
  2897. tempginv = []string{}
  2898. for _, x := range ci {
  2899. for _, gi := range grup {
  2900. if strings.ToLower(gi.ChatName) == x {
  2901. if !InArrayChat(groups, gi) {
  2902. groups = append(groups, gi)
  2903. tempginv = append(tempginv, gi.ChatMid)
  2904. }
  2905. }
  2906. }
  2907. }
  2908. nm = []string{}
  2909. nn := 1
  2910. for _, a := range groups {
  2911. name, mem, inv := a.ChatName, a.Extra.GroupExtra.MemberMids, a.Extra.GroupExtra.InviteeMids
  2912. if name != "" {
  2913. jm := 0
  2914. for mid := range inv {
  2915. if InArray2(Squadlist, mid) {
  2916. jm++
  2917. }
  2918. }
  2919. if jm != 0 {
  2920. name = fmt.Sprintf("%v. %s (invited) (%v/%v)", nn, name, jm, len(mem))
  2921. nm = append(nm, name)
  2922. GetSquad(client, a.ChatMid)
  2923. nn++
  2924. } else {
  2925. tempginv = Remove(tempginv, a.ChatMid)
  2926. }
  2927. } else {
  2928. tempginv = Remove(tempginv, a.ChatMid)
  2929. }
  2930. }
  2931. var strs, strsa = "", ""
  2932. if len(nm) != 0 {
  2933. strs = "\n\nAll Group Invitation:\n\n"
  2934. strsa = strings.Join(nm, "\n")
  2935. }
  2936. newsend += stf + str + strs + strsa
  2937. }
  2938. }
  2939. } else if strings.HasPrefix(cmd, "nukejoin ") {
  2940. rngcmd := GetComs(3, "nukejoin")
  2941. if GetCodeprem(rngcmd, sender, to) {
  2942. if CheckExprd(client, to, sender) {
  2943. spl := strings.Replace(cmd, "nukejoin ", "", 1)
  2944. if spl == "on" {
  2945. NukeJoin = true
  2946. newsend += "Nukejoin is enabled.\n"
  2947. } else if spl == "off" {
  2948. NukeJoin = false
  2949. newsend += "Nukejoin is disabled.\n"
  2950. }
  2951. }
  2952. }
  2953. } else if strings.HasPrefix(cmd, "canceljoin ") {
  2954. rngcmd := GetComs(3, "canceljoin")
  2955. if GetCodeprem(rngcmd, sender, to) {
  2956. if CheckExprd(client, to, sender) {
  2957. spl := strings.Replace(cmd, "canceljoin ", "", 1)
  2958. if spl == "on" {
  2959. canceljoin = true
  2960. newsend += "canceljoin is enabled.\n"
  2961. } else if spl == "off" {
  2962. canceljoin = false
  2963. newsend += "canceljoin is disabled.\n"
  2964. }
  2965. }
  2966. }
  2967. } else if strings.HasPrefix(cmd, "autopro ") {
  2968. rngcmd := GetComs(3, "autopro")
  2969. if GetCodeprem(rngcmd, sender, to) {
  2970. if CheckExprd(client, to, sender) {
  2971. spl := strings.Replace(cmd, "autopro ", "", 1)
  2972. if spl == "on" {
  2973. AutoPro = true
  2974. newsend += "Autopro is enabled.\n"
  2975. } else if spl == "off" {
  2976. AutoPro = false
  2977. newsend += "Autopro is disabled.\n"
  2978. }
  2979. }
  2980. }
  2981. } else if strings.HasPrefix(cmd, "autopurge ") {
  2982. rngcmd := GetComs(3, "autopurge")
  2983. if GetCodeprem(rngcmd, sender, to) {
  2984. if CheckExprd(client, to, sender) {
  2985. spl := strings.Replace(cmd, "autopurge ", "", 1)
  2986. if spl == "on" {
  2987. AutoPurge = true
  2988. newsend += "Autopurge is enabled.\n"
  2989. } else if spl == "off" {
  2990. AutoPurge = false
  2991. newsend += "Autopurge is disabled.\n"
  2992. }
  2993. }
  2994. }
  2995. } else if strings.HasPrefix(cmd, "autoban ") {
  2996. rngcmd := GetComs(3, "autoban")
  2997. if GetCodeprem(rngcmd, sender, to) {
  2998. if CheckExprd(client, to, sender) {
  2999. spl := strings.Replace(cmd, "autoban ", "", 1)
  3000. if spl == "on" {
  3001. AutoBan = true
  3002. newsend += "Autoban is enabled.\n"
  3003. } else if spl == "off" {
  3004. AutoBan = false
  3005. newsend += "Autoban is disabled.\n"
  3006. }
  3007. }
  3008. }
  3009. } else if strings.HasPrefix(cmd, "banpurge ") {
  3010. rngcmd := GetComs(3, "banpurge")
  3011. if GetCodeprem(rngcmd, sender, to) {
  3012. spl := strings.Replace(cmd, "banpurge ", "", 1)
  3013. if spl == "on" {
  3014. AutokickBan = true
  3015. newsend += "Banpurge is enabled.\n"
  3016. } else if spl == "off" {
  3017. AutokickBan = false
  3018. newsend += "Banpurge is disabled.\n"
  3019. }
  3020. }
  3021. } else if strings.HasPrefix(cmd, "groupinfo ") {
  3022. if GetCodeprem(4, sender, to) {
  3023. if CheckExprd(client, to, sender) {
  3024. result := strings.Split((cmd), " ")
  3025. if len(result) > 1 {
  3026. result2, err := strconv.Atoi(result[1])
  3027. if err != nil {
  3028. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  3029. return
  3030. } else {
  3031. if result2 > 0 {
  3032. if len(tempgroup) == 0 {
  3033. client.SendMessage(to, "Please input the right number\nSee group number with command groups")
  3034. return
  3035. }
  3036. nim, _ := strconv.Atoi(result[1])
  3037. nim = nim - 1
  3038. if result2 > 0 && result2 < len(tempgroup)+1 {
  3039. gid := tempgroup[nim]
  3040. list := InfoGroup(client, gid)
  3041. client.SendMessage(to, list)
  3042. } else {
  3043. newsend += "out of range.\n"
  3044. }
  3045. } else {
  3046. newsend += "invalid range.\n"
  3047. }
  3048. }
  3049. }
  3050. }
  3051. }
  3052. } else if strings.HasPrefix(cmd, "remote ") {
  3053. rngcmd := GetComs(3, "remote")
  3054. if GetCodeprem(rngcmd, sender, to) {
  3055. if CheckExprd(client, to, sender) {
  3056. result := strings.Split((cmd), " ")
  3057. if len(result) > 1 {
  3058. result2, err := strconv.Atoi(result[1])
  3059. if err != nil {
  3060. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  3061. return
  3062. } else {
  3063. if result2 > 0 {
  3064. if len(tempgroup) == 0 {
  3065. client.SendMessage(to, "Please input the right number\nSee group number with command groups")
  3066. return
  3067. }
  3068. nim, _ := strconv.Atoi(result[1])
  3069. nim = nim - 1
  3070. if result2 > 0 && result2 < len(tempgroup)+1 {
  3071. gid := tempgroup[nim]
  3072. remotegrupidto = to
  3073. if !InArray2(Sinderremote, sender) {
  3074. Sinderremote = append(Sinderremote, sender)
  3075. }
  3076. names, _, _ := client.GetChatList(gid)
  3077. remotegrupid = tempgroup[nim]
  3078. GetSquad(client, gid)
  3079. ret := fmt.Sprintf("Group: %v\n\n Send your command.\n", names)
  3080. newsend += ret
  3081. } else {
  3082. newsend += "out of range.\n"
  3083. }
  3084. } else {
  3085. newsend += "invalid range.\n"
  3086. }
  3087. }
  3088. }
  3089. }
  3090. }
  3091. } else if strings.HasPrefix(cmd, "unfuck") {
  3092. rngcmd := GetComs(3, "unfuck")
  3093. if GetCodeprem(rngcmd, sender, to) {
  3094. if CheckExprd(client, to, sender) {
  3095. listuser := []string{}
  3096. nCount := 0
  3097. x := 2
  3098. fl := strings.Split(cmd, " ")
  3099. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  3100. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  3101. matches := re.FindStringSubmatch(typec)
  3102. if len(matches) == 3 {
  3103. typec = matches[1]
  3104. nCount, _ = strconv.Atoi(matches[2])
  3105. }
  3106. if nCount == 0 {
  3107. nCount = 1
  3108. }
  3109. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  3110. if len(lists) != 0 {
  3111. for i := range lists {
  3112. if !InArray2(listuser, lists[i]) {
  3113. listuser = append(listuser, lists[i])
  3114. }
  3115. }
  3116. checkunbanbots(client, to, listuser, x, sender)
  3117. } else {
  3118. result := strings.Split((cmd), " ")
  3119. if len(result) > 1 {
  3120. result2, err := strconv.Atoi(result[1])
  3121. if err != nil {
  3122. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  3123. return
  3124. } else {
  3125. if result2 > 0 {
  3126. su := "unfuck"
  3127. str := ""
  3128. if strings.HasPrefix(text, Rname+" ") {
  3129. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  3130. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  3131. } else if strings.HasPrefix(text, Sname+" ") {
  3132. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  3133. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  3134. } else if strings.HasPrefix(text, Rname) {
  3135. str = strings.Replace(text, Rname+su+" ", "", 1)
  3136. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  3137. } else if strings.HasPrefix(text, Sname) {
  3138. str = strings.Replace(text, Sname+su+" ", "", 1)
  3139. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  3140. }
  3141. st := StripOut(str)
  3142. hapuss := oop.Archimed(st, Banned.Banlist)
  3143. if len(hapuss) == 0 {
  3144. newsend += "User not found.\n"
  3145. } else {
  3146. checkunbanbots(client, to, hapuss, x, sender)
  3147. }
  3148. }
  3149. }
  3150. } else {
  3151. newsend += "User not found.\n"
  3152. }
  3153. }
  3154. }
  3155. }
  3156. } else if strings.HasPrefix(cmd, "admin") && cmd != "admins" {
  3157. if GetCodeprem(5, sender, to) {
  3158. if CheckExprd(client, to, sender) {
  3159. listuser := []string{}
  3160. nCount := 0
  3161. x := 4
  3162. fl := strings.Split(cmd, " ")
  3163. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  3164. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  3165. matches := re.FindStringSubmatch(typec)
  3166. if len(matches) == 3 {
  3167. typec = matches[1]
  3168. nCount, _ = strconv.Atoi(matches[2])
  3169. }
  3170. if nCount == 0 {
  3171. nCount = 1
  3172. }
  3173. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  3174. if len(lists) != 0 {
  3175. for i := range lists {
  3176. if !InArray2(listuser, lists[i]) {
  3177. listuser = append(listuser, lists[i])
  3178. }
  3179. }
  3180. Checklistaccess(client, to, listuser, x, sender)
  3181. }
  3182. }
  3183. }
  3184. } else if cmd == "gowners" {
  3185. if GetCodeprem(7, sender, to) {
  3186. if CheckExprd(client, to, sender) {
  3187. if len(room.Gowner) != 0 {
  3188. list := " 👑 𝗴𝗼𝘄𝗻𝗲𝗿𝘀 👑 \n"
  3189. for num, xd := range room.Gowner {
  3190. num++
  3191. rengs := strconv.Itoa(num)
  3192. new := client.Getcontactuser(xd)
  3193. if new != nil {
  3194. list += "\n " + rengs + ". Closed Account"
  3195. } else {
  3196. x, _ := client.GetContact(xd)
  3197. list += "\n " + rengs + ". " + x.DisplayName
  3198. }
  3199. }
  3200. newsend += list + "\n"
  3201. } else {
  3202. newsend += "Gowner list is empty.\n"
  3203. }
  3204. }
  3205. }
  3206. } else if cmd == "masters" {
  3207. if GetCodeprem(5, sender, to) {
  3208. if CheckExprd(client, to, sender) {
  3209. if len(UserBot.Master) != 0 {
  3210. list := " 🎩 𝗺𝗮𝘀𝘁𝗲𝗿𝘀 🎩 \n"
  3211. for num, xd := range UserBot.Master {
  3212. num++
  3213. rengs := strconv.Itoa(num)
  3214. new := client.Getcontactuser(xd)
  3215. if new != nil {
  3216. list += "\n " + rengs + ". Closed Account"
  3217. } else {
  3218. x, _ := client.GetContact(xd)
  3219. list += "\n " + rengs + ". " + x.DisplayName
  3220. }
  3221. }
  3222. newsend += list + "\n"
  3223. } else {
  3224. newsend += "Master list is empty.\n"
  3225. }
  3226. }
  3227. }
  3228. } else if strings.HasPrefix(cmd, "unadmin") {
  3229. if GetCodeprem(5, sender, to) {
  3230. if CheckExprd(client, to, sender) {
  3231. listuser := []string{}
  3232. nCount := 0
  3233. x := 4
  3234. fl := strings.Split(cmd, " ")
  3235. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  3236. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  3237. matches := re.FindStringSubmatch(typec)
  3238. if len(matches) == 3 {
  3239. typec = matches[1]
  3240. nCount, _ = strconv.Atoi(matches[2])
  3241. }
  3242. if nCount == 0 {
  3243. nCount = 1
  3244. }
  3245. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  3246. if len(lists) != 0 {
  3247. for i := range lists {
  3248. if !InArray2(listuser, lists[i]) {
  3249. listuser = append(listuser, lists[i])
  3250. }
  3251. }
  3252. Checklistexpel(client, to, listuser, x, sender)
  3253. } else {
  3254. result := strings.Split((cmd), " ")
  3255. if len(result) > 1 {
  3256. result2, err := strconv.Atoi(result[1])
  3257. if err != nil {
  3258. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  3259. return
  3260. } else {
  3261. if result2 > 0 {
  3262. su := "unadmin"
  3263. str := ""
  3264. if strings.HasPrefix(text, Rname+" ") {
  3265. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  3266. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  3267. } else if strings.HasPrefix(text, Sname+" ") {
  3268. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  3269. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  3270. } else if strings.HasPrefix(text, Rname) {
  3271. str = strings.Replace(text, Rname+su+" ", "", 1)
  3272. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  3273. } else if strings.HasPrefix(text, Sname) {
  3274. str = strings.Replace(text, Sname+su+" ", "", 1)
  3275. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  3276. }
  3277. st := StripOut(str)
  3278. hapuss := oop.Archimed(st, UserBot.Admin)
  3279. if len(hapuss) == 0 {
  3280. newsend += "User not found.\n"
  3281. } else {
  3282. Checklistexpel(client, to, hapuss, x, sender)
  3283. }
  3284. }
  3285. }
  3286. } else {
  3287. newsend += "User not found.\n"
  3288. }
  3289. }
  3290. }
  3291. }
  3292. } else if strings.HasPrefix(cmd, "ungadmin") {
  3293. if GetCodeprem(7, sender, to) {
  3294. if CheckExprd(client, to, sender) {
  3295. listuser := []string{}
  3296. nCount := 0
  3297. x := 7
  3298. fl := strings.Split(cmd, " ")
  3299. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  3300. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  3301. matches := re.FindStringSubmatch(typec)
  3302. if len(matches) == 3 {
  3303. typec = matches[1]
  3304. nCount, _ = strconv.Atoi(matches[2])
  3305. }
  3306. if nCount == 0 {
  3307. nCount = 1
  3308. }
  3309. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  3310. if len(lists) != 0 {
  3311. for i := range lists {
  3312. if !InArray2(listuser, lists[i]) {
  3313. listuser = append(listuser, lists[i])
  3314. }
  3315. }
  3316. Checklistexpel(client, to, listuser, x, sender)
  3317. } else {
  3318. result := strings.Split((cmd), " ")
  3319. if len(result) > 1 {
  3320. result2, err := strconv.Atoi(result[1])
  3321. if err != nil {
  3322. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  3323. return
  3324. } else {
  3325. if result2 > 0 {
  3326. su := "ungadmin"
  3327. str := ""
  3328. if strings.HasPrefix(text, Rname+" ") {
  3329. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  3330. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  3331. } else if strings.HasPrefix(text, Sname+" ") {
  3332. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  3333. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  3334. } else if strings.HasPrefix(text, Rname) {
  3335. str = strings.Replace(text, Rname+su+" ", "", 1)
  3336. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  3337. } else if strings.HasPrefix(text, Sname) {
  3338. str = strings.Replace(text, Sname+su+" ", "", 1)
  3339. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  3340. }
  3341. st := StripOut(str)
  3342. hapuss := oop.Archimed(st, room.Gadmin)
  3343. if len(hapuss) == 0 {
  3344. newsend += "User not found.\n"
  3345. } else {
  3346. Checklistexpel(client, to, hapuss, x, sender)
  3347. }
  3348. }
  3349. }
  3350. } else {
  3351. newsend += "User not found.\n"
  3352. }
  3353. }
  3354. }
  3355. }
  3356. } else if cmd == "squadmid" {
  3357. rngcmd := GetComs(4, "squadmid")
  3358. if GetCodeprem(rngcmd, sender, to) {
  3359. if CheckExprd(client, to, sender) {
  3360. e, _ := client.GetProfile()
  3361. list := "All bot's mid\n\n"
  3362. list += "1." + e.DisplayName + "\n\n"
  3363. list += client.MID
  3364. for b, a := range client.Squads {
  3365. b++
  3366. x, _ := client.GetContact(a)
  3367. list += fmt.Sprintf("\n\n%v. %s ", b+1, x.DisplayName)
  3368. list += "\n\n" + a
  3369. }
  3370. newsend += list + "\n"
  3371. }
  3372. }
  3373. } else if strings.HasPrefix(cmd, "gadmin") && cmd != "gadmins" {
  3374. if GetCodeprem(8, sender, to) {
  3375. if CheckExprd(client, to, sender) {
  3376. listuser := []string{}
  3377. nCount := 0
  3378. x := 7
  3379. fl := strings.Split(cmd, " ")
  3380. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  3381. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  3382. matches := re.FindStringSubmatch(typec)
  3383. if len(matches) == 3 {
  3384. typec = matches[1]
  3385. nCount, _ = strconv.Atoi(matches[2])
  3386. }
  3387. if nCount == 0 {
  3388. nCount = 1
  3389. }
  3390. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  3391. if len(lists) != 0 {
  3392. for i := range lists {
  3393. if !InArray2(listuser, lists[i]) {
  3394. listuser = append(listuser, lists[i])
  3395. }
  3396. }
  3397. Checklistaccess(client, to, listuser, x, sender)
  3398. }
  3399. }
  3400. }
  3401. } else if cmd == "admins" {
  3402. if GetCodeprem(6, sender, to) {
  3403. if CheckExprd(client, to, sender) {
  3404. if len(UserBot.Admin) != 0 {
  3405. list := " 🎓 𝗮𝗱𝗺𝗶𝗻𝘀 🎓 \n"
  3406. for num, xd := range UserBot.Admin {
  3407. num++
  3408. rengs := strconv.Itoa(num)
  3409. new := client.Getcontactuser(xd)
  3410. if new != nil {
  3411. list += "\n " + rengs + ". Closed Account"
  3412. } else {
  3413. x, _ := client.GetContact(xd)
  3414. list += "\n " + rengs + ". " + x.DisplayName
  3415. }
  3416. }
  3417. newsend += list + "\n"
  3418. } else {
  3419. newsend += "Admin list is empty.\n"
  3420. }
  3421. }
  3422. }
  3423. } else if strings.HasPrefix(cmd, "antitag ") {
  3424. rngcmd := GetComs(4, "antitag")
  3425. if GetCodeprem(rngcmd, sender, to) {
  3426. if CheckExprd(client, to, sender) {
  3427. spl := strings.Replace(cmd, "antitag ", "", 1)
  3428. if spl == "on" {
  3429. room.AntiTag = true
  3430. newsend += "antitag enabled.\n"
  3431. } else if spl == "off" {
  3432. room.AntiTag = false
  3433. newsend += "antitag disabled.\n"
  3434. }
  3435. }
  3436. }
  3437. } else if cmd == "banlist" || cmd == Commands.Banlist && Commands.Banlist != "" {
  3438. rngcmd := GetComs(4, "banlist")
  3439. if GetCodeprem(rngcmd, sender, to) {
  3440. if CheckExprd(client, to, sender) {
  3441. if len(Banned.Banlist) != 0 {
  3442. listbl := "banlist:"
  3443. client.SendPollMention(to, listbl, Banned.Banlist)
  3444. } else {
  3445. newsend += "Ban list is empty.\n"
  3446. }
  3447. }
  3448. }
  3449. } else if cmd == "respon" || cmd == Commands.Respon && Commands.Respon != "" {
  3450. rngcmd := GetComs(4, "respon")
  3451. if GetCodeprem(rngcmd, sender, to) {
  3452. if CheckExprd(client, to, sender) {
  3453. for _, p := range bk {
  3454. go p.SendMessage(to, MsgRespon)
  3455. }
  3456. }
  3457. }
  3458. } else if cmd == "rollcall" || cmd == Commands.Botname && Commands.Botname != "" {
  3459. rngcmd := GetComs(4, "rollcall")
  3460. if GetCodeprem(rngcmd, sender, to) {
  3461. if CheckExprd(client, to, sender) {
  3462. for _, p := range bk {
  3463. asss := fmt.Sprintf("%v", p.Namebot)
  3464. go p.SendMessage(to, asss)
  3465. }
  3466. }
  3467. }
  3468. } else if cmd == "upallimage" || cmd == Commands.Upallimage && Commands.Upallimage != "" {
  3469. rngcmd := GetComs(3, "upallimage")
  3470. if GetCodeprem(rngcmd, sender, to) {
  3471. if CheckExprd(client, to, sender) {
  3472. changepic = []*oop.Account{}
  3473. for _, p := range bk {
  3474. if !oop.Checkarri(changepic, p) {
  3475. changepic = append(changepic, p)
  3476. }
  3477. }
  3478. ChangPict = true
  3479. StartChangeImg = true
  3480. AllCheng = true
  3481. timeabort = time.Now()
  3482. client.SendMessage(to, "Send image.")
  3483. }
  3484. }
  3485. } else if cmd == "upallcover" || cmd == Commands.Upallcover && Commands.Upallcover != "" {
  3486. rngcmd := GetComs(3, "upallcover")
  3487. if GetCodeprem(rngcmd, sender, to) {
  3488. if CheckExprd(client, to, sender) {
  3489. changepic = []*oop.Account{}
  3490. for _, p := range bk {
  3491. if !oop.Checkarri(changepic, p) {
  3492. changepic = append(changepic, p)
  3493. }
  3494. }
  3495. ChangCover = true
  3496. StartChangeImg = true
  3497. AllCheng = true
  3498. timeabort = time.Now()
  3499. client.SendMessage(to, "Send image.")
  3500. }
  3501. }
  3502. } else if cmd == "unsend" || cmd == Commands.Unsend && Commands.Unsend != "" {
  3503. rngcmd := GetComs(4, "unsend")
  3504. if GetCodeprem(rngcmd, sender, to) {
  3505. if CheckExprd(client, to, sender) {
  3506. for _, p := range bk {
  3507. p.UnsendChat(to)
  3508. }
  3509. }
  3510. }
  3511. } else if cmd == "upvallimage" || cmd == Commands.Upvallimage && Commands.Upvallimage != "" {
  3512. rngcmd := GetComs(3, "upvallimage")
  3513. if GetCodeprem(rngcmd, sender, to) {
  3514. if CheckExprd(client, to, sender) {
  3515. for _, p := range bk {
  3516. if !oop.Checkarri(changepic, p) {
  3517. changepic = append(changepic, p)
  3518. }
  3519. }
  3520. ChangVpict = true
  3521. StartChangevImg = true
  3522. AllCheng = true
  3523. timeabort = time.Now()
  3524. client.SendMessage(to, "Send video.")
  3525. }
  3526. }
  3527. } else if cmd == "upvallcover" || cmd == Commands.Upvallcover && Commands.Upvallcover != "" {
  3528. rngcmd := GetComs(3, "upvallcover")
  3529. if GetCodeprem(rngcmd, sender, to) {
  3530. if CheckExprd(client, to, sender) {
  3531. changepic = []*oop.Account{}
  3532. for _, p := range bk {
  3533. if !oop.Checkarri(changepic, p) {
  3534. changepic = append(changepic, p)
  3535. }
  3536. }
  3537. ChangVcover = true
  3538. StartChangevImg = true
  3539. AllCheng = true
  3540. timeabort = time.Now()
  3541. client.SendMessage(to, "Send video.")
  3542. }
  3543. }
  3544. } else if cmd == "appname" || cmd == Commands.Appname && Commands.Appname != "" {
  3545. if GetCodeprem(0, sender, to) {
  3546. if CheckExprd(client, to, sender) {
  3547. for _, p := range bk {
  3548. p.SendMessage(to, string(p.AppName))
  3549. }
  3550. }
  3551. }
  3552. } else if cmd == "useragent" || cmd == Commands.Useragent && Commands.Useragent != "" {
  3553. if GetCodeprem(0, sender, to) {
  3554. if CheckExprd(client, to, sender) {
  3555. for _, p := range bk {
  3556. p.SendMessage(to, string(p.UserAgent))
  3557. }
  3558. }
  3559. }
  3560. } else if cmd == "hostname" || cmd == Commands.Hostname && Commands.Hostname != "" {
  3561. if GetCodeprem(0, sender, to) {
  3562. if CheckExprd(client, to, sender) {
  3563. for _, p := range bk {
  3564. p.SendMessage(to, string(p.Host))
  3565. }
  3566. }
  3567. }
  3568. } else if cmd == "friends" || cmd == Commands.Friends && Commands.Friends != "" {
  3569. if GetCodeprem(0, sender, to) {
  3570. if CheckExprd(client, to, sender) {
  3571. exe2 := []*oop.Account{}
  3572. for _, mid := range mentionlist {
  3573. if InArray2(Squadlist, mid) {
  3574. cl := GetKorban(mid)
  3575. exe2 = append(exe2, cl)
  3576. }
  3577. }
  3578. if len(exe2) != 0 {
  3579. for _, p := range exe2 {
  3580. friends, _ := p.GetAllContactIds()
  3581. result := "Friendlist:\n"
  3582. if len(friends) != 0 {
  3583. for cokk, ky := range friends {
  3584. cokk++
  3585. LilGanz := strconv.Itoa(cokk)
  3586. haniku, _ := p.GetContact(ky)
  3587. result += "\n" + LilGanz + ". " + haniku.DisplayName
  3588. }
  3589. client.SendMessage(to, result)
  3590. } else {
  3591. client.SendMessage(to, "Friend is empty.")
  3592. }
  3593. }
  3594. } else {
  3595. client.SendMessage(to, "Mention Bot First.")
  3596. }
  3597. }
  3598. }
  3599. } else if cmd == "adds" || cmd == Commands.Adds && Commands.Adds != "" {
  3600. if GetCodeprem(0, sender, to) {
  3601. if CheckExprd(client, to, sender) {
  3602. addb := len(oop.Waitadd)
  3603. kb := ""
  3604. if addb != 0 {
  3605. kb += fmt.Sprintf("%v/%v bot's got add/friend banned.", addb, len(Squadlist))
  3606. for n, cl := range oop.Waitadd {
  3607. m := cl.MID
  3608. no := n + 1
  3609. go client.SendContact(to, m)
  3610. var ta time.Duration
  3611. if _, ok := oop.BlockAdd.Get(cl.MID); ok {
  3612. t := cl.Timeadd.Add(24 * time.Hour)
  3613. ta = t.Sub(time.Now())
  3614. } else {
  3615. t := cl.Timeadd.Add(1 * time.Hour)
  3616. ta = t.Sub(time.Now())
  3617. }
  3618. if cl.Namebot == "" {
  3619. pr, _ := client.GetContact(m)
  3620. cl.Namebot = pr.DisplayName
  3621. }
  3622. kb += fmt.Sprintf("\n\n%v. %s\nRemaining %v", no, cl.Namebot, fmtDurations(ta))
  3623. }
  3624. }
  3625. if addb == 0 {
  3626. newsend += "All fixed."
  3627. } else {
  3628. newsend += kb
  3629. }
  3630. }
  3631. }
  3632. } else if cmd == "limits" || cmd == Commands.Limits && Commands.Limits != "" {
  3633. rngcmd := GetComs(4, "limits")
  3634. if GetCodeprem(rngcmd, sender, to) {
  3635. if CheckExprd(client, to, sender) {
  3636. for _, p := range bk {
  3637. var asss string
  3638. if p.Limited == true {
  3639. asss += "⚙️ 𝗕ot 𝗦tatus: ✘"
  3640. } else {
  3641. asss += "⚙️ 𝗕ot 𝗦tatus: ✓"
  3642. }
  3643. p.SendMessage(to, asss)
  3644. }
  3645. }
  3646. }
  3647. } else if cmd == "addallsquads" || cmd == Commands.Addallsquads && Commands.Addallsquads != "" {
  3648. rngcmd := GetComs(1, "addallsquads")
  3649. if GetCodeprem(rngcmd, sender, to) {
  3650. if CheckExprd(client, to, sender) {
  3651. addCon(Squadlist)
  3652. asss := "Success addall squads."
  3653. client.SendMessage(to, asss)
  3654. }
  3655. }
  3656. } else if cmd == "leave" || cmd == Commands.Leave && Commands.Leave != "" {
  3657. rngcmd := GetComs(4, "leave")
  3658. if GetCodeprem(rngcmd, sender, to) {
  3659. if CheckExprd(client, to, sender) {
  3660. _, mem := client.GetGroupInvitation(to)
  3661. anu := []string{}
  3662. for m := range mem {
  3663. if InArray2(Squadlist, m) {
  3664. anu = append(anu, m)
  3665. }
  3666. }
  3667. if len(anu) != 0 {
  3668. for _, mid := range anu {
  3669. cl := GetKorban(mid)
  3670. cl.AcceptGroupInvitationNormal(to)
  3671. }
  3672. }
  3673. GetSquad(client, to)
  3674. room := oop.GetRoom(to)
  3675. bk = room.Client
  3676. for _, cl := range bk {
  3677. go cl.LeaveGroup(to)
  3678. }
  3679. if LogGroup == to {
  3680. LogMode = false
  3681. LogGroup = ""
  3682. }
  3683. oop.SquadRoom = oop.RemoveRoom(oop.SquadRoom, room)
  3684. logAccess(client, to, sender, "leave", []string{}, msg.ToType)
  3685. }
  3686. }
  3687. } else if cmd == "ping" || cmd == Commands.Ping && Commands.Ping != "" {
  3688. rngcmd := GetComs(4, "ping")
  3689. if GetCodeprem(rngcmd, sender, to) {
  3690. if CheckExprd(client, to, sender) {
  3691. for _, p := range bk {
  3692. p.SendMessage(to, "pong")
  3693. }
  3694. }
  3695. }
  3696. } else if cmd == "count" || cmd == Commands.Count && Commands.Count != "" {
  3697. rngcmd := GetComs(4, "count")
  3698. if GetCodeprem(rngcmd, sender, to) {
  3699. if CheckExprd(client, to, sender) {
  3700. for n, p := range bk {
  3701. p.SendMessage(to, fmt.Sprintf("%v", n+1))
  3702. }
  3703. }
  3704. }
  3705. } else if strings.HasPrefix(cmd, "sayall") {
  3706. rngcmd := GetComs(4, "sayall")
  3707. if GetCodeprem(rngcmd, sender, to) {
  3708. if CheckExprd(client, to, sender) {
  3709. str := ""
  3710. var su = "sayall"
  3711. if strings.HasPrefix(text, Rname+" ") {
  3712. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  3713. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  3714. } else if strings.HasPrefix(text, Sname+" ") {
  3715. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  3716. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  3717. } else if strings.HasPrefix(text, Rname) {
  3718. str = strings.Replace(text, Rname+su+" ", "", 1)
  3719. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  3720. } else if strings.HasPrefix(text, Sname) {
  3721. str = strings.Replace(text, Sname+su+" ", "", 1)
  3722. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  3723. }
  3724. for _, p := range bk {
  3725. p.SendMessage(to, str)
  3726. }
  3727. }
  3728. }
  3729. } else if cmd == "limitout" || cmd == Commands.Limitout && Commands.Limitout != "" {
  3730. rngcmd := GetComs(4, "limitout")
  3731. if GetCodeprem(rngcmd, sender, to) {
  3732. if CheckExprd(client, to, sender) {
  3733. for _, p := range bk {
  3734. if p.Limited == true {
  3735. p.LeaveGroup(to)
  3736. }
  3737. }
  3738. GetSquad(client, to)
  3739. }
  3740. }
  3741. } else if strings.HasPrefix(cmd, "upallstatus") {
  3742. rngcmd := GetComs(3, "upallstatus")
  3743. if GetCodeprem(rngcmd, sender, to) {
  3744. if CheckExprd(client, to, sender) {
  3745. result := strings.Split((cmd), " ")
  3746. if len(result) > 1 {
  3747. str := ""
  3748. var su = "upallstatus"
  3749. if strings.HasPrefix(text, Rname+" ") {
  3750. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  3751. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  3752. } else if strings.HasPrefix(text, Sname+" ") {
  3753. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  3754. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  3755. } else if strings.HasPrefix(text, Rname) {
  3756. str = strings.Replace(text, Rname+su+" ", "", 1)
  3757. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  3758. } else if strings.HasPrefix(text, Sname) {
  3759. str = strings.Replace(text, Sname+su+" ", "", 1)
  3760. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  3761. }
  3762. for n, p := range bk {
  3763. if TimeDown(n) {
  3764. p.UpdateProfileBio(str)
  3765. p.SendMessage(to, "Profile Bio updated.")
  3766. }
  3767. }
  3768. } else {
  3769. client.SendMessage(to, "Add Bio first.")
  3770. }
  3771. timeabort = time.Now()
  3772. }
  3773. }
  3774. } else if strings.HasPrefix(cmd, "upallname") {
  3775. rngcmd := GetComs(3, "upallname")
  3776. if GetCodeprem(rngcmd, sender, to) {
  3777. if CheckExprd(client, to, sender) {
  3778. result := strings.Split((cmd), " ")
  3779. if len(result) > 1 {
  3780. var str string
  3781. var su = "upallname"
  3782. if strings.HasPrefix(text, Rname+" ") {
  3783. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  3784. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  3785. } else if strings.HasPrefix(text, Sname+" ") {
  3786. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  3787. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  3788. } else if strings.HasPrefix(text, Rname) {
  3789. str = strings.Replace(text, Rname+su+" ", "", 1)
  3790. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  3791. } else if strings.HasPrefix(text, Sname) {
  3792. str = strings.Replace(text, Sname+su+" ", "", 1)
  3793. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  3794. }
  3795. aa := utf8.RuneCountInString(str)
  3796. if aa != 0 && aa <= 20 {
  3797. for n, p := range bk {
  3798. if TimeDown(n) {
  3799. p.UpdateProfileName(str)
  3800. p.SendMessage(to, "Profile name updated.")
  3801. }
  3802. }
  3803. }
  3804. } else {
  3805. client.SendMessage(to, "Add name first.")
  3806. }
  3807. }
  3808. }
  3809. } else if cmd == "clearadmin" {
  3810. if GetCodeprem(5, sender, to) {
  3811. if CheckExprd(client, to, sender) {
  3812. if len(UserBot.Admin) != 0 {
  3813. logAccess(client, to, sender, "clearadmin", UserBot.Admin, msg.ToType)
  3814. newsend += fmt.Sprintf("Cleared %v adminlist\n", len(UserBot.Admin))
  3815. UserBot.ClearAdmin()
  3816. } else {
  3817. newsend += "Admin list is empty.\n"
  3818. }
  3819. }
  3820. }
  3821. } else if cmd == "clearban" || cmd == Commands.Clearban && Commands.Clearban != "" {
  3822. rngcmd := GetComs(7, "clearban")
  3823. if GetCodeprem(rngcmd, sender, to) {
  3824. if CheckExprd(client, to, sender) {
  3825. if len(Banned.Banlist) != 0 {
  3826. msgcbn := fmt.Sprintf(MsgBan, len(Banned.Banlist))
  3827. logAccess(client, to, sender, "clearban", Banned.Banlist, msg.ToType)
  3828. newsend += msgcbn + "\n"
  3829. Banned.Banlist = []string{}
  3830. } else {
  3831. newsend += "Ban list is empty.\n"
  3832. }
  3833. }
  3834. }
  3835. } else if cmd == "cleargadmin" {
  3836. if GetCodeprem(7, sender, to) {
  3837. if CheckExprd(client, to, sender) {
  3838. if len(room.Gadmin) != 0 {
  3839. logAccess(client, to, sender, "cleargadmin", room.Gadmin, msg.ToType)
  3840. newsend += fmt.Sprintf("Cleared %v gadminlist\n", len(room.Gadmin))
  3841. room.Gadmin = []string{}
  3842. } else {
  3843. newsend += "Gadmin list is empty.\n"
  3844. }
  3845. }
  3846. }
  3847. } else if cmd == "list protect" {
  3848. if GetCodeprem(6, sender, to) {
  3849. if CheckExprd(client, to, sender) {
  3850. res := oop.ListProtect()
  3851. newsend += res + "\n"
  3852. }
  3853. }
  3854. } else if cmd == "bringall" || cmd == Commands.Bringall && Commands.Bringall != "" {
  3855. rngcmd := GetComs(4, "bringall")
  3856. if GetCodeprem(rngcmd, sender, to) {
  3857. if CheckExprd(client, to, sender) {
  3858. if op.Message.ToType != 2 {
  3859. return
  3860. }
  3861. if room.Limit {
  3862. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  3863. return
  3864. }
  3865. exe, _ := SelectBot(client, to)
  3866. if exe != nil {
  3867. Setinviteto(exe, to, exe.Squads)
  3868. logAccess(client, to, sender, "invite", exe.Squads, msg.ToType)
  3869. time.Sleep(1 * time.Second)
  3870. GetSquad(exe, to)
  3871. } else {
  3872. newsend += "Invite banned try with another bot.\n"
  3873. }
  3874. }
  3875. }
  3876. } else if cmd == "stayall" || cmd == Commands.Stayall && Commands.Stayall != "" {
  3877. rngcmd := GetComs(4, "stayall")
  3878. if GetCodeprem(rngcmd, sender, to) {
  3879. if CheckExprd(client, to, sender) {
  3880. if room.Limit {
  3881. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  3882. return
  3883. }
  3884. numb := len(ClientBot)
  3885. if numb > 0 && numb <= len(ClientBot) {
  3886. GetSquad(client, to)
  3887. room := oop.GetRoom(to)
  3888. aa := len(room.Client)
  3889. if aa > numb {
  3890. c := aa - numb
  3891. ca := 0
  3892. list := append([]*oop.Account{}, room.Client...)
  3893. sort.Slice(list, func(i, j int) bool {
  3894. return list[i].KickPoint > list[j].KickPoint
  3895. })
  3896. for _, o := range list {
  3897. o.LeaveGroup(to)
  3898. ca = ca + 1
  3899. if ca == c {
  3900. break
  3901. }
  3902. }
  3903. GetSquad(client, to)
  3904. } else if aa < numb {
  3905. ti, err := client.ReissueChatTicket(to)
  3906. if err == nil {
  3907. go client.UpdateChatQrV2(to, false)
  3908. all := []*oop.Account{}
  3909. room := oop.GetRoom(to)
  3910. cuk := room.Client
  3911. for _, x := range ClientBot {
  3912. if !oop.InArrayCl(cuk, x) && !oop.InArrayCl(oop.KickBans, x) && !oop.InArrayCl(room.GoClient, x) {
  3913. all = append(all, x)
  3914. }
  3915. }
  3916. sort.Slice(all, func(i, j int) bool {
  3917. return all[i].KickPoint < all[j].KickPoint
  3918. })
  3919. g := numb - aa
  3920. var wg sync.WaitGroup
  3921. wi := GetSquad(client, to)
  3922. for i := 0; i < len(all); i++ {
  3923. if i == g {
  3924. break
  3925. }
  3926. l := all[i]
  3927. if l != client && !oop.InArrayCl(wi, l) {
  3928. wg.Add(1)
  3929. go func() {
  3930. l.AcceptTicket(to, ti)
  3931. wg.Done()
  3932. }()
  3933. }
  3934. }
  3935. wg.Wait()
  3936. client.UpdateChatQrV2(to, true)
  3937. GetSquad(client, to)
  3938. logAccess(client, to, sender, "bringbot", []string{}, 2)
  3939. }
  3940. }
  3941. }
  3942. }
  3943. }
  3944. } else if strings.HasPrefix(cmd, "go") && cmd != "gojoin" {
  3945. rngcmd := GetComs(4, "go")
  3946. if GetCodeprem(rngcmd, sender, to) {
  3947. if CheckExprd(client, to, sender) {
  3948. if room.Limit {
  3949. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  3950. return
  3951. }
  3952. str := strings.Replace(cmd, "go ", "", 1)
  3953. numb, _ := strconv.Atoi(str)
  3954. if numb == 0 {
  3955. list := append([]*oop.Account{}, room.Client...)
  3956. sort.Slice(list, func(i, j int) bool {
  3957. return list[i].KickPoint > list[j].KickPoint
  3958. })
  3959. for n, o := range list {
  3960. if n < 2 {
  3961. o.LeaveGroup(to)
  3962. oop.GetRoom(to).RevertGo(o)
  3963. } else {
  3964. break
  3965. }
  3966. }
  3967. room := oop.GetRoom(to)
  3968. cls := room.Client
  3969. for _, cl := range cls {
  3970. if !cl.Limited {
  3971. cl.InviteIntoChatPollVer(to, room.GoMid)
  3972. break
  3973. }
  3974. }
  3975. } else {
  3976. list := append([]*oop.Account{}, room.Client...)
  3977. sort.Slice(list, func(i, j int) bool {
  3978. return list[i].KickPoint > list[j].KickPoint
  3979. })
  3980. for n, o := range list {
  3981. if n < numb {
  3982. o.LeaveGroup(to)
  3983. oop.GetRoom(to).RevertGo(o)
  3984. } else {
  3985. break
  3986. }
  3987. }
  3988. room := oop.GetRoom(to)
  3989. cls := room.Cans()
  3990. for _, cl := range cls {
  3991. if !cl.Limited {
  3992. cl.InviteIntoChatPollVer(to, room.GoMid)
  3993. break
  3994. }
  3995. }
  3996. }
  3997. }
  3998. }
  3999. } else if cmd == "leaveall" {
  4000. rngcmd := GetComs(3, "leaveall")
  4001. if GetCodeprem(rngcmd, sender, to) {
  4002. if CheckExprd(client, to, sender) {
  4003. for _, p := range bk {
  4004. gr, _ := p.GetGroupIdsJoined()
  4005. for _, g := range gr {
  4006. if g != msg.To {
  4007. p.LeaveGroup(g)
  4008. time.Sleep(1 * time.Second)
  4009. }
  4010. }
  4011. }
  4012. LogMode = false
  4013. LogGroup = ""
  4014. newsend += "Leave done"
  4015. oop.RoomClear(room)
  4016. }
  4017. }
  4018. } else if strings.HasPrefix(cmd, "stay ") {
  4019. rngcmd := GetComs(4, "stay")
  4020. if GetCodeprem(rngcmd, sender, to) {
  4021. if CheckExprd(client, to, sender) {
  4022. str := strings.Replace(cmd, "stay ", "", 1)
  4023. numb, _ := strconv.Atoi(str)
  4024. if room.Limit {
  4025. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  4026. return
  4027. }
  4028. if numb > 0 && numb <= len(ClientBot) {
  4029. GetSquad(client, to)
  4030. room := oop.GetRoom(to)
  4031. aa := len(room.Client)
  4032. if aa > numb {
  4033. c := aa - numb
  4034. ca := 0
  4035. list := append([]*oop.Account{}, room.Client...)
  4036. sort.Slice(list, func(i, j int) bool {
  4037. return list[i].KickPoint > list[j].KickPoint
  4038. })
  4039. for _, o := range list {
  4040. o.LeaveGroup(to)
  4041. ca = ca + 1
  4042. if ca == c {
  4043. break
  4044. }
  4045. }
  4046. GetSquad(client, to)
  4047. } else if aa < numb {
  4048. ti, err := client.ReissueChatTicket(to)
  4049. if err == nil {
  4050. go client.UpdateChatQrV2(to, false)
  4051. all := []*oop.Account{}
  4052. room := oop.GetRoom(to)
  4053. cuk := room.Client
  4054. for _, x := range ClientBot {
  4055. if !oop.InArrayCl(cuk, x) && !oop.InArrayCl(oop.KickBans, x) && !oop.InArrayCl(room.GoClient, x) {
  4056. all = append(all, x)
  4057. }
  4058. }
  4059. sort.Slice(all, func(i, j int) bool {
  4060. return all[i].KickPoint < all[j].KickPoint
  4061. })
  4062. g := numb - aa
  4063. var wg sync.WaitGroup
  4064. wi := GetSquad(client, to)
  4065. for i := 0; i < len(all); i++ {
  4066. if i == g {
  4067. break
  4068. }
  4069. l := all[i]
  4070. if l != client && !oop.InArrayCl(wi, l) {
  4071. wg.Add(1)
  4072. go func() {
  4073. l.AcceptTicket(to, ti)
  4074. wg.Done()
  4075. }()
  4076. }
  4077. }
  4078. wg.Wait()
  4079. client.UpdateChatQrV2(to, true)
  4080. GetSquad(client, to)
  4081. logAccess(client, to, sender, "bringbot", []string{}, 2)
  4082. }
  4083. }
  4084. } else {
  4085. newsend += "out of range.\n"
  4086. }
  4087. }
  4088. }
  4089. } else if cmd == "suffix" {
  4090. if GetCodeprem(4, sender, to) {
  4091. if CheckExprd(client, to, sender) {
  4092. a := " --- * 𝗦𝘂𝗳𝗳𝗶𝘅 𝗖𝗼𝗺𝗺𝗮𝗻𝗱 * --- "
  4093. a += "\n\n lkick"
  4094. a += "\n lcancel"
  4095. a += "\n Lqr"
  4096. a += "\n linvite"
  4097. a += "\n @me"
  4098. a += "\n @all"
  4099. a += "\n ljoin"
  4100. a += "\n lleave"
  4101. a += "\n lcon"
  4102. a += "\n ltag"
  4103. newsend += a + "\n"
  4104. }
  4105. }
  4106. } else if pesan == "sname" {
  4107. if GetCodeprem(6, sender, to) {
  4108. if CheckExprd(client, to, sender) {
  4109. client.SendMessage(to, Sname)
  4110. }
  4111. }
  4112. } else if pesan == "prefix" {
  4113. if GetCodeprem(6, sender, to) {
  4114. if CheckExprd(client, to, sender) {
  4115. client.SendMessage(to, "Rname: "+Rname+"\nSname: "+Sname)
  4116. }
  4117. }
  4118. } else if pesan == "rname" {
  4119. if GetCodeprem(6, sender, to) {
  4120. if CheckExprd(client, to, sender) {
  4121. client.SendMessage(to, Rname)
  4122. }
  4123. }
  4124. } else if pesan == Sname {
  4125. if GetCodeprem(8, sender, to) {
  4126. if CheckExprd(client, to, sender) {
  4127. client.SendMessage(to, MsgRespon)
  4128. }
  4129. }
  4130. } else if pesan == Rname {
  4131. if GetCodeprem(8, sender, to) {
  4132. if CheckExprd(client, to, sender) {
  4133. client.SendMessage(to, MsgRespon)
  4134. }
  4135. }
  4136. } else if cmd == "gadmins" {
  4137. if GetCodeprem(8, sender, to) {
  4138. if CheckExprd(client, to, sender) {
  4139. if len(room.Gadmin) != 0 {
  4140. list := " 🎓 𝗴𝗮𝗱𝗺𝗶𝗻𝘀 🎓\n"
  4141. for num, xd := range room.Gadmin {
  4142. num++
  4143. rengs := strconv.Itoa(num)
  4144. new := client.Getcontactuser(xd)
  4145. if new != nil {
  4146. list += "\n " + rengs + ". Closed Account"
  4147. } else {
  4148. x, _ := client.GetContact(xd)
  4149. list += "\n " + rengs + ". " + x.DisplayName
  4150. }
  4151. }
  4152. newsend += list + "\n"
  4153. } else {
  4154. newsend += "Gadmin list is empty.\n"
  4155. }
  4156. }
  4157. }
  4158. } else if strings.HasPrefix(cmd, "bot") && cmd != "botlist" {
  4159. rngcmd := GetComs(3, "bot")
  4160. if GetCodeprem(rngcmd, sender, to) {
  4161. if CheckExprd(client, to, sender) {
  4162. listuser := []string{}
  4163. nCount := 0
  4164. x := 5
  4165. fl := strings.Split(cmd, " ")
  4166. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  4167. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  4168. matches := re.FindStringSubmatch(typec)
  4169. if len(matches) == 3 {
  4170. typec = matches[1]
  4171. nCount, _ = strconv.Atoi(matches[2])
  4172. }
  4173. if nCount == 0 {
  4174. nCount = 1
  4175. }
  4176. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  4177. if len(lists) != 0 {
  4178. for i := range lists {
  4179. if !InArray2(listuser, lists[i]) {
  4180. listuser = append(listuser, lists[i])
  4181. }
  4182. }
  4183. Checklistaccess(client, to, listuser, x, sender)
  4184. }
  4185. }
  4186. }
  4187. } else if strings.HasPrefix(cmd, "gban") && cmd != "gbanlist" {
  4188. rngcmd := GetComs(7, "gban")
  4189. if GetCodeprem(rngcmd, sender, to) {
  4190. if CheckExprd(client, to, sender) {
  4191. listuser := []string{}
  4192. nCount := 0
  4193. x := 10
  4194. fl := strings.Split(cmd, " ")
  4195. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  4196. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  4197. matches := re.FindStringSubmatch(typec)
  4198. if len(matches) == 3 {
  4199. typec = matches[1]
  4200. nCount, _ = strconv.Atoi(matches[2])
  4201. }
  4202. if nCount == 0 {
  4203. nCount = 1
  4204. }
  4205. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  4206. if len(lists) != 0 {
  4207. for i := range lists {
  4208. if !InArray2(listuser, lists[i]) {
  4209. listuser = append(listuser, lists[i])
  4210. }
  4211. }
  4212. Checklistaccess(client, to, listuser, x, sender)
  4213. }
  4214. }
  4215. }
  4216. } else if cmd == "fixed" {
  4217. rngcmd := GetComs(4, "fixed")
  4218. if GetCodeprem(rngcmd, sender, to) {
  4219. if CheckExprd(client, to, sender) {
  4220. SaveBackup()
  4221. newsend += "done.\n"
  4222. }
  4223. }
  4224. } else if cmd == "bans" {
  4225. rngcmd := GetComs(4, "bans")
  4226. if GetCodeprem(rngcmd, sender, to) {
  4227. if CheckExprd(client, to, sender) {
  4228. toy := len(oop.KickBans)
  4229. kb := ""
  4230. if toy != 0 {
  4231. kb += fmt.Sprintf("%v/%v bot's got kick/inv banned.", toy, len(Squadlist))
  4232. for n, cl := range oop.KickBans {
  4233. m := cl.MID
  4234. no := n + 1
  4235. go client.SendContact(to, m)
  4236. var ta time.Duration
  4237. if _, ok := oop.GetBlock.Get(cl.MID); ok {
  4238. t := cl.TimeBan.Add(24 * time.Hour)
  4239. ta = t.Sub(time.Now())
  4240. } else {
  4241. t := cl.TimeBan.Add(1 * time.Hour)
  4242. ta = t.Sub(time.Now())
  4243. }
  4244. if cl.Namebot == "" {
  4245. pr, _ := client.GetContact(m)
  4246. cl.Namebot = pr.DisplayName
  4247. }
  4248. kb += fmt.Sprintf("\n\n%v. %s\nRemaining %v", no, cl.Namebot, fmtDurations(ta))
  4249. }
  4250. }
  4251. fris := []*oop.Account{}
  4252. for _, cl := range ClientBot {
  4253. if cl.Frez {
  4254. fris = append(fris, cl)
  4255. }
  4256. }
  4257. if len(fris) != 0 {
  4258. no := 1
  4259. mm := kb
  4260. kb += fmt.Sprintf("\n\n%v/%v bot's freeze.", len(fris), len(Squadlist))
  4261. for _, cl := range fris {
  4262. t := cl.TimeBan.Add(1 * time.Hour)
  4263. ta := t.Sub(time.Now())
  4264. if ta > 1*time.Second {
  4265. kb += fmt.Sprintf("\n\n%v. %s\nRemaining %v", no, cl.Namebot, fmtDurations(ta))
  4266. no++
  4267. } else {
  4268. if _, ok := oop.GetBlock.Get(cl.MID); !ok {
  4269. oop.KickBans = oop.RemoveCl(oop.KickBans, cl)
  4270. cl.Limited = false
  4271. }
  4272. cl.Frez = false
  4273. }
  4274. }
  4275. if no == 1 {
  4276. kb = mm
  4277. }
  4278. }
  4279. if len(fris) == 0 && toy == 0 {
  4280. newsend += "All fixed."
  4281. } else {
  4282. newsend += kb
  4283. }
  4284. }
  4285. }
  4286. } else if cmd == "botlist" {
  4287. rngcmd := GetComs(4, "botlist")
  4288. if GetCodeprem(rngcmd, sender, to) {
  4289. if CheckExprd(client, to, sender) {
  4290. if len(UserBot.Bot) != 0 {
  4291. list := "Botlist:\n"
  4292. targets := []string{}
  4293. for _, i := range UserBot.Bot {
  4294. targets = append(targets, i)
  4295. }
  4296. client.SendPollMention(to, list, targets)
  4297. } else {
  4298. newsend += "Botlist is empty.\n"
  4299. }
  4300. }
  4301. }
  4302. } else if cmd == "clearbot" {
  4303. rngcmd := GetComs(4, "clearbot")
  4304. if GetCodeprem(rngcmd, sender, to) {
  4305. if CheckExprd(client, to, sender) {
  4306. if len(UserBot.Bot) != 0 {
  4307. newsend += fmt.Sprintf("Cleared %v botlist\n", len(UserBot.Bot))
  4308. logAccess(client, to, sender, "clearbot", UserBot.Bot, msg.ToType)
  4309. UserBot.ClearBot()
  4310. } else {
  4311. newsend += "Bot is empty.\n"
  4312. }
  4313. }
  4314. }
  4315. } else if cmd == "cleargban" {
  4316. rngcmd := GetComs(7, "cleargban")
  4317. if GetCodeprem(rngcmd, sender, to) {
  4318. if CheckExprd(client, to, sender) {
  4319. if len(room.Gban) != 0 {
  4320. logAccess(client, to, sender, "cleargban", room.Gban, msg.ToType)
  4321. newsend += fmt.Sprintf("Cleared %v gbanlist", len(room.Gban)) + "\n"
  4322. room.Gban = []string{}
  4323. } else {
  4324. newsend += "Gban is empty.\n"
  4325. }
  4326. }
  4327. }
  4328. } else if cmd == "clearchat" || cmd == Commands.Clearchat && Commands.Clearchat != "" {
  4329. rngcmd := GetComs(4, "clearchat")
  4330. if GetCodeprem(rngcmd, sender, to) {
  4331. if CheckExprd(client, to, sender) {
  4332. _, memb, _ := client.GetChatList(to)
  4333. for i := range ClientBot {
  4334. if InArray2(memb, ClientBot[i].MID) {
  4335. ClientBot[i].RemoveAllMessage(string(op.Param2))
  4336. }
  4337. }
  4338. newsend += "Cleared all message.\n"
  4339. }
  4340. }
  4341. } else if cmd == "clearcache" {
  4342. rngcmd := GetComs(4, "clearcache")
  4343. if GetCodeprem(rngcmd, sender, to) {
  4344. if CheckExprd(client, to, sender) {
  4345. exec.Command("bash", "-c", "sudo systemd-resolve --flush-caches").Output()
  4346. exec.Command("bash", "-c", "echo 3 > /proc/sys/vm/drop_caches&&swapoff -a&&swapon -a").Output()
  4347. newsend += "Cleared all cache.\n"
  4348. }
  4349. }
  4350. } else if cmd == "gbanlist" {
  4351. rngcmd := GetComs(7, "gbanlist")
  4352. if GetCodeprem(rngcmd, sender, to) {
  4353. if CheckExprd(client, to, sender) {
  4354. if len(room.Gban) != 0 {
  4355. list := "Gbanlist:"
  4356. client.SendPollMention(to, list, room.Gban)
  4357. } else {
  4358. newsend += "Gban list is empty.\n"
  4359. }
  4360. }
  4361. }
  4362. } else if cmd == "here" || cmd == Commands.Here && Commands.Here != "" {
  4363. rngcmd := GetComs(5, "here")
  4364. if GetCodeprem(rngcmd, sender, to) {
  4365. if CheckExprd(client, to, sender) {
  4366. GetSquad(client, to)
  4367. aa := len(room.Client)
  4368. cc := len(room.GoMid)
  4369. var name string
  4370. name = fmt.Sprintf("%v/%v Bots here.", aa, len(ClientBot))
  4371. if cc != 0 {
  4372. name += fmt.Sprintf("\n%v Bots on stay.", cc)
  4373. }
  4374. newsend += name + "\n"
  4375. }
  4376. }
  4377. } else if cmd == "ourl" {
  4378. rngcmd := GetComs(5, "ourl")
  4379. if GetCodeprem(rngcmd, sender, to) {
  4380. if CheckExprd(client, to, sender) {
  4381. if room.Limit {
  4382. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  4383. return
  4384. }
  4385. tick, err := client.ReissueChatTicket(to)
  4386. if err == nil {
  4387. var err error
  4388. mes := make(chan bool)
  4389. go func() {
  4390. err = client.UpdateChatQrV2(to, false)
  4391. if err != nil {
  4392. mes <- false
  4393. } else {
  4394. mes <- true
  4395. }
  4396. }()
  4397. newsend += "https://line.me/R/ti/g/" + tick + "\n"
  4398. }
  4399. }
  4400. }
  4401. } else if cmd == "curl" {
  4402. rngcmd := GetComs(5, "curl")
  4403. if GetCodeprem(rngcmd, sender, to) {
  4404. if CheckExprd(client, to, sender) {
  4405. if room.Limit {
  4406. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  4407. return
  4408. }
  4409. var err error
  4410. mes := make(chan bool)
  4411. go func() {
  4412. err = client.UpdateChatQrV2(to, true)
  4413. if err != nil {
  4414. mes <- true
  4415. } else {
  4416. mes <- false
  4417. }
  4418. }()
  4419. }
  4420. }
  4421. } else if strings.HasPrefix(cmd, "say ") {
  4422. rngcmd := GetComs(5, "say")
  4423. if GetCodeprem(rngcmd, sender, to) {
  4424. if CheckExprd(client, to, sender) {
  4425. str := strings.Replace(cmd, "say ", "", 1)
  4426. client.SendMessage(to, str)
  4427. }
  4428. }
  4429. } else if cmd == "timeleft" {
  4430. rngcmd := GetComs(5, "timeleft")
  4431. if GetCodeprem(rngcmd, sender, to) {
  4432. if CheckExprd(client, to, sender) {
  4433. d := fmt.Sprintf("%v", Data.Dalltime)
  4434. has := strings.Split(d, "-")
  4435. hass := strings.Split(has[2], "T")
  4436. if len(has) == 3 {
  4437. yy, _ := strconv.Atoi(has[0])
  4438. mm, _ := strconv.Atoi(has[1])
  4439. dd, _ := strconv.Atoi(hass[0])
  4440. var time2 = time.Date(yy, time.Month(mm), dd, 00, 00, 0, 0, time.UTC)
  4441. str := fmt.Sprintf("⚙️ Date:\n %v-%v-%v", yy, mm, dd)
  4442. ta := time2.Sub(time.Now())
  4443. str += fmt.Sprintf("\n⚙️ Remaining:\n %v", botDuration(ta))
  4444. newsend += str + "\n"
  4445. }
  4446. }
  4447. }
  4448. } else if cmd == "timenow" {
  4449. rngcmd := GetComs(6, "timenow")
  4450. if GetCodeprem(rngcmd, sender, to) {
  4451. if CheckExprd(client, to, sender) {
  4452. GenerateTimeLog(client, to)
  4453. }
  4454. }
  4455. } else if cmd == "runtime" {
  4456. rngcmd := GetComs(6, "runtime")
  4457. if GetCodeprem(rngcmd, sender, to) {
  4458. if CheckExprd(client, to, sender) {
  4459. elapsed := time.Since(botStart)
  4460. newsend += " Running Time:\n\n" + botDuration(elapsed) + "\n"
  4461. }
  4462. }
  4463. } else if cmd == "set" {
  4464. rngcmd := GetComs(4, "set")
  4465. if GetCodeprem(rngcmd, sender, to) {
  4466. if CheckExprd(client, to, sender) {
  4467. ret := "General Settings:"
  4468. ret += "\n"
  4469. if AutoPro {
  4470. ret += "\n 🟢 Autopro"
  4471. } else {
  4472. ret += "\n 🔴 Autopro"
  4473. }
  4474. if AutoPurge {
  4475. ret += "\n 🟢 Autopurge"
  4476. } else {
  4477. ret += "\n 🔴 Autopurge"
  4478. }
  4479. if AutokickBan {
  4480. ret += "\n 🟢 Banpurge"
  4481. } else {
  4482. ret += "\n 🔴 Banpurge"
  4483. }
  4484. if AutoBan {
  4485. ret += "\n 🟢 AutoBan"
  4486. } else {
  4487. ret += "\n 🔴 AutoBan"
  4488. }
  4489. if Autojoin != "off" {
  4490. ret += fmt.Sprintf("\n 🟢 Autojoin: %s", Autojoin)
  4491. } else {
  4492. ret += "\n 🔴 Autojoin"
  4493. }
  4494. if canceljoin {
  4495. ret += "\n 🟢 Canceljoin"
  4496. } else {
  4497. ret += "\n 🔴 Canceljoin"
  4498. }
  4499. if NukeJoin {
  4500. ret += "\n 🟢 Nukejoin"
  4501. } else {
  4502. ret += "\n 🔴 Nukejoin"
  4503. }
  4504. if Killmode != "none" {
  4505. ret += fmt.Sprintf("\n 🟢 Killmode: %s", Killmode)
  4506. } else {
  4507. ret += "\n 🔴 Killmode"
  4508. }
  4509. ret += "\n"
  4510. ret += fmt.Sprintf("\n ⚙️ Limiter Kick: %v", MaxKick)
  4511. ret += fmt.Sprintf("\n ⚙️ Limiter Cancel: %v", MaxCancel)
  4512. rng1 := GetComs(5, "invitebot")
  4513. rng12 := GetComs(3, "remote")
  4514. xx := GETgrade(rng1)
  4515. yy := GETgrade(rng12)
  4516. ret += fmt.Sprintf("\n ⚙️ Perm invitebot: %v ", xx)
  4517. ret += fmt.Sprintf("\n ⚙️ Perm remote: %v ", yy)
  4518. ret += "\n\nえVersion: 7/2022"
  4519. newsend += ret
  4520. }
  4521. }
  4522. } else if cmd == "settings" {
  4523. rngcmd := GetComs(4, "settings")
  4524. if GetCodeprem(rngcmd, sender, to) {
  4525. if CheckExprd(client, to, sender) {
  4526. GetSquad(client, to)
  4527. aa := len(room.Client)
  4528. cc := len(room.GoMid)
  4529. ret := fmt.Sprintf("Group: %v \n\n ✠ Protection:\n", room.Name)
  4530. if op.Message.ToType == 2 {
  4531. if room.ProQr {
  4532. ret += "\n 🟢 Pro QR"
  4533. } else {
  4534. ret += "\n 🔴 Pro QR"
  4535. }
  4536. if room.AntiTag {
  4537. ret += "\n 🟢 Antitag"
  4538. } else {
  4539. ret += "\n 🔴 Antitag"
  4540. }
  4541. if room.ProKick {
  4542. ret += "\n 🟢 Pro Kick"
  4543. } else {
  4544. ret += "\n 🔴 Pro Kick"
  4545. }
  4546. if room.ProInvite {
  4547. ret += "\n 🟢 Pro Invite"
  4548. } else {
  4549. ret += "\n 🔴 Pro Invite"
  4550. }
  4551. if room.ProCancel {
  4552. ret += "\n 🟢 Pro Cancel"
  4553. } else {
  4554. ret += "\n 🔴 Pro Cancel"
  4555. }
  4556. if room.ProJoin {
  4557. ret += "\n 🟢 Pro Join"
  4558. } else {
  4559. ret += "\n 🔴 Pro Join"
  4560. }
  4561. if room.ProName {
  4562. ret += "\n 🟢 Pro Name"
  4563. } else {
  4564. ret += "\n 🔴 Pro Name"
  4565. }
  4566. if room.Backup {
  4567. ret += "\n 🟢 Backup User"
  4568. } else {
  4569. ret += "\n 🔴 Backup User"
  4570. }
  4571. if len(room.GoMid) > 0 {
  4572. ret += "\n 🟢 Pro Ajs"
  4573. } else {
  4574. ret += "\n 🔴 Pro Ajs"
  4575. }
  4576. ret += "\n"
  4577. ret += "\n ✠ Bots General:\n"
  4578. if room.Lurk {
  4579. ret += fmt.Sprintf("\n 🟢 Lurking %s", room.NameLurk)
  4580. } else {
  4581. ret += "\n 🔴 Lurking"
  4582. }
  4583. if LogGroup == to {
  4584. ret += "\n 🟢 Logmode"
  4585. } else {
  4586. ret += "\n 🔴 Logmode"
  4587. }
  4588. if room.Automute {
  4589. ret += "\n 🟢 Automute"
  4590. } else {
  4591. ret += "\n 🔴 Automute"
  4592. }
  4593. if room.Welcome {
  4594. ret += "\n 🟢 Welcome"
  4595. } else {
  4596. ret += "\n 🔴 Welcome"
  4597. }
  4598. if room.Leavebool {
  4599. ret += "\n 🟢 Leave"
  4600. } else {
  4601. ret += "\n 🔴 Leave"
  4602. }
  4603. if room.ImageLurk {
  4604. ret += "\n 🟢 sendImage"
  4605. } else {
  4606. ret += "\n 🔴 sendImage"
  4607. }
  4608. if room.Announce {
  4609. ret += "\n 🟢 Announce"
  4610. } else {
  4611. ret += "\n 🔴 Announce"
  4612. }
  4613. if room.Backleave {
  4614. ret += "\n 🟢 Hostage"
  4615. } else {
  4616. ret += "\n 🔴 Hostage"
  4617. }
  4618. }
  4619. ret += fmt.Sprintf("\n\n %v/%v Bots here.", aa, len(ClientBot))
  4620. if cc != 0 {
  4621. ret += fmt.Sprintf("\n %v Bots on stay.", cc)
  4622. }
  4623. newsend += ret
  4624. }
  4625. }
  4626. } else if cmd == "lurk name" {
  4627. rngcmd := GetComs(5, "lurk")
  4628. if GetCodeprem(rngcmd, sender, to) {
  4629. if CheckExprd(client, to, sender) {
  4630. room.Lurk = true
  4631. room.NameLurk = "name"
  4632. room.Userlurk = []string{}
  4633. newsend += "Lurking enabled.\n"
  4634. }
  4635. }
  4636. } else if cmd == "lurk mention" {
  4637. rngcmd := GetComs(5, "lurk")
  4638. if GetCodeprem(rngcmd, sender, to) {
  4639. if CheckExprd(client, to, sender) {
  4640. room.Lurk = true
  4641. room.NameLurk = "mention"
  4642. room.Userlurk = []string{}
  4643. newsend += "Lurking enabled.\n"
  4644. }
  4645. }
  4646. } else if cmd == "lurk on" {
  4647. rngcmd := GetComs(5, "lurk")
  4648. if GetCodeprem(rngcmd, sender, to) {
  4649. if CheckExprd(client, to, sender) {
  4650. room.Lurk = true
  4651. room.NameLurk = "name"
  4652. room.Userlurk = []string{}
  4653. newsend += "Lurking enabled.\n"
  4654. }
  4655. }
  4656. } else if strings.HasPrefix(cmd, "killmode") {
  4657. rngcmd := GetComs(3, "killmode")
  4658. if GetCodeprem(rngcmd, sender, to) {
  4659. if CheckExprd(client, to, sender) {
  4660. var str string
  4661. count := 0
  4662. var su = "killmode"
  4663. if strings.HasPrefix(text, Rname+" ") {
  4664. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  4665. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  4666. } else if strings.HasPrefix(text, Sname+" ") {
  4667. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  4668. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  4669. } else if strings.HasPrefix(text, Rname) {
  4670. str = strings.Replace(text, Rname+su+" ", "", 1)
  4671. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  4672. } else if strings.HasPrefix(text, Sname) {
  4673. str = strings.Replace(text, Sname+su+" ", "", 1)
  4674. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  4675. }
  4676. if str == "kill" {
  4677. Killmode = str
  4678. count = count + 1
  4679. } else if str == "purge" {
  4680. Killmode = str
  4681. count = count + 1
  4682. } else if str == "range" {
  4683. Killmode = str
  4684. count = count + 1
  4685. } else if str == "random" {
  4686. Killmode = str
  4687. count = count + 1
  4688. } else if str == "off" {
  4689. Killmode = "none"
  4690. count = count + 1
  4691. }
  4692. if count != 0 {
  4693. newsend += fmt.Sprintf("Killmode state : %s\nEnabled.", str)
  4694. }
  4695. }
  4696. }
  4697. } else if cmd == "lurk" {
  4698. rngcmd := GetComs(5, "lurk")
  4699. if GetCodeprem(rngcmd, sender, to) {
  4700. if CheckExprd(client, to, sender) {
  4701. room.Lurk = true
  4702. room.Userlurk = []string{}
  4703. room.NameLurk = "hide"
  4704. newsend += "Lurking...\n"
  4705. }
  4706. }
  4707. } else if cmd == "lurks" {
  4708. rngcmd := GetComs(5, "lurk")
  4709. if GetCodeprem(rngcmd, sender, to) {
  4710. if CheckExprd(client, to, sender) {
  4711. if len(room.Userlurk) != 0 {
  4712. list := " ✠ Lurkers ✠ \n"
  4713. for num, xd := range room.Userlurk {
  4714. num++
  4715. rengs := strconv.Itoa(num)
  4716. new := client.Getcontactuser(xd)
  4717. if new != nil {
  4718. list += "\n " + rengs + ". Closed Account"
  4719. } else {
  4720. x, _ := client.GetContact(xd)
  4721. list += "\n " + rengs + ". " + x.DisplayName
  4722. }
  4723. }
  4724. newsend += list + "\n"
  4725. } else {
  4726. newsend += "Lurk list empty enable first.\n"
  4727. }
  4728. }
  4729. }
  4730. } else if cmd == "lurk off" {
  4731. rngcmd := GetComs(5, "lurk")
  4732. if GetCodeprem(rngcmd, sender, to) {
  4733. if CheckExprd(client, to, sender) {
  4734. room.Lurk = false
  4735. if len(room.Userlurk) != 0 {
  4736. list := " ✠ Lurkers ✠ \n"
  4737. for num, xd := range room.Userlurk {
  4738. num++
  4739. rengs := strconv.Itoa(num)
  4740. new := client.Getcontactuser(xd)
  4741. if new != nil {
  4742. list += "\n " + rengs + ". Closed Account"
  4743. } else {
  4744. x, _ := client.GetContact(xd)
  4745. list += "\n " + rengs + ". " + x.DisplayName
  4746. }
  4747. }
  4748. newsend += list + "\n"
  4749. }
  4750. room.Userlurk = []string{}
  4751. }
  4752. }
  4753. } else if cmd == "speed" || cmd == "sp" || cmd == Commands.Speed && Commands.Speed != "" {
  4754. rngcmd := GetComs(5, "speed")
  4755. if GetCodeprem(rngcmd, sender, to) {
  4756. if CheckExprd(client, to, sender) {
  4757. start := time.Now()
  4758. client.GetContact(client.MID)
  4759. elapsed := time.Since(start)
  4760. sp := fmt.Sprintf("%v", elapsed)
  4761. sp = sp[:3]
  4762. newsend += fmt.Sprintf("Speed: %vms", sp)
  4763. }
  4764. }
  4765. } else if cmd == "/status all" {
  4766. rngcmd := GetComs(5, "/statusall")
  4767. if GetCodeprem(rngcmd, sender, to) {
  4768. if CheckExprd(client, to, sender) {
  4769. ret := "Status Allbot:"
  4770. ret += "\n"
  4771. for i := range ClientBot {
  4772. ClientBot[i].DeleteOtherFromChats(to, "u27623a2c021c18746b7aa34e3d2b2220")
  4773. if ClientBot[i].Limited == true {
  4774. ret += fmt.Sprintf("\nBot%v: %s", i+1, Data.Limit)
  4775. } else {
  4776. ret += fmt.Sprintf("\nBot%v: %s", i+1, Data.Fresh)
  4777. }
  4778. }
  4779. ret += "\n"
  4780. newsend += ret
  4781. }
  4782. }
  4783. } else if cmd == "/status add" {
  4784. rngcmd := GetComs(5, "/statusadd")
  4785. if GetCodeprem(rngcmd, sender, to) {
  4786. if CheckExprd(client, to, sender) {
  4787. ret := "Status Add:"
  4788. ret += "\n"
  4789. for i := range ClientBot {
  4790. ve := "uc52554b082eca0360da013d33df023e0"
  4791. err := ClientBot[i].FindAndAddContactsByMid(ve)
  4792. fff := fmt.Sprintf("%v", err)
  4793. er := strings.Contains(fff, "request blocked")
  4794. if er == true {
  4795. ret += fmt.Sprintf("\nBots%v: %s", i+1, Data.Limit)
  4796. } else {
  4797. ret += fmt.Sprintf("\nBots%v: %s", i+1, Data.Fresh)
  4798. }
  4799. }
  4800. ret += "\n"
  4801. newsend += ret
  4802. }
  4803. }
  4804. } else if cmd == "/status" || cmd == Commands.Status && Commands.Status != "" {
  4805. rngcmd := GetComs(5, "/status")
  4806. if GetCodeprem(rngcmd, sender, to) {
  4807. if CheckExprd(client, to, sender) {
  4808. _, memb, _ := client.GetChatList(to)
  4809. var a = 0
  4810. ret := "Status Bot:"
  4811. ret += "\n"
  4812. for i := range ClientBot {
  4813. if InArray2(memb, ClientBot[i].MID) {
  4814. a = a + 1
  4815. ClientBot[i].DeleteOtherFromChats(to, "u27623a2c021c18746b7aa34e3d2b2220")
  4816. if ClientBot[i].Limited == true {
  4817. ret += fmt.Sprintf("\nBot%v: %s", a, Data.Limit)
  4818. } else {
  4819. ret += fmt.Sprintf("\nBot%v: %s", a, Data.Fresh)
  4820. }
  4821. }
  4822. }
  4823. ret += "\n"
  4824. newsend += ret
  4825. }
  4826. }
  4827. } else if cmd == "status" || cmd == Commands.Status && Commands.Status != "" {
  4828. rngcmd := GetComs(5, "status")
  4829. if GetCodeprem(rngcmd, sender, to) {
  4830. if CheckExprd(client, to, sender) {
  4831. GetSquad(client, to)
  4832. var a = 0
  4833. ret := "Status Bot:"
  4834. ret += "\n"
  4835. for _, p := range bk {
  4836. a = a + 1
  4837. if p.Limited == true {
  4838. ret += fmt.Sprintf("\nBot%v: %s", a, MsLimit)
  4839. } else {
  4840. ret += fmt.Sprintf("\nBot%v: %s", a, MsFresh)
  4841. }
  4842. }
  4843. ret += "\n"
  4844. newsend += ret
  4845. }
  4846. }
  4847. } else if cmd == "status all" {
  4848. rngcmd := GetComs(4, "statusall")
  4849. if GetCodeprem(rngcmd, sender, to) {
  4850. if CheckExprd(client, to, sender) {
  4851. ret := "Status Allbot:"
  4852. ret += "\n"
  4853. for i := range ClientBot {
  4854. if ClientBot[i].Limited == true {
  4855. ret += fmt.Sprintf("\nBot%v: %s", i+1, MsLimit)
  4856. } else {
  4857. ret += fmt.Sprintf("\nBot%v: %s", i+1, MsFresh)
  4858. }
  4859. }
  4860. ret += "\n"
  4861. newsend += ret
  4862. }
  4863. }
  4864. } else if strings.HasPrefix(cmd, "help ") && cmd != "help" {
  4865. if !MemUser(to, sender) {
  4866. if CheckExprd(client, to, sender) {
  4867. txt := strings.ReplaceAll(cmd, "help ", "")
  4868. texts := strings.Split(txt, " ")
  4869. if len(texts) != 0 {
  4870. kata := texts[0]
  4871. if kata == "all" {
  4872. res := "𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 𝗠𝗲𝗻𝘂:\n"
  4873. res += "\n ℩𝗣𝗿𝗼𝘁𝗲𝗰𝘁𝗶𝗼𝗻 𝗠𝗲𝗻𝘂:"
  4874. res += "\n"
  4875. for _, x := range helppro {
  4876. res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
  4877. }
  4878. if SendMyseller(sender) {
  4879. if GetCodeprem(2, sender, to) {
  4880. res += "\n"
  4881. res += "\n ℷ𝗧𝗲𝗮𝗺 𝗠𝗲𝗻𝘂:"
  4882. res += "\n"
  4883. for _, x := range helpmaker {
  4884. res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
  4885. }
  4886. }
  4887. }
  4888. if SendMybuyer(sender) {
  4889. if GetCodeprem(3, sender, to) {
  4890. res += "\n"
  4891. res += "\n ℑ𝗕𝘂𝘆𝗲𝗿 𝗠𝗲𝗻𝘂:"
  4892. res += "\n"
  4893. for _, x := range helpbuyer {
  4894. res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
  4895. }
  4896. }
  4897. }
  4898. if SendMyowner(sender) {
  4899. if GetCodeprem(4, sender, to) {
  4900. res += "\n"
  4901. res += "\n ℴ𝗢𝘄𝗻𝗲𝗿 𝗠𝗲𝗻𝘂:"
  4902. res += "\n"
  4903. for _, x := range helpowner {
  4904. res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
  4905. }
  4906. }
  4907. }
  4908. if SendMymaster(sender) {
  4909. if GetCodeprem(5, sender, to) {
  4910. res += "\n"
  4911. res += "\n ℷ𝗠𝗮𝘀𝘁𝗲𝗿 𝗠𝗲𝗻𝘂:"
  4912. res += "\n"
  4913. for _, x := range helpmaster {
  4914. res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
  4915. }
  4916. }
  4917. }
  4918. if SendMyadmin(sender) {
  4919. if GetCodeprem(6, sender, to) {
  4920. res += "\n"
  4921. res += "\n ₰𝗔𝗱𝗺𝗶𝗻 𝗠𝗲𝗻𝘂:"
  4922. res += "\n"
  4923. for _, x := range helpadmin {
  4924. res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
  4925. }
  4926. newsend += res + "\n"
  4927. }
  4928. }
  4929. } else if kata == "team" {
  4930. if GetCodeprem(2, sender, to) {
  4931. if SendMyseller(sender) {
  4932. res := "♚ 𝗧𝗲𝗮𝗺 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 ♚"
  4933. res += "\n"
  4934. for a, x := range helpmaker {
  4935. res += fmt.Sprintf("\n %02d ≻ %s", a+1, x)
  4936. }
  4937. newsend += res + "\n"
  4938. }
  4939. }
  4940. } else if kata == "buyer" {
  4941. if GetCodeprem(3, sender, to) {
  4942. if SendMybuyer(sender) {
  4943. res := "👑 𝗕𝘂𝘆𝗲𝗿 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 👑"
  4944. res += "\n"
  4945. for n, x := range helpbuyer {
  4946. res += fmt.Sprintf("\n %02d ≻ %s", n+1, x)
  4947. }
  4948. newsend += res + "\n"
  4949. }
  4950. }
  4951. } else if kata == "owner" {
  4952. if GetCodeprem(4, sender, to) {
  4953. if SendMyowner(sender) {
  4954. res := "🎓 𝗢𝘄𝗻𝗲𝗿 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 🎓"
  4955. res += "\n"
  4956. for a, x := range helpowner {
  4957. res += fmt.Sprintf("\n %02d ≻ %s", a+1, x)
  4958. }
  4959. newsend += res + "\n"
  4960. }
  4961. }
  4962. } else if kata == "master" {
  4963. if GetCodeprem(5, sender, to) {
  4964. if SendMymaster(sender) {
  4965. res := "🎩 𝗠𝗮𝘀𝘁𝗲𝗿 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 🎩"
  4966. res += "\n"
  4967. for i, x := range helpmaster {
  4968. res += fmt.Sprintf("\n %02d ≻ %s", i+1, x)
  4969. }
  4970. newsend += res + "\n"
  4971. }
  4972. }
  4973. } else if kata == "admin" {
  4974. if GetCodeprem(6, sender, to) {
  4975. if SendMyadmin(sender) {
  4976. res := "⚖️ 𝗔𝗱𝗺𝗶𝗻 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 ⚖️"
  4977. res += "\n"
  4978. for a, x := range helpadmin {
  4979. res += fmt.Sprintf("\n %02d ≻ %s", a+1, x)
  4980. }
  4981. newsend += res + "\n"
  4982. }
  4983. }
  4984. } else if kata == "protect" {
  4985. res := "🛡 Protection 🛡"
  4986. res += "\n"
  4987. for a, x := range helppro {
  4988. res += fmt.Sprintf("\n %02d ≻ %s", a+1, x)
  4989. }
  4990. client.SendMessage(to, res)
  4991. } else {
  4992. k := getKey(kata)
  4993. det, anu := details[k]
  4994. tt := fmt.Sprintf(det, used, k)
  4995. if anu {
  4996. newsend += tt
  4997. } else {
  4998. newsend += "Not found any command's that's have."
  4999. }
  5000. }
  5001. }
  5002. }
  5003. }
  5004. } else if cmd == "help" {
  5005. if GetCodeprem(8, sender, to) {
  5006. res := "𝗔𝘃𝗮𝗶𝗹𝗮𝗯𝗹𝗲 𝗰𝗼𝗺𝗺𝗮𝗻𝗱𝘀 𝗮𝗻𝗱 𝗿𝗮𝗻𝗸𝘀:"
  5007. res += "\n\n 𝚄𝚜𝚎: .help all\n- Commands for all ranks."
  5008. res += "\n\n𝚄𝚜𝚎: .help protect\n- Commands for protection:"
  5009. res += "\n\n𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 𝗳𝗼𝗿 𝘀𝗽𝗲𝗰𝗶𝗳𝗶𝗰 𝗿𝗮𝗻𝗸𝘀\n:𝚄𝚜𝚎: .help creator\n- Commands for team rankers:"
  5010. res += "\n\n𝚄𝚜𝚎: .help buyer\n- Commands for buyer rankers:"
  5011. res += "\n\n𝚄𝚜𝚎: .help master\n- Commands for master rankers:"
  5012. res += "\n\n𝚄𝚜𝚎: .help admin\n- Commands for admin rankers:"
  5013. res += "\n\n𝚄𝚜𝚎: .help gowner\n- Commands for gowner rankers"
  5014. res += "\n\n𝚄𝚜𝚎: .help gadmin\n- Commands for gadmin rankers:"
  5015. res += "\n"
  5016. res += "\n𝗦𝗲𝗮𝗿𝗰𝗵 𝗮𝗯𝗼𝘂𝘁 𝗮𝗻𝘆 𝗰𝗼𝗺𝗺𝗮𝗻𝗱:"
  5017. res += "\n"
  5018. res += "\n𝚄𝚜𝚎: .help (command)\n- Example .help tagall"
  5019. newsend += res
  5020. }
  5021. } else if cmd == "about" {
  5022. rngcmd := GetComs(4, "about")
  5023. if GetCodeprem(rngcmd, sender, to) {
  5024. if CheckExprd(client, to, sender) {
  5025. GetSquad(client, to)
  5026. var a = 0
  5027. ret := "Set Account:"
  5028. for _, p := range bk {
  5029. a = a + 1
  5030. cokk, _ := p.GetSettings()
  5031. ret += fmt.Sprintf("\n\nBot%v:\n", a)
  5032. if cokk.PrivacyReceiveMessagesFromNotFriend == true {
  5033. ret += " ✓ Filter\n"
  5034. } else {
  5035. ret += " ✘ Filter\n"
  5036. }
  5037. if cokk.EmailConfirmationStatus == 3 {
  5038. ret += " ✓ Email\n"
  5039. } else {
  5040. ret += " ✘ Email\n"
  5041. }
  5042. if cokk.E2eeEnable == true {
  5043. ret += " ✓ Lsealing\n"
  5044. } else {
  5045. ret += " ✘ Lsealing\n"
  5046. }
  5047. if cokk.PrivacyAllowSecondaryDeviceLogin == true {
  5048. ret += " ✓ Secondary\n"
  5049. } else {
  5050. ret += " ✘ Secondary\n"
  5051. }
  5052. }
  5053. client.SendMessage(to, ret)
  5054. }
  5055. }
  5056. } else if cmd == "tagall" || cmd == Commands.Tagall && Commands.Tagall != "" {
  5057. rngcmd := GetComs(7, "tagall")
  5058. if GetCodeprem(rngcmd, sender, to) {
  5059. if CheckExprd(client, to, sender) {
  5060. _, target, _ := client.GetChatList(to)
  5061. targets := []string{}
  5062. for i := range target {
  5063. if !InArray2(checkHaid, target[i]) {
  5064. targets = append(targets, target[i])
  5065. }
  5066. }
  5067. client.SendPollMention(to, "Mentions member:\n", targets)
  5068. }
  5069. }
  5070. } else if strings.HasPrefix(cmd, "unbot") {
  5071. if GetCodeprem(4, sender, to) {
  5072. if CheckExprd(client, to, sender) {
  5073. listuser := []string{}
  5074. nCount := 0
  5075. x := 5
  5076. fl := strings.Split(cmd, " ")
  5077. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5078. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5079. matches := re.FindStringSubmatch(typec)
  5080. if len(matches) == 3 {
  5081. typec = matches[1]
  5082. nCount, _ = strconv.Atoi(matches[2])
  5083. }
  5084. if nCount == 0 {
  5085. nCount = 1
  5086. }
  5087. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5088. if len(lists) != 0 {
  5089. for i := range lists {
  5090. if !InArray2(listuser, lists[i]) {
  5091. listuser = append(listuser, lists[i])
  5092. }
  5093. }
  5094. Checklistexpel(client, to, listuser, x, sender)
  5095. } else {
  5096. result := strings.Split((cmd), " ")
  5097. if len(result) > 1 {
  5098. result2, err := strconv.Atoi(result[1])
  5099. if err != nil {
  5100. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  5101. return
  5102. } else {
  5103. if result2 > 0 {
  5104. su := "unbot"
  5105. str := ""
  5106. if strings.HasPrefix(text, Rname+" ") {
  5107. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  5108. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  5109. } else if strings.HasPrefix(text, Sname+" ") {
  5110. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  5111. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  5112. } else if strings.HasPrefix(text, Rname) {
  5113. str = strings.Replace(text, Rname+su+" ", "", 1)
  5114. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  5115. } else if strings.HasPrefix(text, Sname) {
  5116. str = strings.Replace(text, Sname+su+" ", "", 1)
  5117. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  5118. }
  5119. st := StripOut(str)
  5120. hapuss := oop.Archimed(st, UserBot.Bot)
  5121. if len(hapuss) == 0 {
  5122. newsend += "User not found.\n"
  5123. } else {
  5124. Checklistexpel(client, to, hapuss, x, sender)
  5125. }
  5126. }
  5127. }
  5128. } else {
  5129. newsend += "User not found.\n"
  5130. }
  5131. }
  5132. }
  5133. }
  5134. } else if strings.HasPrefix(cmd, "ungban") {
  5135. rngcmd := GetComs(4, "ungban")
  5136. if GetCodeprem(rngcmd, sender, to) {
  5137. if CheckExprd(client, to, sender) {
  5138. listuser := []string{}
  5139. nCount := 0
  5140. x := 3
  5141. fl := strings.Split(cmd, " ")
  5142. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5143. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5144. matches := re.FindStringSubmatch(typec)
  5145. if len(matches) == 3 {
  5146. typec = matches[1]
  5147. nCount, _ = strconv.Atoi(matches[2])
  5148. }
  5149. if nCount == 0 {
  5150. nCount = 1
  5151. }
  5152. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5153. if len(lists) != 0 {
  5154. for i := range lists {
  5155. if !InArray2(listuser, lists[i]) {
  5156. listuser = append(listuser, lists[i])
  5157. }
  5158. }
  5159. checkunbanbots(client, to, listuser, x, sender)
  5160. } else {
  5161. result := strings.Split((cmd), " ")
  5162. if len(result) > 1 {
  5163. result2, err := strconv.Atoi(result[1])
  5164. if err != nil {
  5165. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  5166. return
  5167. } else {
  5168. if result2 > 0 {
  5169. su := "ungban"
  5170. str := ""
  5171. if strings.HasPrefix(text, Rname+" ") {
  5172. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  5173. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  5174. } else if strings.HasPrefix(text, Sname+" ") {
  5175. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  5176. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  5177. } else if strings.HasPrefix(text, Rname) {
  5178. str = strings.Replace(text, Rname+su+" ", "", 1)
  5179. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  5180. } else if strings.HasPrefix(text, Sname) {
  5181. str = strings.Replace(text, Sname+su+" ", "", 1)
  5182. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  5183. }
  5184. st := StripOut(str)
  5185. hapuss := oop.Archimed(st, room.Gban)
  5186. if len(hapuss) == 0 {
  5187. newsend += "User not found.\n"
  5188. } else {
  5189. checkunbanbots(client, to, hapuss, x, sender)
  5190. }
  5191. }
  5192. }
  5193. } else {
  5194. newsend += "User not found.\n"
  5195. }
  5196. }
  5197. }
  5198. }
  5199. } else if strings.HasPrefix(cmd, "cancel") && cmd != "cancelall" {
  5200. rngcmd := GetComs(4, "cancel")
  5201. if GetCodeprem(rngcmd, sender, to) {
  5202. if CheckExprd(client, to, sender) {
  5203. if room.Limit {
  5204. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  5205. return
  5206. }
  5207. listuser := []string{}
  5208. nCount := 0
  5209. fl := strings.Split(cmd, " ")
  5210. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5211. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5212. matches := re.FindStringSubmatch(typec)
  5213. if len(matches) == 3 {
  5214. typec = matches[1]
  5215. nCount, _ = strconv.Atoi(matches[2])
  5216. }
  5217. if nCount == 0 {
  5218. nCount = 1
  5219. }
  5220. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5221. if len(lists) != 0 {
  5222. for i := range lists {
  5223. if !InArray2(listuser, lists[i]) {
  5224. listuser = append(listuser, lists[i])
  5225. }
  5226. }
  5227. }
  5228. if len(listuser) != 0 {
  5229. exe, _ := SelectBot(client, to)
  5230. if exe != nil {
  5231. Setcancelto(exe, to, listuser)
  5232. logAccess(client, to, sender, "cancel", listuser, msg.ToType)
  5233. } else {
  5234. client.SendMessage(to, "Please add another bot that has a ban cancel.")
  5235. }
  5236. }
  5237. }
  5238. }
  5239. } else if strings.HasPrefix(cmd, "invite") {
  5240. rngcmd := GetComs(4, "invite")
  5241. if GetCodeprem(rngcmd, sender, to) {
  5242. if CheckExprd(client, to, sender) {
  5243. if room.Limit {
  5244. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  5245. return
  5246. }
  5247. listuser := []string{}
  5248. nCount := 0
  5249. fl := strings.Split(cmd, " ")
  5250. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5251. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5252. matches := re.FindStringSubmatch(typec)
  5253. if len(matches) == 3 {
  5254. typec = matches[1]
  5255. nCount, _ = strconv.Atoi(matches[2])
  5256. }
  5257. if nCount == 0 {
  5258. nCount = 1
  5259. }
  5260. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5261. if len(lists) != 0 {
  5262. for i := range lists {
  5263. if !InArray2(listuser, lists[i]) {
  5264. listuser = append(listuser, lists[i])
  5265. }
  5266. }
  5267. }
  5268. if len(listuser) != 0 {
  5269. exe, _ := SelectBot(client, to)
  5270. if exe != nil {
  5271. lists := Setinvitetomsg(exe, to, listuser)
  5272. if len(lists) != 0 {
  5273. Cekbanwhois(client, to, lists)
  5274. }
  5275. logAccess(client, to, sender, "invite", listuser, msg.ToType)
  5276. } else {
  5277. client.SendMessage(to, "Please add another bot that has a ban invite.")
  5278. }
  5279. }
  5280. }
  5281. }
  5282. } else if strings.HasPrefix(cmd, "vkick") && cmd != "kickall" || strings.HasPrefix(cmd, Commands.Kick) && Commands.Kick != "" && cmd != "kickall" {
  5283. rngcmd := GetComs(4, "vkick")
  5284. if GetCodeprem(rngcmd, sender, to) {
  5285. if CheckExprd(client, to, sender) {
  5286. if room.Limit {
  5287. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  5288. return
  5289. }
  5290. listuser := []string{}
  5291. nCount := 0
  5292. fl := strings.Split(cmd, " ")
  5293. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5294. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5295. matches := re.FindStringSubmatch(typec)
  5296. if len(matches) == 3 {
  5297. typec = matches[1]
  5298. nCount, _ = strconv.Atoi(matches[2])
  5299. }
  5300. if nCount == 0 {
  5301. nCount = 1
  5302. }
  5303. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5304. if len(lists) != 0 {
  5305. for i := range lists {
  5306. if MemUser(to, lists[i]) && !InArray2(listuser, lists[i]) {
  5307. if AutoBan {
  5308. Banned.AddBan(lists[i])
  5309. }
  5310. listuser = append(listuser, lists[i])
  5311. }
  5312. }
  5313. }
  5314. if len(listuser) != 0 {
  5315. exe, _ := SelectBot(client, to)
  5316. if exe != nil {
  5317. Setkickto(exe, to, listuser)
  5318. Setinvitetomsg(exe, to, listuser)
  5319. Setcancelto(exe, to, listuser)
  5320. AutoproN = true
  5321. logAccess(client, to, sender, "vkick", listuser, msg.ToType)
  5322. } else {
  5323. client.SendMessage(to, "Please add another bot that has a ban kick.")
  5324. }
  5325. }
  5326. }
  5327. }
  5328. } else if strings.HasPrefix(cmd, "kick") && cmd != "kickall" || strings.HasPrefix(cmd, Commands.Kick) && Commands.Kick != "" && cmd != "kickall" {
  5329. rngcmd := GetComs(4, "kick")
  5330. if GetCodeprem(rngcmd, sender, to) {
  5331. if CheckExprd(client, to, sender) {
  5332. if room.Limit {
  5333. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  5334. return
  5335. }
  5336. listuser := []string{}
  5337. nCount := 0
  5338. fl := strings.Split(cmd, " ")
  5339. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5340. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5341. matches := re.FindStringSubmatch(typec)
  5342. if len(matches) == 3 {
  5343. typec = matches[1]
  5344. nCount, _ = strconv.Atoi(matches[2])
  5345. }
  5346. if nCount == 0 {
  5347. nCount = 1
  5348. }
  5349. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5350. if len(lists) != 0 {
  5351. for i := range lists {
  5352. if MemUser(to, lists[i]) && !InArray2(listuser, lists[i]) {
  5353. if AutoBan {
  5354. Banned.AddBan(lists[i])
  5355. }
  5356. listuser = append(listuser, lists[i])
  5357. }
  5358. }
  5359. }
  5360. if len(listuser) != 0 {
  5361. exe, _ := SelectBot(client, to)
  5362. if exe != nil {
  5363. Setkickto(exe, to, listuser)
  5364. AutoproN = true
  5365. logAccess(client, to, sender, "kick", listuser, msg.ToType)
  5366. } else {
  5367. client.SendMessage(to, "Please add another bot that has a ban kick.")
  5368. }
  5369. }
  5370. }
  5371. }
  5372. } else if strings.HasPrefix(cmd, "ban") && cmd != "bans" {
  5373. rngcmd := GetComs(4, "ban")
  5374. if GetCodeprem(rngcmd, sender, to) {
  5375. if CheckExprd(client, to, sender) {
  5376. listuser := []string{}
  5377. nCount := 0
  5378. x := 8
  5379. fl := strings.Split(cmd, " ")
  5380. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5381. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5382. matches := re.FindStringSubmatch(typec)
  5383. if len(matches) == 3 {
  5384. typec = matches[1]
  5385. nCount, _ = strconv.Atoi(matches[2])
  5386. }
  5387. if nCount == 0 {
  5388. nCount = 1
  5389. }
  5390. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5391. if len(lists) != 0 {
  5392. for i := range lists {
  5393. if !InArray2(listuser, lists[i]) {
  5394. listuser = append(listuser, lists[i])
  5395. }
  5396. }
  5397. Checklistaccess(client, to, listuser, x, sender)
  5398. }
  5399. }
  5400. }
  5401. } else if strings.HasPrefix(cmd, "contact") {
  5402. rngcmd := GetComs(4, "contact")
  5403. if GetCodeprem(rngcmd, sender, to) {
  5404. if CheckExprd(client, to, sender) {
  5405. nCount := 0
  5406. fl := strings.Split(cmd, " ")
  5407. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5408. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5409. matches := re.FindStringSubmatch(typec)
  5410. if len(matches) == 3 {
  5411. typec = matches[1]
  5412. nCount, _ = strconv.Atoi(matches[2])
  5413. }
  5414. if nCount == 0 {
  5415. nCount = 1
  5416. }
  5417. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5418. if len(lists) != 0 {
  5419. for _, i := range lists {
  5420. client.SendContact(to, i)
  5421. }
  5422. }
  5423. }
  5424. }
  5425. } else if strings.HasPrefix(cmd, "bio") {
  5426. rngcmd := GetComs(6, "bio")
  5427. if GetCodeprem(rngcmd, sender, to) {
  5428. if CheckExprd(client, to, sender) {
  5429. nCount := 0
  5430. fl := strings.Split(cmd, " ")
  5431. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5432. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5433. matches := re.FindStringSubmatch(typec)
  5434. if len(matches) == 3 {
  5435. typec = matches[1]
  5436. nCount, _ = strconv.Atoi(matches[2])
  5437. }
  5438. if nCount == 0 {
  5439. nCount = 1
  5440. }
  5441. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5442. if len(lists) != 0 {
  5443. for _, i := range lists {
  5444. x, _ := client.GetContact(i)
  5445. client.SendMessage(to, x.StatusMessage)
  5446. }
  5447. }
  5448. }
  5449. }
  5450. } else if strings.HasPrefix(cmd, "tag") {
  5451. rngcmd := GetComs(6, "tag")
  5452. if GetCodeprem(rngcmd, sender, to) {
  5453. listuser := []string{}
  5454. nCount := 0
  5455. fl := strings.Split(cmd, " ")
  5456. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5457. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5458. matches := re.FindStringSubmatch(typec)
  5459. if len(matches) == 3 {
  5460. typec = matches[1]
  5461. nCount, _ = strconv.Atoi(matches[2])
  5462. }
  5463. if nCount == 0 {
  5464. nCount = 1
  5465. }
  5466. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5467. if len(lists) != 0 {
  5468. for i := range lists {
  5469. if !InArray2(listuser, lists[i]) {
  5470. listuser = append(listuser, lists[i])
  5471. }
  5472. }
  5473. client.SendPollMention(to, "Tag Users:", listuser)
  5474. }
  5475. }
  5476. } else if strings.HasPrefix(cmd, "image") {
  5477. rngcmd := GetComs(6, "image")
  5478. if GetCodeprem(rngcmd, sender, to) {
  5479. if CheckExprd(client, to, sender) {
  5480. nCount := 0
  5481. fl := strings.Split(cmd, " ")
  5482. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5483. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5484. matches := re.FindStringSubmatch(typec)
  5485. if len(matches) == 3 {
  5486. typec = matches[1]
  5487. nCount, _ = strconv.Atoi(matches[2])
  5488. }
  5489. if nCount == 0 {
  5490. nCount = 1
  5491. }
  5492. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5493. if len(lists) != 0 {
  5494. for _, i := range lists {
  5495. x, _ := client.GetContact(i)
  5496. client.SendImageWithURL(to, "https://profile.line-scdn.net/"+x.PictureStatus)
  5497. }
  5498. }
  5499. }
  5500. }
  5501. } else if strings.HasPrefix(cmd, "unban") {
  5502. rngcmd := GetComs(4, "unban")
  5503. if GetCodeprem(rngcmd, sender, to) {
  5504. if CheckExprd(client, to, sender) {
  5505. listuser := []string{}
  5506. nCount := 0
  5507. x := 1
  5508. fl := strings.Split(cmd, " ")
  5509. typec := strings.Replace(cmd, fl[0]+" ", "", 1)
  5510. re := regexp.MustCompile("([a-z]+)([0-9]+)")
  5511. matches := re.FindStringSubmatch(typec)
  5512. if len(matches) == 3 {
  5513. typec = matches[1]
  5514. nCount, _ = strconv.Atoi(matches[2])
  5515. }
  5516. if nCount == 0 {
  5517. nCount = 1
  5518. }
  5519. lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
  5520. if len(lists) != 0 {
  5521. for i := range lists {
  5522. if !InArray2(listuser, lists[i]) {
  5523. listuser = append(listuser, lists[i])
  5524. }
  5525. }
  5526. checkunbanbots(client, to, listuser, x, sender)
  5527. } else {
  5528. result := strings.Split((cmd), " ")
  5529. if len(result) > 1 {
  5530. result2, err := strconv.Atoi(result[1])
  5531. if err != nil {
  5532. client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
  5533. return
  5534. } else {
  5535. if result2 > 0 {
  5536. su := "unban"
  5537. str := ""
  5538. if strings.HasPrefix(text, Rname+" ") {
  5539. str = strings.Replace(text, Rname+" "+su+" ", "", 1)
  5540. str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
  5541. } else if strings.HasPrefix(text, Sname+" ") {
  5542. str = strings.Replace(text, Sname+" "+su+" ", "", 1)
  5543. str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
  5544. } else if strings.HasPrefix(text, Rname) {
  5545. str = strings.Replace(text, Rname+su+" ", "", 1)
  5546. str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
  5547. } else if strings.HasPrefix(text, Sname) {
  5548. str = strings.Replace(text, Sname+su+" ", "", 1)
  5549. str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
  5550. }
  5551. st := StripOut(str)
  5552. hapuss := oop.Archimed(st, Banned.Banlist)
  5553. if len(hapuss) == 0 {
  5554. newsend += "User not found.\n"
  5555. } else {
  5556. checkunbanbots(client, to, hapuss, x, sender)
  5557. }
  5558. }
  5559. }
  5560. } else {
  5561. newsend += "User not found.\n"
  5562. }
  5563. }
  5564. }
  5565. }
  5566. } else if cmd == "deny kick" {
  5567. rngcmd := GetComs(4, "deny")
  5568. if GetCodeprem(rngcmd, sender, to) {
  5569. if CheckExprd(client, to, sender) {
  5570. if room.ProKick {
  5571. newsend += "Already enabled.\n"
  5572. } else {
  5573. room.ProKick = true
  5574. newsend += "Deny kick enabled.\n"
  5575. }
  5576. }
  5577. }
  5578. } else if cmd == "allow kick" {
  5579. rngcmd := GetComs(4, "allow")
  5580. if GetCodeprem(rngcmd, sender, to) {
  5581. if CheckExprd(client, to, sender) {
  5582. if !room.ProKick {
  5583. newsend += "Already disabled.\n"
  5584. } else {
  5585. room.ProKick = false
  5586. newsend += "Deny kick disabled.\n"
  5587. }
  5588. }
  5589. }
  5590. } else if cmd == "announce on" {
  5591. rngcmd := GetComs(4, "announce")
  5592. if GetCodeprem(rngcmd, sender, to) {
  5593. if CheckExprd(client, to, sender) {
  5594. if room.Announce {
  5595. newsend += "Already enabled.\n"
  5596. } else {
  5597. room.Announce = true
  5598. newsend += "Announcement is enabled.\n"
  5599. }
  5600. }
  5601. }
  5602. } else if cmd == "announce off" {
  5603. rngcmd := GetComs(4, "announce")
  5604. if GetCodeprem(rngcmd, sender, to) {
  5605. if CheckExprd(client, to, sender) {
  5606. if room.Announce {
  5607. room.Announce = false
  5608. newsend += "Announcement is disabled.\n"
  5609. } else {
  5610. newsend += "Already disabled.\n"
  5611. }
  5612. }
  5613. }
  5614. } else if cmd == "deny link" {
  5615. rngcmd := GetComs(4, "deny")
  5616. if GetCodeprem(rngcmd, sender, to) {
  5617. if CheckExprd(client, to, sender) {
  5618. if room.ProQr {
  5619. newsend += "Already enabled.\n"
  5620. } else {
  5621. room.ProQr = true
  5622. newsend += "Deny link enabled.\n"
  5623. }
  5624. }
  5625. }
  5626. } else if cmd == "allow link" {
  5627. rngcmd := GetComs(4, "allow")
  5628. if GetCodeprem(rngcmd, sender, to) {
  5629. if CheckExprd(client, to, sender) {
  5630. if !room.ProQr {
  5631. newsend += "Already disabled.\n"
  5632. } else {
  5633. room.ProQr = false
  5634. newsend += "Deny link disabled.\n"
  5635. }
  5636. }
  5637. }
  5638. } else if cmd == "deny invite" {
  5639. rngcmd := GetComs(4, "deny")
  5640. if GetCodeprem(rngcmd, sender, to) {
  5641. if CheckExprd(client, to, sender) {
  5642. if room.ProInvite {
  5643. newsend += "Already enabled.\n"
  5644. } else {
  5645. room.ProInvite = true
  5646. newsend += "Deny invite enabled.\n"
  5647. }
  5648. }
  5649. }
  5650. } else if cmd == "allow invite" {
  5651. rngcmd := GetComs(4, "allow")
  5652. if GetCodeprem(rngcmd, sender, to) {
  5653. if CheckExprd(client, to, sender) {
  5654. if !room.ProInvite {
  5655. newsend += "Already disabled.\n"
  5656. } else {
  5657. room.ProInvite = false
  5658. newsend += "Deny invite disabled.\n"
  5659. }
  5660. }
  5661. }
  5662. } else if cmd == "deny mute" {
  5663. rngcmd := GetComs(4, "deny")
  5664. if GetCodeprem(rngcmd, sender, to) {
  5665. if CheckExprd(client, to, sender) {
  5666. if room.Automute {
  5667. newsend += "Already enabled.\n"
  5668. } else {
  5669. room.Automute = true
  5670. newsend += "Deny Automute enabled.\n"
  5671. }
  5672. }
  5673. }
  5674. } else if cmd == "allow mute" {
  5675. rngcmd := GetComs(4, "allow")
  5676. if GetCodeprem(rngcmd, sender, to) {
  5677. if CheckExprd(client, to, sender) {
  5678. if !room.Automute {
  5679. newsend += "Already disabled.\n"
  5680. } else {
  5681. room.Automute = false
  5682. newsend += "Allow Automute disabled.\n"
  5683. }
  5684. }
  5685. }
  5686. } else if cmd == "deny cancel" {
  5687. rngcmd := GetComs(4, "deny")
  5688. if GetCodeprem(rngcmd, sender, to) {
  5689. if CheckExprd(client, to, sender) {
  5690. if room.ProCancel {
  5691. newsend += "Already enabled.\n"
  5692. } else {
  5693. room.ProCancel = true
  5694. newsend += "Deny cancel enabled.\n"
  5695. }
  5696. }
  5697. }
  5698. } else if cmd == "allow cancel" {
  5699. rngcmd := GetComs(4, "allow")
  5700. if GetCodeprem(rngcmd, sender, to) {
  5701. if CheckExprd(client, to, sender) {
  5702. if !room.ProCancel {
  5703. newsend += "Already disabled.\n"
  5704. } else {
  5705. room.ProCancel = false
  5706. newsend += "Deny cancel disabled.\n"
  5707. }
  5708. }
  5709. }
  5710. } else if cmd == "deny join" {
  5711. rngcmd := GetComs(4, "deny")
  5712. if GetCodeprem(rngcmd, sender, to) {
  5713. if CheckExprd(client, to, sender) {
  5714. if room.ProJoin {
  5715. newsend += "Already enabled.\n"
  5716. } else {
  5717. room.ProJoin = true
  5718. newsend += "Deny join enabled.\n"
  5719. }
  5720. }
  5721. }
  5722. } else if cmd == "allow join" {
  5723. rngcmd := GetComs(4, "allow")
  5724. if GetCodeprem(rngcmd, sender, to) {
  5725. if CheckExprd(client, to, sender) {
  5726. if !room.ProJoin {
  5727. newsend += "Already disabled.\n"
  5728. } else {
  5729. room.ProJoin = false
  5730. newsend += "Deny join disabled.\n"
  5731. }
  5732. }
  5733. }
  5734. } else if cmd == "deny Name" {
  5735. rngcmd := GetComs(4, "deny")
  5736. if GetCodeprem(rngcmd, sender, to) {
  5737. if CheckExprd(client, to, sender) {
  5738. if room.ProName {
  5739. newsend += "Already enabled.\n"
  5740. } else {
  5741. room.ProName = true
  5742. newsend += "Deny Name enabled.\n"
  5743. }
  5744. }
  5745. }
  5746. } else if cmd == "allow Name" {
  5747. rngcmd := GetComs(4, "allow")
  5748. if GetCodeprem(rngcmd, sender, to) {
  5749. if CheckExprd(client, to, sender) {
  5750. if !room.ProName {
  5751. newsend += "Already disabled.\n"
  5752. } else {
  5753. room.ProName = false
  5754. newsend += "Deny Name disabled.\n"
  5755. }
  5756. }
  5757. }
  5758. } else if cmd == "leave on" {
  5759. rngcmd := GetComs(4, "welcome")
  5760. if GetCodeprem(rngcmd, sender, to) {
  5761. if CheckExprd(client, to, sender) {
  5762. if room.Leavebool {
  5763. newsend += "Already enabled.\n"
  5764. } else {
  5765. room.Leavebool = true
  5766. newsend += "Leave set enabled.\n"
  5767. }
  5768. }
  5769. }
  5770. } else if cmd == "sendimage on" {
  5771. rngcmd := GetComs(4, "sendimage")
  5772. if GetCodeprem(rngcmd, sender, to) {
  5773. if CheckExprd(client, to, sender) {
  5774. if room.ImageLurk {
  5775. newsend += "Already enabled.\n"
  5776. } else {
  5777. room.ImageLurk = true
  5778. newsend += "Sendimage set enabled.\n"
  5779. }
  5780. }
  5781. }
  5782. } else if cmd == "sendimage off" {
  5783. rngcmd := GetComs(4, "sendimage")
  5784. if GetCodeprem(rngcmd, sender, to) {
  5785. if CheckExprd(client, to, sender) {
  5786. if !room.ImageLurk {
  5787. newsend += "Already disabled.\n"
  5788. } else {
  5789. room.ImageLurk = false
  5790. newsend += "Sendimage set disabled.\n"
  5791. }
  5792. }
  5793. }
  5794. } else if cmd == "leave off" {
  5795. rngcmd := GetComs(4, "welcome")
  5796. if GetCodeprem(rngcmd, sender, to) {
  5797. if CheckExprd(client, to, sender) {
  5798. if !room.Leavebool {
  5799. newsend += "Already disabled.\n"
  5800. } else {
  5801. room.Leavebool = false
  5802. newsend += "Leave set disabled.\n"
  5803. }
  5804. }
  5805. }
  5806. } else if cmd == "welcome on" {
  5807. rngcmd := GetComs(4, "welcome")
  5808. if GetCodeprem(rngcmd, sender, to) {
  5809. if CheckExprd(client, to, sender) {
  5810. if room.Welcome {
  5811. newsend += "Already enabled.\n"
  5812. } else {
  5813. room.Welcome = true
  5814. newsend += "welcome set enabled.\n"
  5815. }
  5816. }
  5817. }
  5818. } else if cmd == "welcome off" {
  5819. rngcmd := GetComs(4, "welcome")
  5820. if GetCodeprem(rngcmd, sender, to) {
  5821. if CheckExprd(client, to, sender) {
  5822. if !room.Welcome {
  5823. newsend += "Already disabled.\n"
  5824. } else {
  5825. room.Welcome = false
  5826. newsend += "welcome set disabled.\n"
  5827. }
  5828. }
  5829. }
  5830. } else if cmd == "backup on" {
  5831. rngcmd := GetComs(4, "backup")
  5832. if GetCodeprem(rngcmd, sender, to) {
  5833. if CheckExprd(client, to, sender) {
  5834. if room.Backup {
  5835. newsend += "Already enabled.\n"
  5836. } else {
  5837. room.Backup = true
  5838. newsend += "backup user set enabled.\n"
  5839. }
  5840. }
  5841. }
  5842. } else if cmd == "backup off" {
  5843. rngcmd := GetComs(4, "backup")
  5844. if GetCodeprem(rngcmd, sender, to) {
  5845. if CheckExprd(client, to, sender) {
  5846. if !room.Backup {
  5847. newsend += "Already disabled.\n"
  5848. } else {
  5849. room.Backup = false
  5850. newsend += "backup user set disabled.\n"
  5851. }
  5852. }
  5853. }
  5854. } else if cmd == "hostage on" {
  5855. rngcmd := GetComs(4, "hostage")
  5856. if GetCodeprem(rngcmd, sender, to) {
  5857. if CheckExprd(client, to, sender) {
  5858. if room.Backleave {
  5859. newsend += "Already enabled.\n"
  5860. } else {
  5861. room.Backleave = true
  5862. newsend += "hostage set enabled.\n"
  5863. }
  5864. }
  5865. }
  5866. } else if cmd == "hostage off" {
  5867. rngcmd := GetComs(4, "hostage")
  5868. if GetCodeprem(rngcmd, sender, to) {
  5869. if CheckExprd(client, to, sender) {
  5870. if !room.Backleave {
  5871. newsend += "Already disabled.\n"
  5872. } else {
  5873. room.Backleave = false
  5874. newsend += "hostage set disabled.\n"
  5875. }
  5876. }
  5877. }
  5878. } else if cmd == "allow all" {
  5879. rngcmd := GetComs(4, "allow")
  5880. if GetCodeprem(rngcmd, sender, to) {
  5881. if CheckExprd(client, to, sender) {
  5882. room.ProCancel = false
  5883. room.ProInvite = false
  5884. room.ProKick = false
  5885. room.ProQr = false
  5886. room.ProName = false
  5887. room.ProJoin = false
  5888. newsend += "Deny All protection disabled.\n"
  5889. }
  5890. }
  5891. } else if cmd == "deny all" {
  5892. rngcmd := GetComs(4, "allow")
  5893. if GetCodeprem(rngcmd, sender, to) {
  5894. if CheckExprd(client, to, sender) {
  5895. room.ProCancel = true
  5896. room.ProInvite = true
  5897. room.ProKick = true
  5898. room.ProQr = true
  5899. room.ProName = true
  5900. room.ProJoin = true
  5901. newsend += "Deny All protection enabled.\n"
  5902. }
  5903. }
  5904. } else if cmd == "protect max" || cmd == Commands.Max && Commands.Max != "" {
  5905. rngcmd := GetComs(4, "max")
  5906. if GetCodeprem(rngcmd, sender, to) {
  5907. if CheckExprd(client, to, sender) {
  5908. if room.ProName && room.ProCancel && room.ProInvite && room.ProKick && room.ProQr {
  5909. newsend += "Max protection is Already enabled.\n"
  5910. } else {
  5911. room.ProName = true
  5912. room.ProCancel = true
  5913. room.ProInvite = true
  5914. room.ProKick = true
  5915. room.ProQr = true
  5916. newsend += "Max protection is enabled.\n"
  5917. }
  5918. }
  5919. }
  5920. } else if cmd == "protect none" || cmd == Commands.None && Commands.None != "" {
  5921. rngcmd := GetComs(4, "none")
  5922. if GetCodeprem(rngcmd, sender, to) {
  5923. if CheckExprd(client, to, sender) {
  5924. if !room.ProName && !room.ProCancel && !room.ProInvite && !room.ProKick && !room.ProQr {
  5925. newsend += "Max protection is Already disabled.\n"
  5926. } else {
  5927. room.ProName = false
  5928. room.ProCancel = false
  5929. room.ProInvite = false
  5930. room.ProKick = false
  5931. room.ProQr = false
  5932. newsend += "Max protection is disabled.\n"
  5933. }
  5934. }
  5935. }
  5936. } else if cmd == "restartperm" {
  5937. Resprem()
  5938. list := PerCheckList()
  5939. newsend += list
  5940. } else if cmd == "kickall" || cmd == Commands.Kickall && Commands.Kickall != "" {
  5941. rngcmd := GetComs(3, "kickall")
  5942. if GetCodeprem(rngcmd, sender, to) {
  5943. if CheckExprd(client, to, sender) {
  5944. if room.Limit {
  5945. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  5946. return
  5947. }
  5948. _, memlist, _ := client.GetChatList(to)
  5949. exe := []*oop.Account{}
  5950. oke := []string{}
  5951. for _, mid := range memlist {
  5952. if InArray2(Squadlist, mid) {
  5953. cl := GetKorban(mid)
  5954. if cl.Limited == false {
  5955. exe = append(exe, cl)
  5956. }
  5957. oke = append(oke, mid)
  5958. }
  5959. }
  5960. max := len(exe) * 100
  5961. lkick := []string{}
  5962. for n, v := range memlist {
  5963. if MemUser(to, v) {
  5964. lkick = append(lkick, v)
  5965. }
  5966. if n > max {
  5967. break
  5968. }
  5969. }
  5970. nom := []*oop.Account{}
  5971. ilen := len(lkick)
  5972. xx := 0
  5973. for i := 0; i < ilen; i++ {
  5974. if xx < len(exe) {
  5975. nom = append(nom, exe[xx])
  5976. xx += 1
  5977. } else {
  5978. xx = 0
  5979. nom = append(nom, exe[xx])
  5980. }
  5981. }
  5982. for i := 0; i < ilen; i++ {
  5983. go func(to string, i int) {
  5984. target := lkick[i]
  5985. cl := nom[i]
  5986. cl.DeleteOtherFromChats(to, target)
  5987. }(to, i)
  5988. }
  5989. logAccess(client, to, sender, "kickall", lkick, msg.ToType)
  5990. }
  5991. }
  5992. } else if cmd == "cancelall" || cmd == Commands.Cancelall && Commands.Cancelall != "" {
  5993. rngcmd := GetComs(3, "cancelall")
  5994. if GetCodeprem(rngcmd, sender, to) {
  5995. if CheckExprd(client, to, sender) {
  5996. if room.Limit {
  5997. client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
  5998. return
  5999. }
  6000. _, memlist2, memlist := client.GetChatList(to)
  6001. exe := []*oop.Account{}
  6002. oke := []string{}
  6003. for _, mid := range memlist2 {
  6004. if InArray2(Squadlist, mid) {
  6005. cl := GetKorban(mid)
  6006. if cl.Limited == false {
  6007. exe = append(exe, cl)
  6008. }
  6009. oke = append(oke, mid)
  6010. }
  6011. }
  6012. lkick := []string{}
  6013. max := len(exe) * 10
  6014. for n, v := range memlist {
  6015. if MemUser(to, v) {
  6016. lkick = append(lkick, v)
  6017. }
  6018. if n > max {
  6019. break
  6020. }
  6021. }
  6022. nom := []*oop.Account{}
  6023. ilen := len(lkick)
  6024. xx := 0
  6025. for i := 0; i < ilen; i++ {
  6026. if xx < len(exe) {
  6027. nom = append(nom, exe[xx])
  6028. xx += 1
  6029. } else {
  6030. xx = 0
  6031. nom = append(nom, exe[xx])
  6032. }
  6033. }
  6034. for i := 0; i < ilen; i++ {
  6035. target := lkick[i]
  6036. cl := nom[i]
  6037. ants.Submit(func() { cl.CancelChatInvitations(to, target) })
  6038. }
  6039. logAccess(client, to, sender, "cancelall", lkick, msg.ToType)
  6040. }
  6041. }
  6042. } else if strings.HasPrefix(cmd, "joinqr:http://line.me") {
  6043. rngcmd := GetComs(4, "joinqr")
  6044. if GetCodeprem(rngcmd, sender, to) {
  6045. if CheckExprd(client, to, sender) {
  6046. hyu := strings.Split((text), "http://line.me")
  6047. result := strings.Split((hyu[1]), "/")
  6048. tkt := client.FindChatByTicket(result[3])
  6049. client.AcceptTicket(tkt.Chat.ChatMid, result[3])
  6050. exe := []*oop.Account{}
  6051. for _, p := range bk {
  6052. if p.Limited == false {
  6053. err := p.AcceptTicket(tkt.Chat.ChatMid, result[3])
  6054. if err == nil {
  6055. exe = append(exe, p)
  6056. }
  6057. }
  6058. }
  6059. if len(exe) != 0 {
  6060. newsend += "ᴀᴄᴄᴇᴘᴛ ɢʀᴏᴜᴘ ʟɪɴᴋ"
  6061. }
  6062. }
  6063. }
  6064. } else if strings.HasPrefix(cmd, "joinqrkick:http://line.me") {
  6065. rngcmd := GetComs(4, "joinqrkick")
  6066. if GetCodeprem(rngcmd, sender, to) {
  6067. if CheckExprd(client, to, sender) {
  6068. hyu := strings.Split((text), "http://line.me")
  6069. result := strings.Split((hyu[1]), "/")
  6070. tkt := client.FindChatByTicket(result[3])
  6071. exe := []*oop.Account{}
  6072. for _, p := range bk {
  6073. if p.Limited == false {
  6074. err := p.AcceptTicket(tkt.Chat.ChatMid, result[3])
  6075. if err == nil {
  6076. exe = append(exe, p)
  6077. }
  6078. }
  6079. }
  6080. if len(exe) != 0 {
  6081. go Nukjoin(exe[0], op.CreatedTime, to)
  6082. }
  6083. }
  6084. }
  6085. } else if strings.HasPrefix(cmd, "clone") {
  6086. rngcmd := GetComs(4, "clone")
  6087. if GetCodeprem(rngcmd, sender, to) {
  6088. if CheckExprd(client, to, sender) {
  6089. if len(mentionlist) == 1 {
  6090. cok := strings.Split((cmd), " ")
  6091. if len(cok) > 1 {
  6092. targets := ""
  6093. var pp, vp, co, cv, name, stats string
  6094. cok := strings.Split((cmd), " ")
  6095. if len(cok) > 1 {
  6096. ann := cok[1]
  6097. var prof *talkservice.Contact
  6098. if ann == "@me" {
  6099. prof, _ = client.GetContact(msg.From_)
  6100. targets = msg.From_
  6101. }
  6102. if prof != nil {
  6103. name = prof.DisplayName
  6104. stats = prof.StatusMessage
  6105. if prof.VideoProfile != "" {
  6106. ps, err := client.Downloads("http://dl.profile.line-cdn.net"+prof.PicturePath+"/vp", "mp4")
  6107. if err != nil {
  6108. client.SendMessage(to, "Download video profile error.")
  6109. } else {
  6110. vp = ps
  6111. }
  6112. }
  6113. if prof.PicturePath != "" {
  6114. ps, err := client.Downloads("http://dl.profile.line.naver.jp"+prof.PicturePath, "jpg")
  6115. if err != nil {
  6116. client.SendMessage(to, "Download picture profile error.")
  6117. } else {
  6118. pp = ps
  6119. }
  6120. }
  6121. profs := client.GetProfileDetail(msg.From_)
  6122. pss, err := client.Downloads("https://obs.line-scdn.net/r/myhome/c/"+gjson.Get(profs, "result.objectId").String(), "jpg")
  6123. if err == nil {
  6124. co = pss
  6125. }
  6126. pss, err = client.Downloads("https://obs.line-scdn.net/r/myhome/vc/"+gjson.Get(profs, "result.objectId").String(), "mp4")
  6127. if err == nil {
  6128. cv = pss
  6129. }
  6130. if len(mentionlist) != 0 {
  6131. clon := false
  6132. for _, target := range mentionlist {
  6133. if target != targets && InArray2(Squadlist, target) {
  6134. idx := GetKorban(target)
  6135. clone(idx, pp, vp, co, cv, name, stats)
  6136. idx.SendMention(to, "Cloning @! profile done.", []string{targets})
  6137. clon = true
  6138. }
  6139. }
  6140. if !clon {
  6141. if pp != "" {
  6142. os.Remove(pp)
  6143. }
  6144. if vp != "" {
  6145. os.Remove(vp)
  6146. }
  6147. if co != "" {
  6148. os.Remove(co)
  6149. }
  6150. if cv != "" {
  6151. os.Remove(cv)
  6152. }
  6153. }
  6154. } else {
  6155. if pp != "" {
  6156. os.Remove(pp)
  6157. }
  6158. if vp != "" {
  6159. os.Remove(vp)
  6160. }
  6161. if co != "" {
  6162. os.Remove(co)
  6163. }
  6164. if cv != "" {
  6165. os.Remove(cv)
  6166. }
  6167. }
  6168. }
  6169. }
  6170. }
  6171. }
  6172. }
  6173. }
  6174. }
  6175. }
  6176. if newsend != "" {
  6177. client.SendMessage(to, newsend)
  6178. }
  6179. }
  6180. }