1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199 |
- package main
- import (
- "encoding/json"
- "fmt"
- "os"
- "os/exec"
- "regexp"
- "sort"
- "strconv"
- "strings"
- "sync"
- "time"
- "unicode/utf8"
- "github.com/bashery/botline/oop"
- talkservice "github.com/bashery/linethrift"
- "github.com/panjf2000/ants"
- "github.com/shirou/gopsutil/mem"
- "github.com/tidwall/gjson"
- )
- func Bot(op *talkservice.Operation, client *oop.Account, ch chan int) {
- defer panicHandle("Bot")
- msg := op.Message
- if msg.ToType != 2 {
- return
- }
- if _, ok := Commandss.Get(op.CreatedTime); ok {
- return
- } else {
- Commandss.Set(op.CreatedTime, client)
- }
- if time.Now().Sub(timeabort) >= 60*time.Second {
- abort()
- }
- Rname := MsRname
- Sname := MsSname
- sender := op.Message.From_
- text := op.Message.Text
- receiver := op.Message.To
- var pesan = strings.ToLower(text)
- var to string
- mentions := mentions{}
- if op.Message.ToType == 0 {
- to = sender
- } else {
- to = receiver
- }
- if len(Sinderremote) != 0 {
- if InArray2(Sinderremote, sender) {
- if remotegrupid != "" {
- remotegrupidto = to
- to = remotegrupid
- }
- }
- }
- mentionlist := []string{}
- json.Unmarshal([]byte(op.Message.ContentMetadata["MENTION"]), &mentions)
- for _, mention := range mentions.MENTIONEES {
- if !InArray2(mentionlist, mention.Mid) {
- mentionlist = append(mentionlist, mention.Mid)
- }
- }
- var Rplay = ""
- var room *oop.LineRoom
- var bks = []*oop.Account{}
- room = oop.GetRoom(to)
- bks = room.Client
- if len(bks) == 0 {
- GetSquad(client, to)
- room = oop.GetRoom(to)
- bks = room.Client
- }
- sort.Slice(room.Ava, func(i, j int) bool {
- return room.Ava[i].Client.KickPoint < room.Ava[j].Client.KickPoint
- })
- bk := []*oop.Account{}
- bk2 := []*oop.Account{}
- for _, n := range bks {
- bk = append(bk, n)
- if !n.Limited {
- bk2 = append(bk2, n)
- }
- }
- clen := len(bk2)
- if clen != 0 {
- client = bk2[0]
- room.Exe = bk2[0]
- room.Limit = false
- } else {
- room.Limit = true
- }
- if room.AntiTag && MemUser(to, msg.From_) && len(mentionlist) != 0 && !room.Automute {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot Can't kick in AntiTag")
- return
- }
- if client.Limited == false {
- client.DeleteOtherFromChats(to, msg.From_)
- } else {
- for _, bot := range bk {
- if bot.Limited == false {
- bot.DeleteOtherFromChats(to, msg.From_)
- break
- }
- }
- }
- }
- if op.Message.RelatedMessageId != "" && len(mentionlist) == 0 {
- asu, _ := client.GetRecentMessagesV2(op.Message.To)
- for _, xx := range asu {
- if xx.ID == op.Message.RelatedMessageId {
- Rplay = xx.From_
- break
- }
- }
- }
- if ChangPict && !AllCheng && !StartChangeImg {
- if len(mentionlist) != 0 {
- changepic = []*oop.Account{}
- for _, ym := range mentionlist {
- if InArray2(Squadlist, ym) {
- cl := GetKorban(ym)
- if !oop.Checkarri(changepic, cl) {
- changepic = append(changepic, cl)
- }
- }
- }
- if len(changepic) != 0 {
- client.SendMessage(to, "Send your image.")
- StartChangeImg = true
- }
- timeabort = time.Now()
- }
- } else if ChangCover && !AllCheng && !StartChangeImg {
- if len(mentionlist) != 0 {
- changepic = []*oop.Account{}
- for _, ym := range mentionlist {
- if InArray2(Squadlist, ym) {
- cl := GetKorban(ym)
- if !oop.Checkarri(changepic, cl) {
- changepic = append(changepic, cl)
- }
- }
- }
- if len(changepic) != 0 {
- client.SendMessage(to, "Send your image.")
- StartChangeImg = true
- }
- timeabort = time.Now()
- }
- } else if ChangVpict && !AllCheng && !StartChangeImg {
- if len(mentionlist) != 0 {
- changepic = []*oop.Account{}
- for _, ym := range mentionlist {
- if InArray2(Squadlist, ym) {
- cl := GetKorban(ym)
- if !oop.Checkarri(changepic, cl) {
- changepic = append(changepic, cl)
- }
- }
- }
- if len(changepic) != 0 {
- client.SendMessage(to, "Send your video.")
- StartChangevImg = true
- }
- timeabort = time.Now()
- }
- } else if ChangVcover && !AllCheng && !StartChangeImg {
- if len(mentionlist) != 0 {
- changepic = []*oop.Account{}
- for _, ym := range mentionlist {
- if InArray2(Squadlist, ym) {
- cl := GetKorban(ym)
- if !oop.Checkarri(changepic, cl) {
- changepic = append(changepic, cl)
- }
- }
- }
- if len(changepic) != 0 {
- client.SendMessage(to, "Send your video.")
- StartChangevImg = true
- }
- timeabort = time.Now()
- }
- } else if ChangName {
- if len(mentionlist) != 0 {
- changepic = []*oop.Account{}
- for _, ym := range mentionlist {
- if InArray2(Squadlist, ym) {
- cl := GetKorban(ym)
- if !oop.Checkarri(changepic, cl) {
- changepic = append(changepic, cl)
- }
- }
- }
- if len(changepic) != 0 {
- if MsgName != "" {
- for i := range changepic {
- if TimeDown(i) {
- star := MsgName
- changepic[i].UpdateProfileName(star)
- changepic[i].SendMessage(to, "Profile name updated.")
- }
- }
- } else {
- client.SendMessage(to, "Add name first.")
- }
- ChangName = false
- MsgName = ""
- }
- timeabort = time.Now()
- }
- } else if ChangeBio {
- if len(mentionlist) != 0 {
- changepic = []*oop.Account{}
- for _, ym := range mentionlist {
- if InArray2(Squadlist, ym) {
- cl := GetKorban(ym)
- if !oop.Checkarri(changepic, cl) {
- changepic = append(changepic, cl)
- }
- }
- }
- if len(changepic) != 0 {
- if MsgBio != "" {
- for i := range changepic {
- if TimeDown(i) {
- star := MsgBio
- changepic[i].UpdateProfileBio(star)
- changepic[i].SendMessage(to, "Profile status updated.")
- }
- }
- } else {
- client.SendMessage(to, "Add Bio first.")
- }
- ChangeBio = false
- MsgBio = ""
- }
- timeabort = time.Now()
- }
- }
- if op.Message.ContentType == 1 {
- if StartChangeImg && len(changepic) != 0 {
- if !MemUser(to, sender) {
- if ChangPict {
- path, err := client.DownloadObjectMsg(msg.ID)
- if path != "" {
- var wg sync.WaitGroup
- wg.Add(len(changepic))
- for n, p := range changepic {
- if TimeDown(n) {
- go func(p *oop.Account) {
- if StartChangevImg2 {
- err := p.UpdatePictureProfile(path, "v")
- if err != nil {
- fmt.Println(err)
- p.SendMessage(to, "Update dual profile failure.")
- } else {
- p.SendMessage(to, "Update video picture done.")
- }
- } else {
- err := p.UpdatePictureProfile(path, "p")
- if err != nil {
- fmt.Println(err)
- p.SendMessage(to, "Update picture profile failure.")
- } else {
- p.SendMessage(to, "Update Image picture done.")
- }
- }
- wg.Done()
- }(p)
- }
- }
- wg.Wait()
- os.Remove(path)
- } else {
- fmt.Println(err)
- if StartChangevImg2 {
- client.SendMessage(to, "Download video picture Failure.")
- } else {
- client.SendMessage(to, "Download Image picture Failure.")
- }
- }
- StartChangevImg2 = false
- StartChangeImg = false
- ChangPict = false
- } else if ChangCover {
- path, err := client.DownloadObjectMsg(msg.ID)
- if path != "" {
- var wg sync.WaitGroup
- wg.Add(len(changepic))
- for n, p := range changepic {
- if TimeDown(n) {
- go func(p *oop.Account) {
- if StartChangevImg2 {
- err := p.UpdateCoverWithVideo(path)
- if err != nil {
- fmt.Println(err)
- p.SendMessage(to, "Update video cover failure.")
- } else {
- p.SendMessage(to, "Update video cover done.")
- time.Sleep(2 * time.Second)
- }
- } else {
- err := p.UpdateCover(path)
- if err != nil {
- fmt.Println(err)
- p.SendMessage(to, "Update picture cover failure.")
- } else {
- p.SendMessage(to, "Update Image cover done.")
- time.Sleep(2 * time.Second)
- }
- }
- wg.Done()
- }(p)
- }
- }
- wg.Wait()
- os.Remove(path)
- } else {
- fmt.Println(err)
- if StartChangevImg2 {
- client.SendMessage(to, "Download video cover Failure.")
- } else {
- client.SendMessage(to, "Download Image cover Failure.")
- }
- }
- StartChangevImg2 = false
- StartChangeImg = false
- ChangCover = false
- }
- timeabort = time.Now()
- }
- }
- } else if op.Message.ContentType == 2 {
- if StartChangevImg && len(changepic) != 0 {
- if !MemUser(to, sender) {
- if ChangVpict {
- path, err := client.DownloadObjectMsg(msg.ID)
- if path != "" {
- var wg sync.WaitGroup
- wg.Add(len(changepic))
- for _, p := range changepic {
- go func(p *oop.Account) {
- err := p.UpdateVideoProfile(path)
- if err != nil {
- fmt.Println(err)
- p.SendMessage(to, "Update video profile failure.")
- }
- wg.Done()
- }(p)
- }
- wg.Wait()
- client.SendMessage(to, "Upload video done, now send your image.")
- os.Remove(path)
- StartChangevImg2 = true
- ChangPict = true
- StartChangeImg = true
- ChangVpict = false
- StartChangevImg = false
- } else {
- fmt.Println(err)
- client.SendMessage(to, "Download Image Failure.")
- }
- } else if ChangVcover {
- path, err := client.DownloadObjectMsg(msg.ID)
- if path != "" {
- var wg sync.WaitGroup
- wg.Add(len(changepic))
- for _, p := range changepic {
- go func(p *oop.Account) {
- p.UpdateCoverVideo(path)
- wg.Done()
- }(p)
- }
- wg.Wait()
- client.SendMessage(to, "Upload video done, now send your image.")
- os.Remove(path)
- StartChangevImg2 = true
- StartChangeImg = true
- ChangCover = true
- StartChangevImg = false
- ChangVcover = false
- } else {
- fmt.Println(err)
- client.SendMessage(to, "Download Image Failure.")
- }
- }
- timeabort = time.Now()
- }
- }
- } else if msg.ContentType == 0 && msg.Text != "" {
- if room.Automute && MemUser(to, msg.From_) {
- if client.Limited == false {
- client.DeleteOtherFromChats(to, msg.From_)
- } else {
- for _, bot := range bk {
- if bot.Limited == false {
- bot.DeleteOtherFromChats(to, msg.From_)
- break
- }
- }
- }
- } else {
- if MemBan2(to, msg.From_) && MemUser(to, msg.From_) {
- if client.Limited == false {
- client.DeleteOtherFromChats(to, msg.From_)
- } else {
- for _, bot := range bk {
- if bot.Limited == false {
- bot.DeleteOtherFromChats(to, msg.From_)
- break
- }
- }
- }
- }
- }
- cmds := gettxt(sender, client, pesan, Rname, Sname, client.MID, mentionlist, to)
- text := op.Message.Text
- newsend := ""
- var pesan = strings.ToLower(text)
- for _, cmd := range strings.Split(cmds, ",") {
- if strings.HasPrefix(cmd, "creator") && cmd != "creators" {
- if GetCodeprem(0, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 13
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if cmd == "creators" {
- rngcmd := GetComs(1, "creators")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Creator) != 0 {
- list := " ✠ 𝗖𝗿𝗲𝗮𝘁𝗼𝗿𝘀 ✠ \n"
- for num, xd := range UserBot.Creator {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- } else {
- newsend += "Creator list is empty.\n"
- }
- }
- }
- } else if cmd == "clearcreator" {
- if GetCodeprem(0, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Creator) != 0 {
- newsend += fmt.Sprintf("Cleared %v Creatorlist\n", len(UserBot.Creator))
- UserBot.ClearCreator()
- } else {
- newsend += "Creator list is empty.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "uncreator") {
- if GetCodeprem(0, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 9
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistexpel(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "uncreator"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, UserBot.Creator)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- Checklistexpel(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "seller") && cmd != "sellers" {
- if GetCodeprem(1, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 17
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if cmd == "sellers" {
- if GetCodeprem(2, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Seller) != 0 {
- list := " ✠ 𝗦𝗲𝗹𝗹𝗲𝗿𝘀 ✠ \n"
- for num, xd := range UserBot.Seller {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- } else {
- newsend += "Seller list is empty.\n"
- }
- }
- }
- } else if cmd == "clearseller" {
- if GetCodeprem(1, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Seller) != 0 {
- newsend += fmt.Sprintf("Cleared %v sellerlist\n", len(UserBot.Seller))
- UserBot.ClearSeller()
- } else {
- newsend += "Seller list is empty.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "unseller") {
- if GetCodeprem(1, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 17
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistexpel(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "unseller"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, UserBot.Seller)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- Checklistexpel(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if cmd == "listcmd" {
- rngcmd := GetComs(4, "listcmd")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- list := Cmdlistcheck()
- client.SendMessage(to, list)
- }
- }
- } else if strings.HasPrefix(cmd, "expel") {
- if GetCodeprem(7, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 8
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistexpel(client, to, listuser, x, sender)
- }
- }
- }
- } else if cmd == "access" || cmd == Commands.Access && Commands.Access != "" {
- rngcmd := GetComs(4, "access")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- allmanagers := []string{}
- listadm := "✠ 𝗔𝗰𝗰𝗲𝘀𝘀 𝗹𝗶𝘀𝘁 ✠"
- if len(UserBot.Owner) != 0 {
- listadm += "\n\n 👑 𝗼𝘄𝗻𝗲𝗿𝘀 👑"
- for num, xd := range UserBot.Owner {
- num++
- rengs := strconv.Itoa(num)
- allmanagers = append(allmanagers, xd)
- new := client.Getcontactuser(xd)
- if new != nil {
- listadm += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- listadm += "\n " + rengs + ". " + x.DisplayName
- }
- }
- }
- if len(UserBot.Master) != 0 {
- listadm += "\n\n 🎩 𝗺𝗮𝘀𝘁𝗲𝗿𝘀 🎩"
- for num, xd := range UserBot.Master {
- num++
- rengs := strconv.Itoa(num)
- allmanagers = append(allmanagers, xd)
- new := client.Getcontactuser(xd)
- if new != nil {
- listadm += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- listadm += "\n " + rengs + ". " + x.DisplayName
- }
- }
- }
- if len(UserBot.Admin) != 0 {
- listadm += "\n\n 🎓 𝗮𝗱𝗺𝗶𝗻𝘀 🎓"
- for num, xd := range UserBot.Admin {
- num++
- rengs := strconv.Itoa(num)
- allmanagers = append(allmanagers, xd)
- new := client.Getcontactuser(xd)
- if new != nil {
- listadm += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- listadm += "\n " + rengs + ". " + x.DisplayName
- }
- }
- }
- if len(allmanagers) != 0 {
- newsend += listadm + "\n"
- } else {
- newsend += "𝗔ccess is empty.\n"
- }
- }
- }
- } else if cmd == "allbanlist" || cmd == Commands.Allbanlist && Commands.Allbanlist != "" {
- rngcmd := GetComs(4, "allbanlist")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listadm := AllBanList(client)
- if listadm != "✠ 𝗔𝗹𝗹 𝗯𝗮𝗻𝗹𝗶𝘀𝘁𝘀 ✠" {
- newsend += listadm + "\n"
- } else {
- newsend += "𝗔ccess is empty.\n"
- }
- }
- }
- } else if cmd == "gaccess" || cmd == Commands.Gaccess && Commands.Gaccess != "" {
- rngcmd := GetComs(7, "gaccess")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- allmanagers := []string{}
- listadm := "✠ 𝗚𝗮𝗰𝗰𝗲𝘀𝘀 𝗹𝗶𝘀𝘁 ✠"
- if len(room.Gowner) != 0 {
- listadm += "\n\n👑 𝗴𝗼𝘄𝗻𝗲𝗿𝘀 👑"
- for num, xd := range room.Gowner {
- num++
- rengs := strconv.Itoa(num)
- allmanagers = append(allmanagers, xd)
- new := client.Getcontactuser(xd)
- if new != nil {
- listadm += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- listadm += "\n " + rengs + ". " + x.DisplayName
- }
- }
- }
- if len(room.Gadmin) != 0 {
- listadm += "\n\n 🎓 𝗴𝗮𝗱𝗺𝗶𝗻𝘀 🎓"
- for num, xd := range room.Gadmin {
- num++
- rengs := strconv.Itoa(num)
- allmanagers = append(allmanagers, xd)
- new := client.Getcontactuser(xd)
- if new != nil {
- listadm += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- listadm += "\n " + rengs + ". " + x.DisplayName
- }
- }
- }
- if len(allmanagers) != 0 {
- newsend += listadm + "\n"
- } else {
- newsend += "Gaccess is empty.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "buyer") && cmd != "buyers" {
- if GetCodeprem(2, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 1
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "setdate ") {
- if GetCodeprem(1, sender, to) {
- if CheckExprd(client, to, sender) {
- ha := strings.Split((cmd), "setdate ")
- haj := ha[1]
- haj = StripOut(haj)
- has := strings.Split(haj, "-")
- if len(has) == 3 {
- yy, _ := strconv.Atoi(has[0])
- mm, _ := strconv.Atoi(has[1])
- dd, _ := strconv.Atoi(has[2])
- var time2 = time.Date(yy, time.Month(mm), dd, 00, 00, 0, 0, time.UTC)
- times := time2.Format(time.RFC3339)
- Data.Dalltime = times
- str := fmt.Sprintf("⚙️ Date:\n %v-%v-%v", yy, mm, dd)
- ta := time2.Sub(time.Now())
- str += fmt.Sprintf("\n⚙️ Remaining:\n %v", botDuration(ta))
- newsend += str + "\n"
- }
- }
- }
- } else if cmd == "addweek" {
- if GetCodeprem(1, sender, to) {
- if CheckExprd(client, to, sender) {
- d := fmt.Sprintf("%v", Data.Dalltime)
- has := strings.Split(d, "-")
- has2 := strings.Split(has[2], "T")
- yy, _ := strconv.Atoi(has[0])
- mm, _ := strconv.Atoi(has[1])
- timeup, _ := strconv.Atoi(has2[0])
- batas := time.Date(yy, time.Month(mm), timeup, 00, 00, 0, 0, time.UTC)
- mont := 24 * time.Hour
- mont = 7 * mont
- t := batas.Add(mont)
- Data.Dalltime = t.Format(time.RFC3339)
- ta := t.Sub(time.Now())
- str := fmt.Sprintf("⚙️ Remaining:\n\n %v", botDuration(ta))
- newsend += str + "\n"
- }
- }
- } else if cmd == "addday" {
- if GetCodeprem(1, sender, to) {
- if CheckExprd(client, to, sender) {
- d := fmt.Sprintf("%v", Data.Dalltime)
- has := strings.Split(d, "-")
- has2 := strings.Split(has[2], "T")
- yy, _ := strconv.Atoi(has[0])
- mm, _ := strconv.Atoi(has[1])
- timeup, _ := strconv.Atoi(has2[0])
- batas := time.Date(yy, time.Month(mm), timeup, 00, 00, 0, 0, time.UTC)
- mont := 24 * time.Hour
- t := batas.Add(mont)
- Data.Dalltime = t.Format(time.RFC3339)
- ta := t.Sub(time.Now())
- str := fmt.Sprintf("⚙️ Remaining:\n\n %v", botDuration(ta))
- newsend += str + "\n"
- }
- }
- } else if cmd == "addmonth" {
- if GetCodeprem(1, sender, to) {
- if CheckExprd(client, to, sender) {
- d := fmt.Sprintf("%v", Data.Dalltime)
- has := strings.Split(d, "-")
- has2 := strings.Split(has[2], "T")
- yy, _ := strconv.Atoi(has[0])
- mm, _ := strconv.Atoi(has[1])
- timeup, _ := strconv.Atoi(has2[0])
- batas := time.Date(yy, time.Month(mm), timeup, 00, 00, 0, 0, time.UTC)
- mont := 24 * time.Hour
- mont = 30 * mont
- t := batas.Add(mont)
- Data.Dalltime = t.Format(time.RFC3339)
- ta := t.Sub(time.Now())
- str := fmt.Sprintf("⚙️ Remaining:\n\n %v", botDuration(ta))
- newsend += str + "\n"
- }
- }
- } else if cmd == "reboot" {
- if GetCodeprem(1, sender, to) {
- if CheckExprd(client, to, sender) {
- SaveBackup()
- client.SendMessage(to, "Waiting Rebooting...")
- ReloginProgram()
- }
- }
- } else if strings.HasPrefix(cmd, "unbuyer") {
- if GetCodeprem(2, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 1
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistexpel(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "unbuyer"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, UserBot.Buyer)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- Checklistexpel(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if cmd == "checkram" || cmd == Commands.Checkram && Commands.Checkram != "" {
- if GetCodeprem(0, sender, to) {
- if CheckExprd(client, to, sender) {
- v, _ := mem.VirtualMemory()
- 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)
- newsend += r + "\n"
- }
- }
- } else if cmd == "clearbuyer" {
- if GetCodeprem(2, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Buyer) != 0 {
- newsend += fmt.Sprintf("Cleared %v buyerlist\n", len(UserBot.Buyer))
- UserBot.ClearBuyer()
- } else {
- newsend += "Buyer list is empty.\n"
- }
- }
- }
- } else if cmd == "upimage" || cmd == Commands.Upimage && Commands.Upimage != "" {
- rngcmd := GetComs(3, "upimage")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- ChangPict = true
- newsend += "Which bot's you want to update Pict.\n"
- }
- }
- } else if cmd == "upcover" || cmd == Commands.Upcover && Commands.Upcover != "" {
- rngcmd := GetComs(3, "upcover")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- ChangCover = true
- newsend += "Which bot's you want to update Cover ?.\n"
- }
- }
- } else if cmd == "upvimage" || cmd == Commands.Upvimage && Commands.Upvimage != "" {
- rngcmd := GetComs(3, "upvimage")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- ChangVpict = true
- newsend += "Which bot's you want to update Pict ?.\n"
- }
- }
- } else if cmd == "upvcover" || cmd == Commands.Upvcover && Commands.Upvcover != "" {
- rngcmd := GetComs(3, "upvcover")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- ChangVcover = true
- newsend += "Which bot's you want to update Cover ?.\n"
- }
- }
- } else if strings.HasPrefix(cmd, "unsend ") {
- rngcmd := GetComs(4, "unsend")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- if result[1] != "0" {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- Nganu, _ := client.GetRecentMessagesV2(op.Message.To)
- Mid := []string{}
- unsed := []string{}
- for _, chat := range Nganu {
- if InArray2(Squadlist, chat.From_) {
- Mid = append(Mid, chat.ID)
- }
- }
- for i := 0; i < len(Mid); i++ {
- if i < result2 {
- unsed = append(unsed, Mid[i])
- }
- }
- if len(unsed) != 0 {
- exess, _ := SelectallBot(client, to)
- if exess != nil {
- for i := range exess {
- Nganu2, _ := exess[i].GetRecentMessagesV2(op.Message.To)
- for _, chat := range Nganu2 {
- if chat.From_ == exess[i].MID {
- if InArray2(unsed, chat.ID) {
- exess[i].UnsendChatnume(to, chat.ID)
- }
- }
- }
- }
- }
- }
- } else {
- client.SendMessage(to, "out of range.")
- }
- }
- } else {
- client.SendMessage(to, "Msg not fund number")
- }
- }
- }
- } else if cmd == "purgeall" || cmd == Commands.Purgeall && Commands.Purgeall != "" {
- rngcmd := GetComs(4, "purgeall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- gr, _ := client.GetGroupIdsJoined()
- all := []string{}
- for _, aa := range gr {
- _, memlist, _ := client.GetChatList(aa)
- lkicks := []string{}
- for _, v := range memlist {
- if MemUser(aa, v) {
- lkicks = append(lkicks, v)
- }
- }
- lkick := []string{}
- for _, ban := range lkicks {
- if MemBan(aa, ban) {
- lkick = append(lkick, ban)
- all = append(all, ban)
- }
- }
- nom := []*oop.Account{}
- ilen := len(lkick)
- xx := 0
- exe := []*oop.Account{}
- for _, c := range oop.GetRoom(aa).Client {
- if !c.Limited {
- exe = append(exe, c)
- }
- }
- if len(exe) != 0 {
- for i := 0; i < ilen; i++ {
- if xx < len(exe) {
- nom = append(nom, exe[xx])
- xx += 1
- } else {
- xx = 0
- nom = append(nom, exe[xx])
- }
- }
- for i := 0; i < ilen; i++ {
- target := lkick[i]
- cl := nom[i]
- go cl.DeleteOtherFromChats(aa, target)
- }
- time.Sleep(1 * time.Second)
- }
- }
- newsend += fmt.Sprintf("Success purgeall %v user in blacklist", len(all))
- logAccess(client, to, sender, "purgeall", all, msg.ToType)
- }
- }
- } else if strings.HasPrefix(cmd, "gleave") {
- rngcmd := GetComs(4, "gleave")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "gleave"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, tempgroup)
- if len(hapuss) == 0 {
- client.SendMessage(to, "Please input the right number\nSee group number with command groups")
- return
- }
- names := []string{}
- for _, gid := range hapuss {
- name, mem := client.GetGroupInvitation(gid)
- names = append(names, name)
- anu := []string{}
- for m := range mem {
- if InArray2(Squadlist, m) {
- anu = append(anu, m)
- }
- }
- if len(anu) != 0 {
- for _, mid := range anu {
- cl := GetKorban(mid)
- cl.AcceptGroupInvitationNormal(gid)
- oop.GetRoom(gid).ConvertGo(cl)
- }
- }
- GetSquad(client, gid)
- room := oop.GetRoom(gid)
- bk = room.Client
- for _, cl := range bk {
- go cl.LeaveGroup(gid)
- }
- if LogGroup == gid {
- LogMode = false
- LogGroup = ""
- }
- oop.SquadRoom = oop.RemoveRoom(oop.SquadRoom, room)
- }
- strs := strings.Join(names, ", ")
- client.SendMessage(to, "Bot's leave from group: \n\n"+strs)
- }
- }
- } else {
- newsend += "Group not found"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "invme ") {
- rngcmd := GetComs(4, "invme")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- if len(tempgroup) == 0 {
- client.SendMessage(to, "Please input the right number\nSee group number with command groups")
- return
- }
- nim, _ := strconv.Atoi(result[1])
- nim = nim - 1
- if result2 > 0 && result2 < len(tempgroup)+1 {
- gid := tempgroup[nim]
- GetSquad(client, gid)
- room := oop.GetRoom(gid)
- bk := room.Client
- name, mem, inv := client.GetChatList(gid)
- if InArray2(mem, msg.From_) {
- client.SendMessage(to, "You was on group "+name)
- return
- } else {
- if InArray2(inv, msg.From_) {
- bk[0].CancelChatInvitations(gid, msg.From_)
- }
- for _, cl := range bk {
- if !cl.Limited && !cl.Limitadd {
- AddContact2(cl, msg.From_)
- fl, _ := cl.GetAllContactIds()
- if InArray2(fl, msg.From_) {
- err := cl.InviteIntoGroupNormal(gid, []string{msg.From_})
- if err != nil {
- code := oop.GetCode(err)
- if code != 35 && code != 10 {
- client.SendMessage(to, "You has invited to group "+name)
- return
- }
- } else {
- client.SendMessage(to, "You has invited to group "+name)
- return
- }
- }
- }
- }
- newsend += "Sorry, all bot has invite banned"
- }
- } else {
- newsend += "out of range."
- }
- }
- }
- } else {
- newsend += "Group not found"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "decline ") {
- rngcmd := GetComs(1, "decline")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- if result[1] != "0" {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- num, _ := strconv.Atoi(result[1])
- gr := []string{}
- for i := range ClientBot {
- grs, _ := ClientBot[i].GetGroupsInvited()
- if len(grs) != 0 {
- for _, a := range grs {
- if !InArray2(gr, a) {
- gr = append(gr, a)
- }
- }
- }
- }
- grup, _ := client.GetGroups(gr)
- tempgroup := []string{}
- for _, gi := range grup {
- if !InArray2(tempgroup, gi.ChatMid) {
- tempgroup = append(tempgroup, gi.ChatMid)
- }
- }
- if num > 0 && num <= len(tempgroup) {
- exe := []*oop.Account{}
- gen := tempgroup[num-1]
- names, _, _ := client.GetChatList(tempgroup[num-1])
- for i := range ClientBot {
- if ClientMid[ClientBot[i].MID].Limited == false {
- grs, _ := ClientBot[i].GetGroupsInvited()
- if InArray2(grs, gen) {
- exe = append(exe, ClientBot[i])
- }
- }
- }
- if len(exe) != 0 {
- for i := range exe {
- exe[i].RejectChatInvitation(gen)
- }
- newsend += fmt.Sprintf("Successfully declined invitation for: %v\n", names)
- }
- } else {
- newsend += "out of range pendinglist.\n"
- }
- }
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "accept") && cmd != "acceptall" {
- rngcmd := GetComs(4, "accept")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- if result[1] != "0" {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "accept"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, tempginv)
- if len(hapuss) == 0 {
- newsend += "Please input the right number\nSee group number with command groups"
- } else {
- names := []string{}
- for _, gid := range hapuss {
- name, mem := client.GetGroupInvitation(gid)
- names = append(names, name)
- anu := []string{}
- for m := range mem {
- if InArray2(Squadlist, m) {
- anu = append(anu, m)
- }
- }
- if len(anu) != 0 {
- for _, mid := range anu {
- cl := GetKorban(mid)
- cl.AcceptGroupInvitationNormal(gid)
- oop.GetRoom(gid).ConvertGo(cl)
- }
- }
- }
- str := strings.Join(names, ", ")
- newsend += "Bot's join to group \n\n" + str
- }
- }
- }
- }
- }
- }
- } else if cmd == "abort" {
- rngcmd := GetComs(4, "abort")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if remotegrupidto != "" {
- client.SendMessage(remotegrupidto, "Done Have abort.")
- } else {
- newsend += "Done Have abort." + "\n"
- }
- abort()
- }
- }
- } else if cmd == "declineall" {
- rngcmd := GetComs(1, "declineall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- tempgroup := []string{}
- for i := range ClientBot {
- grs, _ := ClientBot[i].GetGroupsInvited()
- if len(grs) != 0 {
- grup, _ := client.GetGroups(grs)
- for _, gi := range grup {
- if !InArray2(tempgroup, gi.ChatMid) {
- tempgroup = append(tempgroup, gi.ChatMid)
- }
- ClientBot[i].RejectChatInvitation(gi.ChatMid)
- }
- time.Sleep(1 * time.Second)
- }
- }
- if len(tempgroup) != 0 {
- newsend += fmt.Sprintf("Successfully declined invitations: (%v)\n", len(tempgroup))
- } else {
- newsend += "pending list is empty.\n"
- }
- }
- }
- } else if cmd == "acceptall" {
- rngcmd := GetComs(3, "acceptall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- tempgroup := []string{}
- for i := range ClientBot {
- grs, _ := ClientBot[i].GetGroupsInvited()
- if len(grs) != 0 {
- grup, _ := client.GetGroups(grs)
- for _, gi := range grup {
- if !InArray2(tempgroup, gi.ChatMid) {
- tempgroup = append(tempgroup, gi.ChatMid)
- }
- ClientBot[i].AcceptGroupInvitationNormal(gi.ChatMid)
- oop.GetRoom(gi.ChatMid).ConvertGo(ClientBot[i])
- time.Sleep(1 * time.Second)
- }
- }
- }
- if len(tempgroup) != 0 {
- newsend += fmt.Sprintf("Success accept bot %v Group\n", len(tempgroup))
- } else {
- newsend += "pending list is empty.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "upstatus") {
- rngcmd := GetComs(3, "upstatus")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- var str string
- var su = "upstatus"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- MsgBio = str
- ChangeBio = true
- timeabort = time.Now()
- newsend += fmt.Sprintf("Which bot's should be Status %v", str)
- }
- }
- } else if strings.HasPrefix(cmd, "upname") {
- rngcmd := GetComs(3, "upname")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- var str string
- var su = "upname"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- aa := utf8.RuneCountInString(str)
- if aa != 0 && aa <= 20 {
- MsgName = str
- ChangName = true
- timeabort = time.Now()
- newsend += fmt.Sprintf("Which bot's should be Name %v", str)
- }
- }
- }
- } else if cmd == "buyers" {
- rngcmd := GetComs(3, "buyers")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Buyer) != 0 {
- list := " ✠ 𝗯𝘂𝘆𝗲𝗿𝘀 ✠ \n"
- for num, xd := range UserBot.Buyer {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- } else {
- newsend += "Buyer list is empty.\n"
- }
- }
- }
- } else if cmd == "history" {
- rngcmd := GetComs(4, "history")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- countK := 0
- countinv := 0
- countcancel := 0
- for i := range ClientBot {
- countK = countK + ClientBot[i].Ckick
- countinv = countinv + ClientBot[i].Cinvite
- countcancel = countcancel + ClientBot[i].Ccancel
- }
- list := fmt.Sprintf("History: \n\n Kick: %v \n Cancel: %v \n Invited: %v", countK, countcancel, countinv)
- client.SendMessage(to, list)
- }
- }
- } else if cmd == "clearhide" {
- rngcmd := GetComs(4, "clearhide")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(checkHaid) != 0 {
- logAccess(client, to, sender, "clearhid", checkHaid, msg.ToType)
- newsend += fmt.Sprintf("Cleared %v Hidelist\n", len(checkHaid))
- checkHaid = []string{}
- } else {
- newsend += "Hide list is empty.\n"
- }
- }
- }
- } else if cmd == "hidelist" {
- rngcmd := GetComs(4, "hidelist")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(checkHaid) != 0 {
- list := " ✠ Hide List ✠ \n"
- for num, xd := range checkHaid {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- } else {
- newsend += "Hide list is empty.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "unhide") || strings.HasPrefix(cmd, "delhide") {
- rngcmd := GetComs(4, "unhide")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- list := ""
- listuser := []string{}
- nCount1 := 0
- nCount := 0
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- test1 := "User removed from hidelist:\n\n"
- test2 := "User not exist in hidelist:\n\n"
- for n, xx := range listuser {
- if InArray2(checkHaid, xx) {
- checkHaid = Remove(checkHaid, xx)
- nCount1 = nCount1 + 1
- }
- rengs := strconv.Itoa(n + 1)
- new := client.Getcontactuser(xx)
- if new != nil {
- list += rengs + ". Closed Account \n"
- } else {
- x, _ := client.GetContact(xx)
- list += fmt.Sprintf("%v. %v\n", n+1, x.DisplayName)
- }
- }
- if nCount1 != 0 {
- client.SendMessage(to, test1+list)
- } else {
- client.SendMessage(to, test2+list)
- }
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "unhide"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, checkHaid)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- for _, i := range hapuss {
- if InArray2(checkHaid, i) {
- checkHaid = Remove(checkHaid, i)
- listuser = append(listuser, i)
- }
- }
- if len(listuser) != 0 {
- list += "User removed from hidelist:\n\n"
- for n, xx := range listuser {
- checkHaid = Remove(checkHaid, xx)
- rengs := strconv.Itoa(n + 1)
- new := client.Getcontactuser(xx)
- if new != nil {
- list += rengs + ". Closed Account \n"
- } else {
- x, _ := client.GetContact(xx)
- list += fmt.Sprintf("%v. %v\n", n+1, x.DisplayName)
- }
- }
- client.SendMessage(to, list)
- }
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "hide") && cmd != "hidelist" {
- rngcmd := GetComs(4, "hide")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- nCount1 := 0
- list := ""
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- test1 := "User added to hidelist:\n\n"
- test2 := "User already exist in hidelist:\n\n"
- for n, xx := range listuser {
- if !InArray2(checkHaid, xx) {
- checkHaid = append(checkHaid, xx)
- nCount1 = nCount1 + 1
- }
- rengs := strconv.Itoa(n + 1)
- new := client.Getcontactuser(xx)
- if new != nil {
- list += rengs + ". Closed Account \n"
- } else {
- x, _ := client.GetContact(xx)
- list += fmt.Sprintf("%v. %v\n", n+1, x.DisplayName)
- }
- }
- if nCount1 != 0 {
- client.SendMessage(to, test1+list)
- } else {
- client.SendMessage(to, test2+list)
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "owner") && cmd != "owners" {
- if GetCodeprem(3, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 2
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "unowner") {
- if GetCodeprem(3, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 2
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistexpel(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "unowner"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, UserBot.Owner)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- Checklistexpel(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if cmd == "clearowner" {
- if GetCodeprem(3, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Owner) != 0 {
- logAccess(client, to, sender, "clearowner", UserBot.Owner, msg.ToType)
- newsend += fmt.Sprintf("Cleared %v ownerlist\n", len(UserBot.Owner))
- UserBot.ClearOwner()
- } else {
- newsend += "Owner list is empty.\n"
- }
- }
- }
- } else if cmd == "logmode on" {
- rngcmd := GetComs(4, "logmode")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if LogGroup == to {
- LogMode = true
- newsend += "Already enabled.\n"
- } else {
- LogMode = true
- LogGroup = to
- newsend += "Logmode is enabled.\n"
- }
- }
- }
- } else if cmd == "logmode off" {
- rngcmd := GetComs(4, "logmode")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if LogGroup == to {
- LogMode = false
- LogGroup = ""
- newsend += "Logmode is disabled.\n"
- } else {
- newsend += "Already disabled.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "setsname ") {
- rngcmd := GetComs(3, "setsname")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Replace(cmd, "setsname ", "", 1)
- if result == "," || result == "" {
- MsSname = ","
- } else {
- MsSname = result
- }
- newsend += "Sname set to: " + Sname + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "setrname ") {
- rngcmd := GetComs(3, "setrname")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Replace(cmd, "setrname ", "", 1)
- if result == "," || result == "" {
- MsRname = ","
- } else {
- MsRname = result
- }
- newsend += "Succes update Rname to " + Rname + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "msgrespon") {
- rngcmd := GetComs(3, "msgrespon")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- var str string
- var su = "msgrespon"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- MsgRespon = str
- newsend += "Message respon set to: " + str + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "upgname") {
- rngcmd := GetComs(3, "upgname")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- var str string
- var su = "upgname"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- client.UpdateChatName(to, str)
- newsend += "group name has been changed to: " + str + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "setlogo") {
- rngcmd := GetComs(3, "setlogo")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- var str string
- var su = "setlogo"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- Data.Logobot = str
- newsend += "Menu logo set to: " + str + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "msgwelcome") {
- rngcmd := GetComs(3, "msgwelcome")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- var str string
- var su = "msgwelcome"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- room.WelcomeMsg = str
- newsend += "Message Welcome set to: " + str + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "msgleave") {
- rngcmd := GetComs(3, "msgleave")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- var str string
- var su = "msgleave"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- room.MsgLeave = str
- newsend += "Message Leave set to: " + str + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "msgunban ") {
- rngcmd := GetComs(3, "msgunban")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Replace(cmd, "msgunban ", "", 1)
- MsgBan = result
- newsend += "Message unban set to: " + result + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "msglurk") {
- rngcmd := GetComs(3, "msglurk")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- var str string
- var su = "msglurk"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- room.MsgLurk = str
- newsend += "Message sider set to: " + str + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "msgfresh ") {
- rngcmd := GetComs(3, "msgfresh")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Replace(cmd, "msgfresh ", "", 1)
- MsFresh = result
- newsend += "Message fresh set to: " + result + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "msglimit ") {
- rngcmd := GetComs(3, "msglimit")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Replace(cmd, "msglimit ", "", 1)
- MsLimit = result
- newsend += "Message limit set to: " + result + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "setkick ") {
- rngcmd := GetComs(3, "setkick")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- anjay := strings.Split((cmd), " ")
- num, err := strconv.Atoi(anjay[1])
- if err != nil {
- newsend += "Please use number!\n"
- } else {
- MaxKick = num
- newsend += "Limiter kick set to " + anjay[1] + "\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "setcancel ") {
- rngcmd := GetComs(3, "setcancel")
- if GetCodeprem(rngcmd, sender, to) {
- anjay := strings.Split((cmd), " ")
- num, err := strconv.Atoi(anjay[1])
- if err != nil {
- newsend += "Please use number!\n"
- } else {
- MaxCancel = num
- newsend += "Limiter cancel set to " + anjay[1] + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "setlimiter ") {
- rngcmd := GetComs(3, "setlimiter")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- no, err := strconv.Atoi(result[1])
- if err != nil {
- newsend += "Please use number!\n"
- } else {
- MaxKick = no
- MaxCancel = no
- newsend += "Limiter successs set to " + result[1] + "\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "fuck") && cmd != "fucklist" {
- rngcmd := GetComs(4, "fuck")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 9
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "mute") && cmd != "mutelist" {
- rngcmd := GetComs(4, "mute")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 11
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "whois") {
- rngcmd := GetComs(4, "whois")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 12
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "name") {
- rngcmd := GetComs(4, "name")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 16
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "mid") {
- rngcmd := GetComs(4, "mid")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 14
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "unmute") {
- rngcmd := GetComs(4, "unmute")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 4
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- checkunbanbots(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "unmute"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, Banned.Banlist)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- checkunbanbots(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if cmd == "owners" {
- if GetCodeprem(4, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Owner) != 0 {
- list := " 👑 𝗼𝘄𝗻𝗲𝗿𝘀 👑 \n"
- for num, xd := range UserBot.Owner {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- } else {
- newsend += "Owner list is empty.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "unmaster") {
- if GetCodeprem(4, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 3
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistexpel(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "unmaster"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, UserBot.Master)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- Checklistexpel(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "ungowner") {
- if GetCodeprem(4, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 6
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistexpel(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "ungowner"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, room.Gowner)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- Checklistexpel(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if cmd == "gojoin" {
- rngcmd := GetComs(4, "gojoin")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- _, mem := client.GetGroupInvitation(to)
- anu := []string{}
- for m := range mem {
- if InArray2(Squadlist, m) {
- anu = append(anu, m)
- }
- }
- if len(anu) != 0 {
- for _, mid := range anu {
- cl := GetKorban(mid)
- cl.AcceptGroupInvitationNormal(to)
- }
- }
- GetSquad(client, to)
- }
- }
- } else if strings.HasPrefix(cmd, "master") && cmd != "masters" {
- if GetCodeprem(4, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 3
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "gowner") && cmd != "gowners" {
- if GetCodeprem(6, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 6
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "setcmd ") {
- rngcmd := GetComs(4, "setcmd")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- txt := strings.ReplaceAll(cmd, "setcmd ", "")
- texts := strings.Split(txt, " ")
- if len(texts) > 1 {
- new := Upsetcmd(texts[0], texts[1])
- if new != "" {
- newsend += new
- } else {
- newsend += "Cmd not found.\n"
- }
- } else {
- newsend += "Cmd not found.\n"
- }
- }
- }
- } else if cmd == "restartcmd" {
- rngcmd := GetComs(4, "restartcmd")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- Commands.Botname = ""
- Commands.Upallimage = ""
- Commands.Upallcover = ""
- Commands.Unsend = ""
- Commands.Upvallimage = ""
- Commands.Upvallcover = ""
- Commands.Appname = ""
- Commands.Useragent = ""
- Commands.Hostname = ""
- Commands.Friends = ""
- Commands.Adds = ""
- Commands.Limits = ""
- Commands.Addallbots = ""
- Commands.Addallsquads = ""
- Commands.Leave = ""
- Commands.Respon = ""
- Commands.Ping = ""
- Commands.Count = ""
- Commands.Limitout = ""
- Commands.Access = ""
- Commands.Allbanlist = ""
- Commands.Allgaccess = ""
- Commands.Gaccess = ""
- Commands.Checkram = ""
- Commands.Backups = ""
- Commands.Upimage = ""
- Commands.Upcover = ""
- Commands.Upvimage = ""
- Commands.Upvcover = ""
- Commands.Bringall = ""
- Commands.Purgeall = ""
- Commands.Banlist = ""
- Commands.Clearban = ""
- Commands.Stayall = ""
- Commands.Clearchat = ""
- Commands.Here = ""
- Commands.Speed = ""
- Commands.Status = ""
- Commands.Tagall = ""
- Commands.Kick = ""
- Commands.Max = ""
- Commands.None = ""
- Commands.Kickall = ""
- Commands.Cancelall = ""
- newsend += "Done restart all Cmd.\n"
- }
- }
- } else if cmd == "cleargowner" {
- if GetCodeprem(6, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(room.Gowner) != 0 {
- logAccess(client, to, sender, "cleargowner", room.Gowner, msg.ToType)
- newsend += fmt.Sprintf("Cleared %v gownerlist\n", len(room.Gowner))
- room.Gowner = []string{}
- } else {
- newsend += "Gowner list is empty.\n"
- }
- }
- }
- } else if cmd == "clearmaster" {
- if GetCodeprem(4, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Master) != 0 {
- newsend += fmt.Sprintf("Cleared %v masterlist\n", len(UserBot.Master))
- logAccess(client, to, sender, "clearmaster", UserBot.Master, msg.ToType)
- UserBot.ClearMaster()
- } else {
- newsend += "Master list is empty.\n"
- }
- }
- }
- } else if cmd == "clearfuck" {
- rngcmd := GetComs(4, "clearfuck")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(Banned.Fucklist) != 0 {
- logAccess(client, to, sender, "clearfuck", Banned.Fucklist, msg.ToType)
- newsend += fmt.Sprintf("Cleared %v fucklist\n", len(Banned.Fucklist))
- Banned.Fucklist = []string{}
- } else {
- newsend += "Fuck list is empty.\n"
- }
- }
- }
- } else if cmd == "clearmute" {
- rngcmd := GetComs(4, "clearmute")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(Banned.Mutelist) != 0 {
- logAccess(client, to, sender, "clearmute", Banned.Mutelist, msg.ToType)
- newsend += fmt.Sprintf("Cleared %v fucklist\n", len(Banned.Mutelist))
- Banned.Mutelist = []string{}
- } else {
- newsend += "Mute list is empty.\n"
- }
- }
- }
- } else if cmd == "clear allprotect" {
- if GetCodeprem(3, sender, to) {
- if CheckExprd(client, to, sender) {
- oop.ClearProtect()
- newsend += "Cleared allprotected.\n"
- }
- }
- } else if strings.HasPrefix(cmd, "perm ") {
- if GetCodeprem(3, sender, to) {
- if CheckExprd(client, to, sender) {
- ditha := strings.ReplaceAll(cmd, "perm ", "")
- cmdLil := strings.Split(ditha, " ")
- Addpermcmd(client, to, cmdLil[0], cmdLil[1])
- }
- }
- } else if cmd == "permlist" {
- if GetCodeprem(3, sender, to) {
- if CheckExprd(client, to, sender) {
- list := PerCheckList()
- if list != "" {
- newsend += list
- } else {
- newsend += "Not have perm in list.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "autojoin") {
- rngcmd := GetComs(4, "autojoin")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- var str string
- var su = "autojoin"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- if str == "invite" {
- if Autojoin != "invite" {
- Autojoin = "invite"
- newsend += "Autojoin Invite enabled.\n"
- } else {
- newsend += "Autojoin Already Invite.\n"
- }
- } else if str == "qr" {
- if Autojoin != "qr" {
- Autojoin = "qr"
- newsend += "Autojoin qr enabled.\n"
- } else {
- newsend += "Autojoin Already qr.\n"
- }
- } else if str == "off" {
- if Autojoin != "off" {
- Autojoin = "off"
- newsend += fmt.Sprintf("Autojoin %s disabled.\n", Autojoin)
- } else {
- newsend += "Autojoin Already disabled.\n"
- }
- }
- }
- }
- } else if cmd == "mutelist" {
- rngcmd := GetComs(4, "mutelist")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(Banned.Mutelist) != 0 {
- list := "Mutelist:"
- client.SendPollMention(to, list, Banned.Mutelist)
- } else {
- newsend += "Mute list is empty.\n"
- }
- }
- }
- } else if cmd == "fucklist" {
- rngcmd := GetComs(4, "fucklist")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(Banned.Fucklist) != 0 {
- list := "Fucklist:"
- client.SendPollMention(to, list, Banned.Fucklist)
- } else {
- newsend += "Fuck list is empty.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "groupcast") {
- rngcmd := GetComs(4, "groupcast")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- su := "groupcast"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- if len(str) != 0 {
- gr, _ := client.GetGroupIdsJoined()
- for _, gi := range gr {
- client.SendMessage(gi, str)
- }
- newsend += "Success broadcast to " + strconv.Itoa(len(gr)) + " group\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "gourl ") {
- rngcmd := GetComs(4, "gourl")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- num, err := strconv.Atoi(result[1])
- if err != nil {
- newsend += "invalid number.\n"
- } else {
- gr := []string{}
- for i := range ClientBot {
- grs, _ := ClientBot[i].GetGroupIdsJoined()
- for _, a := range grs {
- if !InArray2(gr, a) {
- gr = append(gr, a)
- }
- }
- }
- groups, _ := client.GetGroups(gr)
- tempgroup := []string{}
- for _, gi := range groups {
- tempgroup = append(tempgroup, gi.ChatMid)
- }
- if num > 0 && num <= len(tempgroup) {
- gid := tempgroup[num-1]
- tick, err := client.ReissueChatTicket(gid)
- if err == nil {
- var err error
- mes := make(chan bool)
- go func() {
- err = client.UpdateChatQrV2(gid, false)
- if err != nil {
- mes <- false
- } else {
- mes <- true
- }
- }()
- newsend += "https://line.me/R/ti/g/" + tick + "\n"
- }
- } else {
- newsend += "out of range.\n"
- }
- }
- }
- }
- } else if cmd == "groups" {
- rngcmd := GetComs(3, "groups")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- gr := []string{}
- for _, p := range ClientBot {
- if !p.Frez {
- grs, _ := p.GetGroupIdsJoined()
- for _, a := range grs {
- if !InArray2(gr, a) {
- gr = append(gr, a)
- }
- }
- }
- }
- nm := []string{}
- grup, _ := client.GetGroups(gr)
- ci := []string{}
- for _, g := range grup {
- ci = append(ci, strings.ToLower(g.ChatName))
- }
- sort.Strings(ci)
- groups := []*talkservice.Chat{}
- tempgroup = []string{}
- for _, x := range ci {
- for _, gi := range grup {
- if strings.ToLower(gi.ChatName) == x {
- if !InArrayChat(groups, gi) {
- groups = append(groups, gi)
- tempgroup = append(tempgroup, gi.ChatMid)
- }
- }
- }
- }
- for c, a := range groups {
- name, mem := a.ChatName, a.Extra.GroupExtra.MemberMids
- c += 1
- jm := 0
- for mid := range mem {
- if InArray2(Squadlist, mid) {
- jm++
- }
- }
- name = fmt.Sprintf("%v. %s (%v/%v)", c, name, jm, len(mem))
- nm = append(nm, name)
- GetSquad(client, a.ChatMid)
- }
- stf := "All Group List:\n\n"
- str := strings.Join(nm, "\n")
- anu := []string{}
- for _, p := range ClientBot {
- if !p.Frez {
- grs, _ := p.GetGroupIdsInvited()
- for _, a := range grs {
- if !InArray2(gr, a) && !InArray2(anu, a) {
- anu = append(anu, a)
- }
- }
- }
- }
- grup, _ = client.GetGroups(anu)
- ci = []string{}
- for _, g := range grup {
- ci = append(ci, strings.ToLower(g.ChatName))
- }
- sort.Strings(ci)
- groups = []*talkservice.Chat{}
- tempginv = []string{}
- for _, x := range ci {
- for _, gi := range grup {
- if strings.ToLower(gi.ChatName) == x {
- if !InArrayChat(groups, gi) {
- groups = append(groups, gi)
- tempginv = append(tempginv, gi.ChatMid)
- }
- }
- }
- }
- nm = []string{}
- nn := 1
- for _, a := range groups {
- name, mem, inv := a.ChatName, a.Extra.GroupExtra.MemberMids, a.Extra.GroupExtra.InviteeMids
- if name != "" {
- jm := 0
- for mid := range inv {
- if InArray2(Squadlist, mid) {
- jm++
- }
- }
- if jm != 0 {
- name = fmt.Sprintf("%v. %s (invited) (%v/%v)", nn, name, jm, len(mem))
- nm = append(nm, name)
- GetSquad(client, a.ChatMid)
- nn++
- } else {
- tempginv = Remove(tempginv, a.ChatMid)
- }
- } else {
- tempginv = Remove(tempginv, a.ChatMid)
- }
- }
- var strs, strsa = "", ""
- if len(nm) != 0 {
- strs = "\n\nAll Group Invitation:\n\n"
- strsa = strings.Join(nm, "\n")
- }
- newsend += stf + str + strs + strsa
- }
- }
- } else if strings.HasPrefix(cmd, "nukejoin ") {
- rngcmd := GetComs(3, "nukejoin")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- spl := strings.Replace(cmd, "nukejoin ", "", 1)
- if spl == "on" {
- NukeJoin = true
- newsend += "Nukejoin is enabled.\n"
- } else if spl == "off" {
- NukeJoin = false
- newsend += "Nukejoin is disabled.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "canceljoin ") {
- rngcmd := GetComs(3, "canceljoin")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- spl := strings.Replace(cmd, "canceljoin ", "", 1)
- if spl == "on" {
- canceljoin = true
- newsend += "canceljoin is enabled.\n"
- } else if spl == "off" {
- canceljoin = false
- newsend += "canceljoin is disabled.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "autopro ") {
- rngcmd := GetComs(3, "autopro")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- spl := strings.Replace(cmd, "autopro ", "", 1)
- if spl == "on" {
- AutoPro = true
- newsend += "Autopro is enabled.\n"
- } else if spl == "off" {
- AutoPro = false
- newsend += "Autopro is disabled.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "autopurge ") {
- rngcmd := GetComs(3, "autopurge")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- spl := strings.Replace(cmd, "autopurge ", "", 1)
- if spl == "on" {
- AutoPurge = true
- newsend += "Autopurge is enabled.\n"
- } else if spl == "off" {
- AutoPurge = false
- newsend += "Autopurge is disabled.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "autoban ") {
- rngcmd := GetComs(3, "autoban")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- spl := strings.Replace(cmd, "autoban ", "", 1)
- if spl == "on" {
- AutoBan = true
- newsend += "Autoban is enabled.\n"
- } else if spl == "off" {
- AutoBan = false
- newsend += "Autoban is disabled.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "banpurge ") {
- rngcmd := GetComs(3, "banpurge")
- if GetCodeprem(rngcmd, sender, to) {
- spl := strings.Replace(cmd, "banpurge ", "", 1)
- if spl == "on" {
- AutokickBan = true
- newsend += "Banpurge is enabled.\n"
- } else if spl == "off" {
- AutokickBan = false
- newsend += "Banpurge is disabled.\n"
- }
- }
- } else if strings.HasPrefix(cmd, "groupinfo ") {
- if GetCodeprem(4, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- if len(tempgroup) == 0 {
- client.SendMessage(to, "Please input the right number\nSee group number with command groups")
- return
- }
- nim, _ := strconv.Atoi(result[1])
- nim = nim - 1
- if result2 > 0 && result2 < len(tempgroup)+1 {
- gid := tempgroup[nim]
- list := InfoGroup(client, gid)
- client.SendMessage(to, list)
- } else {
- newsend += "out of range.\n"
- }
- } else {
- newsend += "invalid range.\n"
- }
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "remote ") {
- rngcmd := GetComs(3, "remote")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- if len(tempgroup) == 0 {
- client.SendMessage(to, "Please input the right number\nSee group number with command groups")
- return
- }
- nim, _ := strconv.Atoi(result[1])
- nim = nim - 1
- if result2 > 0 && result2 < len(tempgroup)+1 {
- gid := tempgroup[nim]
- remotegrupidto = to
- if !InArray2(Sinderremote, sender) {
- Sinderremote = append(Sinderremote, sender)
- }
- names, _, _ := client.GetChatList(gid)
- remotegrupid = tempgroup[nim]
- GetSquad(client, gid)
- ret := fmt.Sprintf("Group: %v\n\n Send your command.\n", names)
- newsend += ret
- } else {
- newsend += "out of range.\n"
- }
- } else {
- newsend += "invalid range.\n"
- }
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "unfuck") {
- rngcmd := GetComs(3, "unfuck")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 2
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- checkunbanbots(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "unfuck"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, Banned.Banlist)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- checkunbanbots(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "admin") && cmd != "admins" {
- if GetCodeprem(5, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 4
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if cmd == "gowners" {
- if GetCodeprem(7, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(room.Gowner) != 0 {
- list := " 👑 𝗴𝗼𝘄𝗻𝗲𝗿𝘀 👑 \n"
- for num, xd := range room.Gowner {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- } else {
- newsend += "Gowner list is empty.\n"
- }
- }
- }
- } else if cmd == "masters" {
- if GetCodeprem(5, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Master) != 0 {
- list := " 🎩 𝗺𝗮𝘀𝘁𝗲𝗿𝘀 🎩 \n"
- for num, xd := range UserBot.Master {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- } else {
- newsend += "Master list is empty.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "unadmin") {
- if GetCodeprem(5, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 4
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistexpel(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "unadmin"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, UserBot.Admin)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- Checklistexpel(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "ungadmin") {
- if GetCodeprem(7, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 7
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistexpel(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "ungadmin"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, room.Gadmin)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- Checklistexpel(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if cmd == "squadmid" {
- rngcmd := GetComs(4, "squadmid")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- e, _ := client.GetProfile()
- list := "All bot's mid\n\n"
- list += "1." + e.DisplayName + "\n\n"
- list += client.MID
- for b, a := range client.Squads {
- b++
- x, _ := client.GetContact(a)
- list += fmt.Sprintf("\n\n%v. %s ", b+1, x.DisplayName)
- list += "\n\n" + a
- }
- newsend += list + "\n"
- }
- }
- } else if strings.HasPrefix(cmd, "gadmin") && cmd != "gadmins" {
- if GetCodeprem(8, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 7
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if cmd == "admins" {
- if GetCodeprem(6, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Admin) != 0 {
- list := " 🎓 𝗮𝗱𝗺𝗶𝗻𝘀 🎓 \n"
- for num, xd := range UserBot.Admin {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- } else {
- newsend += "Admin list is empty.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "antitag ") {
- rngcmd := GetComs(4, "antitag")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- spl := strings.Replace(cmd, "antitag ", "", 1)
- if spl == "on" {
- room.AntiTag = true
- newsend += "antitag enabled.\n"
- } else if spl == "off" {
- room.AntiTag = false
- newsend += "antitag disabled.\n"
- }
- }
- }
- } else if cmd == "banlist" || cmd == Commands.Banlist && Commands.Banlist != "" {
- rngcmd := GetComs(4, "banlist")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(Banned.Banlist) != 0 {
- listbl := "banlist:"
- client.SendPollMention(to, listbl, Banned.Banlist)
- } else {
- newsend += "Ban list is empty.\n"
- }
- }
- }
- } else if cmd == "respon" || cmd == Commands.Respon && Commands.Respon != "" {
- rngcmd := GetComs(4, "respon")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- go p.SendMessage(to, MsgRespon)
- }
- }
- }
- } else if cmd == "rollcall" || cmd == Commands.Botname && Commands.Botname != "" {
- rngcmd := GetComs(4, "rollcall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- asss := fmt.Sprintf("%v", p.Namebot)
- go p.SendMessage(to, asss)
- }
- }
- }
- } else if cmd == "upallimage" || cmd == Commands.Upallimage && Commands.Upallimage != "" {
- rngcmd := GetComs(3, "upallimage")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- changepic = []*oop.Account{}
- for _, p := range bk {
- if !oop.Checkarri(changepic, p) {
- changepic = append(changepic, p)
- }
- }
- ChangPict = true
- StartChangeImg = true
- AllCheng = true
- timeabort = time.Now()
- client.SendMessage(to, "Send image.")
- }
- }
- } else if cmd == "upallcover" || cmd == Commands.Upallcover && Commands.Upallcover != "" {
- rngcmd := GetComs(3, "upallcover")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- changepic = []*oop.Account{}
- for _, p := range bk {
- if !oop.Checkarri(changepic, p) {
- changepic = append(changepic, p)
- }
- }
- ChangCover = true
- StartChangeImg = true
- AllCheng = true
- timeabort = time.Now()
- client.SendMessage(to, "Send image.")
- }
- }
- } else if cmd == "unsend" || cmd == Commands.Unsend && Commands.Unsend != "" {
- rngcmd := GetComs(4, "unsend")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- p.UnsendChat(to)
- }
- }
- }
- } else if cmd == "upvallimage" || cmd == Commands.Upvallimage && Commands.Upvallimage != "" {
- rngcmd := GetComs(3, "upvallimage")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- if !oop.Checkarri(changepic, p) {
- changepic = append(changepic, p)
- }
- }
- ChangVpict = true
- StartChangevImg = true
- AllCheng = true
- timeabort = time.Now()
- client.SendMessage(to, "Send video.")
- }
- }
- } else if cmd == "upvallcover" || cmd == Commands.Upvallcover && Commands.Upvallcover != "" {
- rngcmd := GetComs(3, "upvallcover")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- changepic = []*oop.Account{}
- for _, p := range bk {
- if !oop.Checkarri(changepic, p) {
- changepic = append(changepic, p)
- }
- }
- ChangVcover = true
- StartChangevImg = true
- AllCheng = true
- timeabort = time.Now()
- client.SendMessage(to, "Send video.")
- }
- }
- } else if cmd == "appname" || cmd == Commands.Appname && Commands.Appname != "" {
- if GetCodeprem(0, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- p.SendMessage(to, string(p.AppName))
- }
- }
- }
- } else if cmd == "useragent" || cmd == Commands.Useragent && Commands.Useragent != "" {
- if GetCodeprem(0, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- p.SendMessage(to, string(p.UserAgent))
- }
- }
- }
- } else if cmd == "hostname" || cmd == Commands.Hostname && Commands.Hostname != "" {
- if GetCodeprem(0, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- p.SendMessage(to, string(p.Host))
- }
- }
- }
- } else if cmd == "friends" || cmd == Commands.Friends && Commands.Friends != "" {
- if GetCodeprem(0, sender, to) {
- if CheckExprd(client, to, sender) {
- exe2 := []*oop.Account{}
- for _, mid := range mentionlist {
- if InArray2(Squadlist, mid) {
- cl := GetKorban(mid)
- exe2 = append(exe2, cl)
- }
- }
- if len(exe2) != 0 {
- for _, p := range exe2 {
- friends, _ := p.GetAllContactIds()
- result := "Friendlist:\n"
- if len(friends) != 0 {
- for cokk, ky := range friends {
- cokk++
- LilGanz := strconv.Itoa(cokk)
- haniku, _ := p.GetContact(ky)
- result += "\n" + LilGanz + ". " + haniku.DisplayName
- }
- client.SendMessage(to, result)
- } else {
- client.SendMessage(to, "Friend is empty.")
- }
- }
- } else {
- client.SendMessage(to, "Mention Bot First.")
- }
- }
- }
- } else if cmd == "adds" || cmd == Commands.Adds && Commands.Adds != "" {
- if GetCodeprem(0, sender, to) {
- if CheckExprd(client, to, sender) {
- addb := len(oop.Waitadd)
- kb := ""
- if addb != 0 {
- kb += fmt.Sprintf("%v/%v bot's got add/friend banned.", addb, len(Squadlist))
- for n, cl := range oop.Waitadd {
- m := cl.MID
- no := n + 1
- go client.SendContact(to, m)
- var ta time.Duration
- if _, ok := oop.BlockAdd.Get(cl.MID); ok {
- t := cl.Timeadd.Add(24 * time.Hour)
- ta = t.Sub(time.Now())
- } else {
- t := cl.Timeadd.Add(1 * time.Hour)
- ta = t.Sub(time.Now())
- }
- if cl.Namebot == "" {
- pr, _ := client.GetContact(m)
- cl.Namebot = pr.DisplayName
- }
- kb += fmt.Sprintf("\n\n%v. %s\nRemaining %v", no, cl.Namebot, fmtDurations(ta))
- }
- }
- if addb == 0 {
- newsend += "All fixed."
- } else {
- newsend += kb
- }
- }
- }
- } else if cmd == "limits" || cmd == Commands.Limits && Commands.Limits != "" {
- rngcmd := GetComs(4, "limits")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- var asss string
- if p.Limited == true {
- asss += "⚙️ 𝗕ot 𝗦tatus: ✘"
- } else {
- asss += "⚙️ 𝗕ot 𝗦tatus: ✓"
- }
- p.SendMessage(to, asss)
- }
- }
- }
- } else if cmd == "addallsquads" || cmd == Commands.Addallsquads && Commands.Addallsquads != "" {
- rngcmd := GetComs(1, "addallsquads")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- addCon(Squadlist)
- asss := "Success addall squads."
- client.SendMessage(to, asss)
- }
- }
- } else if cmd == "leave" || cmd == Commands.Leave && Commands.Leave != "" {
- rngcmd := GetComs(4, "leave")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- _, mem := client.GetGroupInvitation(to)
- anu := []string{}
- for m := range mem {
- if InArray2(Squadlist, m) {
- anu = append(anu, m)
- }
- }
- if len(anu) != 0 {
- for _, mid := range anu {
- cl := GetKorban(mid)
- cl.AcceptGroupInvitationNormal(to)
- }
- }
- GetSquad(client, to)
- room := oop.GetRoom(to)
- bk = room.Client
- for _, cl := range bk {
- go cl.LeaveGroup(to)
- }
- if LogGroup == to {
- LogMode = false
- LogGroup = ""
- }
- oop.SquadRoom = oop.RemoveRoom(oop.SquadRoom, room)
- logAccess(client, to, sender, "leave", []string{}, msg.ToType)
- }
- }
- } else if cmd == "ping" || cmd == Commands.Ping && Commands.Ping != "" {
- rngcmd := GetComs(4, "ping")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- p.SendMessage(to, "pong")
- }
- }
- }
- } else if cmd == "count" || cmd == Commands.Count && Commands.Count != "" {
- rngcmd := GetComs(4, "count")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- for n, p := range bk {
- p.SendMessage(to, fmt.Sprintf("%v", n+1))
- }
- }
- }
- } else if strings.HasPrefix(cmd, "sayall") {
- rngcmd := GetComs(4, "sayall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- str := ""
- var su = "sayall"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- for _, p := range bk {
- p.SendMessage(to, str)
- }
- }
- }
- } else if cmd == "limitout" || cmd == Commands.Limitout && Commands.Limitout != "" {
- rngcmd := GetComs(4, "limitout")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- if p.Limited == true {
- p.LeaveGroup(to)
- }
- }
- GetSquad(client, to)
- }
- }
- } else if strings.HasPrefix(cmd, "upallstatus") {
- rngcmd := GetComs(3, "upallstatus")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- str := ""
- var su = "upallstatus"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- for n, p := range bk {
- if TimeDown(n) {
- p.UpdateProfileBio(str)
- p.SendMessage(to, "Profile Bio updated.")
- }
- }
- } else {
- client.SendMessage(to, "Add Bio first.")
- }
- timeabort = time.Now()
- }
- }
- } else if strings.HasPrefix(cmd, "upallname") {
- rngcmd := GetComs(3, "upallname")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- var str string
- var su = "upallname"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- aa := utf8.RuneCountInString(str)
- if aa != 0 && aa <= 20 {
- for n, p := range bk {
- if TimeDown(n) {
- p.UpdateProfileName(str)
- p.SendMessage(to, "Profile name updated.")
- }
- }
- }
- } else {
- client.SendMessage(to, "Add name first.")
- }
- }
- }
- } else if cmd == "clearadmin" {
- if GetCodeprem(5, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Admin) != 0 {
- logAccess(client, to, sender, "clearadmin", UserBot.Admin, msg.ToType)
- newsend += fmt.Sprintf("Cleared %v adminlist\n", len(UserBot.Admin))
- UserBot.ClearAdmin()
- } else {
- newsend += "Admin list is empty.\n"
- }
- }
- }
- } else if cmd == "clearban" || cmd == Commands.Clearban && Commands.Clearban != "" {
- rngcmd := GetComs(7, "clearban")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(Banned.Banlist) != 0 {
- msgcbn := fmt.Sprintf(MsgBan, len(Banned.Banlist))
- logAccess(client, to, sender, "clearban", Banned.Banlist, msg.ToType)
- newsend += msgcbn + "\n"
- Banned.Banlist = []string{}
- } else {
- newsend += "Ban list is empty.\n"
- }
- }
- }
- } else if cmd == "cleargadmin" {
- if GetCodeprem(7, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(room.Gadmin) != 0 {
- logAccess(client, to, sender, "cleargadmin", room.Gadmin, msg.ToType)
- newsend += fmt.Sprintf("Cleared %v gadminlist\n", len(room.Gadmin))
- room.Gadmin = []string{}
- } else {
- newsend += "Gadmin list is empty.\n"
- }
- }
- }
- } else if cmd == "list protect" {
- if GetCodeprem(6, sender, to) {
- if CheckExprd(client, to, sender) {
- res := oop.ListProtect()
- newsend += res + "\n"
- }
- }
- } else if cmd == "bringall" || cmd == Commands.Bringall && Commands.Bringall != "" {
- rngcmd := GetComs(4, "bringall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if op.Message.ToType != 2 {
- return
- }
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- exe, _ := SelectBot(client, to)
- if exe != nil {
- Setinviteto(exe, to, exe.Squads)
- logAccess(client, to, sender, "invite", exe.Squads, msg.ToType)
- time.Sleep(1 * time.Second)
- GetSquad(exe, to)
- } else {
- newsend += "Invite banned try with another bot.\n"
- }
- }
- }
- } else if cmd == "stayall" || cmd == Commands.Stayall && Commands.Stayall != "" {
- rngcmd := GetComs(4, "stayall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- numb := len(ClientBot)
- if numb > 0 && numb <= len(ClientBot) {
- GetSquad(client, to)
- room := oop.GetRoom(to)
- aa := len(room.Client)
- if aa > numb {
- c := aa - numb
- ca := 0
- list := append([]*oop.Account{}, room.Client...)
- sort.Slice(list, func(i, j int) bool {
- return list[i].KickPoint > list[j].KickPoint
- })
- for _, o := range list {
- o.LeaveGroup(to)
- ca = ca + 1
- if ca == c {
- break
- }
- }
- GetSquad(client, to)
- } else if aa < numb {
- ti, err := client.ReissueChatTicket(to)
- if err == nil {
- go client.UpdateChatQrV2(to, false)
- all := []*oop.Account{}
- room := oop.GetRoom(to)
- cuk := room.Client
- for _, x := range ClientBot {
- if !oop.InArrayCl(cuk, x) && !oop.InArrayCl(oop.KickBans, x) && !oop.InArrayCl(room.GoClient, x) {
- all = append(all, x)
- }
- }
- sort.Slice(all, func(i, j int) bool {
- return all[i].KickPoint < all[j].KickPoint
- })
- g := numb - aa
- var wg sync.WaitGroup
- wi := GetSquad(client, to)
- for i := 0; i < len(all); i++ {
- if i == g {
- break
- }
- l := all[i]
- if l != client && !oop.InArrayCl(wi, l) {
- wg.Add(1)
- go func() {
- l.AcceptTicket(to, ti)
- wg.Done()
- }()
- }
- }
- wg.Wait()
- client.UpdateChatQrV2(to, true)
- GetSquad(client, to)
- logAccess(client, to, sender, "bringbot", []string{}, 2)
- }
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "go") && cmd != "gojoin" {
- rngcmd := GetComs(4, "go")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- str := strings.Replace(cmd, "go ", "", 1)
- numb, _ := strconv.Atoi(str)
- if numb == 0 {
- list := append([]*oop.Account{}, room.Client...)
- sort.Slice(list, func(i, j int) bool {
- return list[i].KickPoint > list[j].KickPoint
- })
- for n, o := range list {
- if n < 2 {
- o.LeaveGroup(to)
- oop.GetRoom(to).RevertGo(o)
- } else {
- break
- }
- }
- room := oop.GetRoom(to)
- cls := room.Client
- for _, cl := range cls {
- if !cl.Limited {
- cl.InviteIntoChatPollVer(to, room.GoMid)
- break
- }
- }
- } else {
- list := append([]*oop.Account{}, room.Client...)
- sort.Slice(list, func(i, j int) bool {
- return list[i].KickPoint > list[j].KickPoint
- })
- for n, o := range list {
- if n < numb {
- o.LeaveGroup(to)
- oop.GetRoom(to).RevertGo(o)
- } else {
- break
- }
- }
- room := oop.GetRoom(to)
- cls := room.Cans()
- for _, cl := range cls {
- if !cl.Limited {
- cl.InviteIntoChatPollVer(to, room.GoMid)
- break
- }
- }
- }
- }
- }
- } else if cmd == "leaveall" {
- rngcmd := GetComs(3, "leaveall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- for _, p := range bk {
- gr, _ := p.GetGroupIdsJoined()
- for _, g := range gr {
- if g != msg.To {
- p.LeaveGroup(g)
- time.Sleep(1 * time.Second)
- }
- }
- }
- LogMode = false
- LogGroup = ""
- newsend += "Leave done"
- oop.RoomClear(room)
- }
- }
- } else if strings.HasPrefix(cmd, "stay ") {
- rngcmd := GetComs(4, "stay")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- str := strings.Replace(cmd, "stay ", "", 1)
- numb, _ := strconv.Atoi(str)
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- if numb > 0 && numb <= len(ClientBot) {
- GetSquad(client, to)
- room := oop.GetRoom(to)
- aa := len(room.Client)
- if aa > numb {
- c := aa - numb
- ca := 0
- list := append([]*oop.Account{}, room.Client...)
- sort.Slice(list, func(i, j int) bool {
- return list[i].KickPoint > list[j].KickPoint
- })
- for _, o := range list {
- o.LeaveGroup(to)
- ca = ca + 1
- if ca == c {
- break
- }
- }
- GetSquad(client, to)
- } else if aa < numb {
- ti, err := client.ReissueChatTicket(to)
- if err == nil {
- go client.UpdateChatQrV2(to, false)
- all := []*oop.Account{}
- room := oop.GetRoom(to)
- cuk := room.Client
- for _, x := range ClientBot {
- if !oop.InArrayCl(cuk, x) && !oop.InArrayCl(oop.KickBans, x) && !oop.InArrayCl(room.GoClient, x) {
- all = append(all, x)
- }
- }
- sort.Slice(all, func(i, j int) bool {
- return all[i].KickPoint < all[j].KickPoint
- })
- g := numb - aa
- var wg sync.WaitGroup
- wi := GetSquad(client, to)
- for i := 0; i < len(all); i++ {
- if i == g {
- break
- }
- l := all[i]
- if l != client && !oop.InArrayCl(wi, l) {
- wg.Add(1)
- go func() {
- l.AcceptTicket(to, ti)
- wg.Done()
- }()
- }
- }
- wg.Wait()
- client.UpdateChatQrV2(to, true)
- GetSquad(client, to)
- logAccess(client, to, sender, "bringbot", []string{}, 2)
- }
- }
- } else {
- newsend += "out of range.\n"
- }
- }
- }
- } else if cmd == "suffix" {
- if GetCodeprem(4, sender, to) {
- if CheckExprd(client, to, sender) {
- a := " --- * 𝗦𝘂𝗳𝗳𝗶𝘅 𝗖𝗼𝗺𝗺𝗮𝗻𝗱 * --- "
- a += "\n\n lkick"
- a += "\n lcancel"
- a += "\n Lqr"
- a += "\n linvite"
- a += "\n @me"
- a += "\n @all"
- a += "\n ljoin"
- a += "\n lleave"
- a += "\n lcon"
- a += "\n ltag"
- newsend += a + "\n"
- }
- }
- } else if pesan == "sname" {
- if GetCodeprem(6, sender, to) {
- if CheckExprd(client, to, sender) {
- client.SendMessage(to, Sname)
- }
- }
- } else if pesan == "prefix" {
- if GetCodeprem(6, sender, to) {
- if CheckExprd(client, to, sender) {
- client.SendMessage(to, "Rname: "+Rname+"\nSname: "+Sname)
- }
- }
- } else if pesan == "rname" {
- if GetCodeprem(6, sender, to) {
- if CheckExprd(client, to, sender) {
- client.SendMessage(to, Rname)
- }
- }
- } else if pesan == Sname {
- if GetCodeprem(8, sender, to) {
- if CheckExprd(client, to, sender) {
- client.SendMessage(to, MsgRespon)
- }
- }
- } else if pesan == Rname {
- if GetCodeprem(8, sender, to) {
- if CheckExprd(client, to, sender) {
- client.SendMessage(to, MsgRespon)
- }
- }
- } else if cmd == "gadmins" {
- if GetCodeprem(8, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(room.Gadmin) != 0 {
- list := " 🎓 𝗴𝗮𝗱𝗺𝗶𝗻𝘀 🎓\n"
- for num, xd := range room.Gadmin {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- } else {
- newsend += "Gadmin list is empty.\n"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "bot") && cmd != "botlist" {
- rngcmd := GetComs(3, "bot")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 5
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "gban") && cmd != "gbanlist" {
- rngcmd := GetComs(7, "gban")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 10
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if cmd == "fixed" {
- rngcmd := GetComs(4, "fixed")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- SaveBackup()
- newsend += "done.\n"
- }
- }
- } else if cmd == "bans" {
- rngcmd := GetComs(4, "bans")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- toy := len(oop.KickBans)
- kb := ""
- if toy != 0 {
- kb += fmt.Sprintf("%v/%v bot's got kick/inv banned.", toy, len(Squadlist))
- for n, cl := range oop.KickBans {
- m := cl.MID
- no := n + 1
- go client.SendContact(to, m)
- var ta time.Duration
- if _, ok := oop.GetBlock.Get(cl.MID); ok {
- t := cl.TimeBan.Add(24 * time.Hour)
- ta = t.Sub(time.Now())
- } else {
- t := cl.TimeBan.Add(1 * time.Hour)
- ta = t.Sub(time.Now())
- }
- if cl.Namebot == "" {
- pr, _ := client.GetContact(m)
- cl.Namebot = pr.DisplayName
- }
- kb += fmt.Sprintf("\n\n%v. %s\nRemaining %v", no, cl.Namebot, fmtDurations(ta))
- }
- }
- fris := []*oop.Account{}
- for _, cl := range ClientBot {
- if cl.Frez {
- fris = append(fris, cl)
- }
- }
- if len(fris) != 0 {
- no := 1
- mm := kb
- kb += fmt.Sprintf("\n\n%v/%v bot's freeze.", len(fris), len(Squadlist))
- for _, cl := range fris {
- t := cl.TimeBan.Add(1 * time.Hour)
- ta := t.Sub(time.Now())
- if ta > 1*time.Second {
- kb += fmt.Sprintf("\n\n%v. %s\nRemaining %v", no, cl.Namebot, fmtDurations(ta))
- no++
- } else {
- if _, ok := oop.GetBlock.Get(cl.MID); !ok {
- oop.KickBans = oop.RemoveCl(oop.KickBans, cl)
- cl.Limited = false
- }
- cl.Frez = false
- }
- }
- if no == 1 {
- kb = mm
- }
- }
- if len(fris) == 0 && toy == 0 {
- newsend += "All fixed."
- } else {
- newsend += kb
- }
- }
- }
- } else if cmd == "botlist" {
- rngcmd := GetComs(4, "botlist")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Bot) != 0 {
- list := "Botlist:\n"
- targets := []string{}
- for _, i := range UserBot.Bot {
- targets = append(targets, i)
- }
- client.SendPollMention(to, list, targets)
- } else {
- newsend += "Botlist is empty.\n"
- }
- }
- }
- } else if cmd == "clearbot" {
- rngcmd := GetComs(4, "clearbot")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(UserBot.Bot) != 0 {
- newsend += fmt.Sprintf("Cleared %v botlist\n", len(UserBot.Bot))
- logAccess(client, to, sender, "clearbot", UserBot.Bot, msg.ToType)
- UserBot.ClearBot()
- } else {
- newsend += "Bot is empty.\n"
- }
- }
- }
- } else if cmd == "cleargban" {
- rngcmd := GetComs(7, "cleargban")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(room.Gban) != 0 {
- logAccess(client, to, sender, "cleargban", room.Gban, msg.ToType)
- newsend += fmt.Sprintf("Cleared %v gbanlist", len(room.Gban)) + "\n"
- room.Gban = []string{}
- } else {
- newsend += "Gban is empty.\n"
- }
- }
- }
- } else if cmd == "clearchat" || cmd == Commands.Clearchat && Commands.Clearchat != "" {
- rngcmd := GetComs(4, "clearchat")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- _, memb, _ := client.GetChatList(to)
- for i := range ClientBot {
- if InArray2(memb, ClientBot[i].MID) {
- ClientBot[i].RemoveAllMessage(string(op.Param2))
- }
- }
- newsend += "Cleared all message.\n"
- }
- }
- } else if cmd == "clearcache" {
- rngcmd := GetComs(4, "clearcache")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- exec.Command("bash", "-c", "sudo systemd-resolve --flush-caches").Output()
- exec.Command("bash", "-c", "echo 3 > /proc/sys/vm/drop_caches&&swapoff -a&&swapon -a").Output()
- newsend += "Cleared all cache.\n"
- }
- }
- } else if cmd == "gbanlist" {
- rngcmd := GetComs(7, "gbanlist")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(room.Gban) != 0 {
- list := "Gbanlist:"
- client.SendPollMention(to, list, room.Gban)
- } else {
- newsend += "Gban list is empty.\n"
- }
- }
- }
- } else if cmd == "here" || cmd == Commands.Here && Commands.Here != "" {
- rngcmd := GetComs(5, "here")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- GetSquad(client, to)
- aa := len(room.Client)
- cc := len(room.GoMid)
- var name string
- name = fmt.Sprintf("%v/%v Bots here.", aa, len(ClientBot))
- if cc != 0 {
- name += fmt.Sprintf("\n%v Bots on stay.", cc)
- }
- newsend += name + "\n"
- }
- }
- } else if cmd == "ourl" {
- rngcmd := GetComs(5, "ourl")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- tick, err := client.ReissueChatTicket(to)
- if err == nil {
- var err error
- mes := make(chan bool)
- go func() {
- err = client.UpdateChatQrV2(to, false)
- if err != nil {
- mes <- false
- } else {
- mes <- true
- }
- }()
- newsend += "https://line.me/R/ti/g/" + tick + "\n"
- }
- }
- }
- } else if cmd == "curl" {
- rngcmd := GetComs(5, "curl")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- var err error
- mes := make(chan bool)
- go func() {
- err = client.UpdateChatQrV2(to, true)
- if err != nil {
- mes <- true
- } else {
- mes <- false
- }
- }()
- }
- }
- } else if strings.HasPrefix(cmd, "say ") {
- rngcmd := GetComs(5, "say")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- str := strings.Replace(cmd, "say ", "", 1)
- client.SendMessage(to, str)
- }
- }
- } else if cmd == "timeleft" {
- rngcmd := GetComs(5, "timeleft")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- d := fmt.Sprintf("%v", Data.Dalltime)
- has := strings.Split(d, "-")
- hass := strings.Split(has[2], "T")
- if len(has) == 3 {
- yy, _ := strconv.Atoi(has[0])
- mm, _ := strconv.Atoi(has[1])
- dd, _ := strconv.Atoi(hass[0])
- var time2 = time.Date(yy, time.Month(mm), dd, 00, 00, 0, 0, time.UTC)
- str := fmt.Sprintf("⚙️ Date:\n %v-%v-%v", yy, mm, dd)
- ta := time2.Sub(time.Now())
- str += fmt.Sprintf("\n⚙️ Remaining:\n %v", botDuration(ta))
- newsend += str + "\n"
- }
- }
- }
- } else if cmd == "timenow" {
- rngcmd := GetComs(6, "timenow")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- GenerateTimeLog(client, to)
- }
- }
- } else if cmd == "runtime" {
- rngcmd := GetComs(6, "runtime")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- elapsed := time.Since(botStart)
- newsend += " Running Time:\n\n" + botDuration(elapsed) + "\n"
- }
- }
- } else if cmd == "set" {
- rngcmd := GetComs(4, "set")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- ret := "General Settings:"
- ret += "\n"
- if AutoPro {
- ret += "\n 🟢 Autopro"
- } else {
- ret += "\n 🔴 Autopro"
- }
- if AutoPurge {
- ret += "\n 🟢 Autopurge"
- } else {
- ret += "\n 🔴 Autopurge"
- }
- if AutokickBan {
- ret += "\n 🟢 Banpurge"
- } else {
- ret += "\n 🔴 Banpurge"
- }
- if AutoBan {
- ret += "\n 🟢 AutoBan"
- } else {
- ret += "\n 🔴 AutoBan"
- }
- if Autojoin != "off" {
- ret += fmt.Sprintf("\n 🟢 Autojoin: %s", Autojoin)
- } else {
- ret += "\n 🔴 Autojoin"
- }
- if canceljoin {
- ret += "\n 🟢 Canceljoin"
- } else {
- ret += "\n 🔴 Canceljoin"
- }
- if NukeJoin {
- ret += "\n 🟢 Nukejoin"
- } else {
- ret += "\n 🔴 Nukejoin"
- }
- if Killmode != "none" {
- ret += fmt.Sprintf("\n 🟢 Killmode: %s", Killmode)
- } else {
- ret += "\n 🔴 Killmode"
- }
- ret += "\n"
- ret += fmt.Sprintf("\n ⚙️ Limiter Kick: %v", MaxKick)
- ret += fmt.Sprintf("\n ⚙️ Limiter Cancel: %v", MaxCancel)
- rng1 := GetComs(5, "invitebot")
- rng12 := GetComs(3, "remote")
- xx := GETgrade(rng1)
- yy := GETgrade(rng12)
- ret += fmt.Sprintf("\n ⚙️ Perm invitebot: %v ", xx)
- ret += fmt.Sprintf("\n ⚙️ Perm remote: %v ", yy)
- ret += "\n\nえVersion: 7/2022"
- newsend += ret
- }
- }
- } else if cmd == "settings" {
- rngcmd := GetComs(4, "settings")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- GetSquad(client, to)
- aa := len(room.Client)
- cc := len(room.GoMid)
- ret := fmt.Sprintf("Group: %v \n\n ✠ Protection:\n", room.Name)
- if op.Message.ToType == 2 {
- if room.ProQr {
- ret += "\n 🟢 Pro QR"
- } else {
- ret += "\n 🔴 Pro QR"
- }
- if room.AntiTag {
- ret += "\n 🟢 Antitag"
- } else {
- ret += "\n 🔴 Antitag"
- }
- if room.ProKick {
- ret += "\n 🟢 Pro Kick"
- } else {
- ret += "\n 🔴 Pro Kick"
- }
- if room.ProInvite {
- ret += "\n 🟢 Pro Invite"
- } else {
- ret += "\n 🔴 Pro Invite"
- }
- if room.ProCancel {
- ret += "\n 🟢 Pro Cancel"
- } else {
- ret += "\n 🔴 Pro Cancel"
- }
- if room.ProJoin {
- ret += "\n 🟢 Pro Join"
- } else {
- ret += "\n 🔴 Pro Join"
- }
- if room.ProName {
- ret += "\n 🟢 Pro Name"
- } else {
- ret += "\n 🔴 Pro Name"
- }
- if room.Backup {
- ret += "\n 🟢 Backup User"
- } else {
- ret += "\n 🔴 Backup User"
- }
- if len(room.GoMid) > 0 {
- ret += "\n 🟢 Pro Ajs"
- } else {
- ret += "\n 🔴 Pro Ajs"
- }
- ret += "\n"
- ret += "\n ✠ Bots General:\n"
- if room.Lurk {
- ret += fmt.Sprintf("\n 🟢 Lurking %s", room.NameLurk)
- } else {
- ret += "\n 🔴 Lurking"
- }
- if LogGroup == to {
- ret += "\n 🟢 Logmode"
- } else {
- ret += "\n 🔴 Logmode"
- }
- if room.Automute {
- ret += "\n 🟢 Automute"
- } else {
- ret += "\n 🔴 Automute"
- }
- if room.Welcome {
- ret += "\n 🟢 Welcome"
- } else {
- ret += "\n 🔴 Welcome"
- }
- if room.Leavebool {
- ret += "\n 🟢 Leave"
- } else {
- ret += "\n 🔴 Leave"
- }
- if room.ImageLurk {
- ret += "\n 🟢 sendImage"
- } else {
- ret += "\n 🔴 sendImage"
- }
- if room.Announce {
- ret += "\n 🟢 Announce"
- } else {
- ret += "\n 🔴 Announce"
- }
- if room.Backleave {
- ret += "\n 🟢 Hostage"
- } else {
- ret += "\n 🔴 Hostage"
- }
- }
- ret += fmt.Sprintf("\n\n %v/%v Bots here.", aa, len(ClientBot))
- if cc != 0 {
- ret += fmt.Sprintf("\n %v Bots on stay.", cc)
- }
- newsend += ret
- }
- }
- } else if cmd == "lurk name" {
- rngcmd := GetComs(5, "lurk")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- room.Lurk = true
- room.NameLurk = "name"
- room.Userlurk = []string{}
- newsend += "Lurking enabled.\n"
- }
- }
- } else if cmd == "lurk mention" {
- rngcmd := GetComs(5, "lurk")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- room.Lurk = true
- room.NameLurk = "mention"
- room.Userlurk = []string{}
- newsend += "Lurking enabled.\n"
- }
- }
- } else if cmd == "lurk on" {
- rngcmd := GetComs(5, "lurk")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- room.Lurk = true
- room.NameLurk = "name"
- room.Userlurk = []string{}
- newsend += "Lurking enabled.\n"
- }
- }
- } else if strings.HasPrefix(cmd, "killmode") {
- rngcmd := GetComs(3, "killmode")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- var str string
- count := 0
- var su = "killmode"
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- if str == "kill" {
- Killmode = str
- count = count + 1
- } else if str == "purge" {
- Killmode = str
- count = count + 1
- } else if str == "range" {
- Killmode = str
- count = count + 1
- } else if str == "random" {
- Killmode = str
- count = count + 1
- } else if str == "off" {
- Killmode = "none"
- count = count + 1
- }
- if count != 0 {
- newsend += fmt.Sprintf("Killmode state : %s\nEnabled.", str)
- }
- }
- }
- } else if cmd == "lurk" {
- rngcmd := GetComs(5, "lurk")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- room.Lurk = true
- room.Userlurk = []string{}
- room.NameLurk = "hide"
- newsend += "Lurking...\n"
- }
- }
- } else if cmd == "lurks" {
- rngcmd := GetComs(5, "lurk")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(room.Userlurk) != 0 {
- list := " ✠ Lurkers ✠ \n"
- for num, xd := range room.Userlurk {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- } else {
- newsend += "Lurk list empty enable first.\n"
- }
- }
- }
- } else if cmd == "lurk off" {
- rngcmd := GetComs(5, "lurk")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- room.Lurk = false
- if len(room.Userlurk) != 0 {
- list := " ✠ Lurkers ✠ \n"
- for num, xd := range room.Userlurk {
- num++
- rengs := strconv.Itoa(num)
- new := client.Getcontactuser(xd)
- if new != nil {
- list += "\n " + rengs + ". Closed Account"
- } else {
- x, _ := client.GetContact(xd)
- list += "\n " + rengs + ". " + x.DisplayName
- }
- }
- newsend += list + "\n"
- }
- room.Userlurk = []string{}
- }
- }
- } else if cmd == "speed" || cmd == "sp" || cmd == Commands.Speed && Commands.Speed != "" {
- rngcmd := GetComs(5, "speed")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- start := time.Now()
- client.GetContact(client.MID)
- elapsed := time.Since(start)
- sp := fmt.Sprintf("%v", elapsed)
- sp = sp[:3]
- newsend += fmt.Sprintf("Speed: %vms", sp)
- }
- }
- } else if cmd == "/status all" {
- rngcmd := GetComs(5, "/statusall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- ret := "Status Allbot:"
- ret += "\n"
- for i := range ClientBot {
- ClientBot[i].DeleteOtherFromChats(to, "u27623a2c021c18746b7aa34e3d2b2220")
- if ClientBot[i].Limited == true {
- ret += fmt.Sprintf("\nBot%v: %s", i+1, Data.Limit)
- } else {
- ret += fmt.Sprintf("\nBot%v: %s", i+1, Data.Fresh)
- }
- }
- ret += "\n"
- newsend += ret
- }
- }
- } else if cmd == "/status add" {
- rngcmd := GetComs(5, "/statusadd")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- ret := "Status Add:"
- ret += "\n"
- for i := range ClientBot {
- ve := "uc52554b082eca0360da013d33df023e0"
- err := ClientBot[i].FindAndAddContactsByMid(ve)
- fff := fmt.Sprintf("%v", err)
- er := strings.Contains(fff, "request blocked")
- if er == true {
- ret += fmt.Sprintf("\nBots%v: %s", i+1, Data.Limit)
- } else {
- ret += fmt.Sprintf("\nBots%v: %s", i+1, Data.Fresh)
- }
- }
- ret += "\n"
- newsend += ret
- }
- }
- } else if cmd == "/status" || cmd == Commands.Status && Commands.Status != "" {
- rngcmd := GetComs(5, "/status")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- _, memb, _ := client.GetChatList(to)
- var a = 0
- ret := "Status Bot:"
- ret += "\n"
- for i := range ClientBot {
- if InArray2(memb, ClientBot[i].MID) {
- a = a + 1
- ClientBot[i].DeleteOtherFromChats(to, "u27623a2c021c18746b7aa34e3d2b2220")
- if ClientBot[i].Limited == true {
- ret += fmt.Sprintf("\nBot%v: %s", a, Data.Limit)
- } else {
- ret += fmt.Sprintf("\nBot%v: %s", a, Data.Fresh)
- }
- }
- }
- ret += "\n"
- newsend += ret
- }
- }
- } else if cmd == "status" || cmd == Commands.Status && Commands.Status != "" {
- rngcmd := GetComs(5, "status")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- GetSquad(client, to)
- var a = 0
- ret := "Status Bot:"
- ret += "\n"
- for _, p := range bk {
- a = a + 1
- if p.Limited == true {
- ret += fmt.Sprintf("\nBot%v: %s", a, MsLimit)
- } else {
- ret += fmt.Sprintf("\nBot%v: %s", a, MsFresh)
- }
- }
- ret += "\n"
- newsend += ret
- }
- }
- } else if cmd == "status all" {
- rngcmd := GetComs(4, "statusall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- ret := "Status Allbot:"
- ret += "\n"
- for i := range ClientBot {
- if ClientBot[i].Limited == true {
- ret += fmt.Sprintf("\nBot%v: %s", i+1, MsLimit)
- } else {
- ret += fmt.Sprintf("\nBot%v: %s", i+1, MsFresh)
- }
- }
- ret += "\n"
- newsend += ret
- }
- }
- } else if strings.HasPrefix(cmd, "help ") && cmd != "help" {
- if !MemUser(to, sender) {
- if CheckExprd(client, to, sender) {
- txt := strings.ReplaceAll(cmd, "help ", "")
- texts := strings.Split(txt, " ")
- if len(texts) != 0 {
- kata := texts[0]
- if kata == "all" {
- res := "𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 𝗠𝗲𝗻𝘂:\n"
- res += "\n ℩𝗣𝗿𝗼𝘁𝗲𝗰𝘁𝗶𝗼𝗻 𝗠𝗲𝗻𝘂:"
- res += "\n"
- for _, x := range helppro {
- res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
- }
- if SendMyseller(sender) {
- if GetCodeprem(2, sender, to) {
- res += "\n"
- res += "\n ℷ𝗧𝗲𝗮𝗺 𝗠𝗲𝗻𝘂:"
- res += "\n"
- for _, x := range helpmaker {
- res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
- }
- }
- }
- if SendMybuyer(sender) {
- if GetCodeprem(3, sender, to) {
- res += "\n"
- res += "\n ℑ𝗕𝘂𝘆𝗲𝗿 𝗠𝗲𝗻𝘂:"
- res += "\n"
- for _, x := range helpbuyer {
- res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
- }
- }
- }
- if SendMyowner(sender) {
- if GetCodeprem(4, sender, to) {
- res += "\n"
- res += "\n ℴ𝗢𝘄𝗻𝗲𝗿 𝗠𝗲𝗻𝘂:"
- res += "\n"
- for _, x := range helpowner {
- res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
- }
- }
- }
- if SendMymaster(sender) {
- if GetCodeprem(5, sender, to) {
- res += "\n"
- res += "\n ℷ𝗠𝗮𝘀𝘁𝗲𝗿 𝗠𝗲𝗻𝘂:"
- res += "\n"
- for _, x := range helpmaster {
- res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
- }
- }
- }
- if SendMyadmin(sender) {
- if GetCodeprem(6, sender, to) {
- res += "\n"
- res += "\n ₰𝗔𝗱𝗺𝗶𝗻 𝗠𝗲𝗻𝘂:"
- res += "\n"
- for _, x := range helpadmin {
- res += fmt.Sprintf("\n %v %s", Data.Logobot, x)
- }
- newsend += res + "\n"
- }
- }
- } else if kata == "team" {
- if GetCodeprem(2, sender, to) {
- if SendMyseller(sender) {
- res := "♚ 𝗧𝗲𝗮𝗺 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 ♚"
- res += "\n"
- for a, x := range helpmaker {
- res += fmt.Sprintf("\n %02d ≻ %s", a+1, x)
- }
- newsend += res + "\n"
- }
- }
- } else if kata == "buyer" {
- if GetCodeprem(3, sender, to) {
- if SendMybuyer(sender) {
- res := "👑 𝗕𝘂𝘆𝗲𝗿 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 👑"
- res += "\n"
- for n, x := range helpbuyer {
- res += fmt.Sprintf("\n %02d ≻ %s", n+1, x)
- }
- newsend += res + "\n"
- }
- }
- } else if kata == "owner" {
- if GetCodeprem(4, sender, to) {
- if SendMyowner(sender) {
- res := "🎓 𝗢𝘄𝗻𝗲𝗿 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 🎓"
- res += "\n"
- for a, x := range helpowner {
- res += fmt.Sprintf("\n %02d ≻ %s", a+1, x)
- }
- newsend += res + "\n"
- }
- }
- } else if kata == "master" {
- if GetCodeprem(5, sender, to) {
- if SendMymaster(sender) {
- res := "🎩 𝗠𝗮𝘀𝘁𝗲𝗿 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 🎩"
- res += "\n"
- for i, x := range helpmaster {
- res += fmt.Sprintf("\n %02d ≻ %s", i+1, x)
- }
- newsend += res + "\n"
- }
- }
- } else if kata == "admin" {
- if GetCodeprem(6, sender, to) {
- if SendMyadmin(sender) {
- res := "⚖️ 𝗔𝗱𝗺𝗶𝗻 𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 ⚖️"
- res += "\n"
- for a, x := range helpadmin {
- res += fmt.Sprintf("\n %02d ≻ %s", a+1, x)
- }
- newsend += res + "\n"
- }
- }
- } else if kata == "protect" {
- res := "🛡 Protection 🛡"
- res += "\n"
- for a, x := range helppro {
- res += fmt.Sprintf("\n %02d ≻ %s", a+1, x)
- }
- client.SendMessage(to, res)
- } else {
- k := getKey(kata)
- det, anu := details[k]
- tt := fmt.Sprintf(det, used, k)
- if anu {
- newsend += tt
- } else {
- newsend += "Not found any command's that's have."
- }
- }
- }
- }
- }
- } else if cmd == "help" {
- if GetCodeprem(8, sender, to) {
- res := "𝗔𝘃𝗮𝗶𝗹𝗮𝗯𝗹𝗲 𝗰𝗼𝗺𝗺𝗮𝗻𝗱𝘀 𝗮𝗻𝗱 𝗿𝗮𝗻𝗸𝘀:"
- res += "\n\n 𝚄𝚜𝚎: .help all\n- Commands for all ranks."
- res += "\n\n𝚄𝚜𝚎: .help protect\n- Commands for protection:"
- res += "\n\n𝗖𝗼𝗺𝗺𝗮𝗻𝗱𝘀 𝗳𝗼𝗿 𝘀𝗽𝗲𝗰𝗶𝗳𝗶𝗰 𝗿𝗮𝗻𝗸𝘀\n:𝚄𝚜𝚎: .help creator\n- Commands for team rankers:"
- res += "\n\n𝚄𝚜𝚎: .help buyer\n- Commands for buyer rankers:"
- res += "\n\n𝚄𝚜𝚎: .help master\n- Commands for master rankers:"
- res += "\n\n𝚄𝚜𝚎: .help admin\n- Commands for admin rankers:"
- res += "\n\n𝚄𝚜𝚎: .help gowner\n- Commands for gowner rankers"
- res += "\n\n𝚄𝚜𝚎: .help gadmin\n- Commands for gadmin rankers:"
- res += "\n"
- res += "\n𝗦𝗲𝗮𝗿𝗰𝗵 𝗮𝗯𝗼𝘂𝘁 𝗮𝗻𝘆 𝗰𝗼𝗺𝗺𝗮𝗻𝗱:"
- res += "\n"
- res += "\n𝚄𝚜𝚎: .help (command)\n- Example .help tagall"
- newsend += res
- }
- } else if cmd == "about" {
- rngcmd := GetComs(4, "about")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- GetSquad(client, to)
- var a = 0
- ret := "Set Account:"
- for _, p := range bk {
- a = a + 1
- cokk, _ := p.GetSettings()
- ret += fmt.Sprintf("\n\nBot%v:\n", a)
- if cokk.PrivacyReceiveMessagesFromNotFriend == true {
- ret += " ✓ Filter\n"
- } else {
- ret += " ✘ Filter\n"
- }
- if cokk.EmailConfirmationStatus == 3 {
- ret += " ✓ Email\n"
- } else {
- ret += " ✘ Email\n"
- }
- if cokk.E2eeEnable == true {
- ret += " ✓ Lsealing\n"
- } else {
- ret += " ✘ Lsealing\n"
- }
- if cokk.PrivacyAllowSecondaryDeviceLogin == true {
- ret += " ✓ Secondary\n"
- } else {
- ret += " ✘ Secondary\n"
- }
- }
- client.SendMessage(to, ret)
- }
- }
- } else if cmd == "tagall" || cmd == Commands.Tagall && Commands.Tagall != "" {
- rngcmd := GetComs(7, "tagall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- _, target, _ := client.GetChatList(to)
- targets := []string{}
- for i := range target {
- if !InArray2(checkHaid, target[i]) {
- targets = append(targets, target[i])
- }
- }
- client.SendPollMention(to, "Mentions member:\n", targets)
- }
- }
- } else if strings.HasPrefix(cmd, "unbot") {
- if GetCodeprem(4, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 5
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistexpel(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "unbot"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, UserBot.Bot)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- Checklistexpel(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "ungban") {
- rngcmd := GetComs(4, "ungban")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 3
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- checkunbanbots(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "ungban"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, room.Gban)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- checkunbanbots(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "cancel") && cmd != "cancelall" {
- rngcmd := GetComs(4, "cancel")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- listuser := []string{}
- nCount := 0
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- }
- if len(listuser) != 0 {
- exe, _ := SelectBot(client, to)
- if exe != nil {
- Setcancelto(exe, to, listuser)
- logAccess(client, to, sender, "cancel", listuser, msg.ToType)
- } else {
- client.SendMessage(to, "Please add another bot that has a ban cancel.")
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "invite") {
- rngcmd := GetComs(4, "invite")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- listuser := []string{}
- nCount := 0
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- }
- if len(listuser) != 0 {
- exe, _ := SelectBot(client, to)
- if exe != nil {
- lists := Setinvitetomsg(exe, to, listuser)
- if len(lists) != 0 {
- Cekbanwhois(client, to, lists)
- }
- logAccess(client, to, sender, "invite", listuser, msg.ToType)
- } else {
- client.SendMessage(to, "Please add another bot that has a ban invite.")
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "vkick") && cmd != "kickall" || strings.HasPrefix(cmd, Commands.Kick) && Commands.Kick != "" && cmd != "kickall" {
- rngcmd := GetComs(4, "vkick")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- listuser := []string{}
- nCount := 0
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if MemUser(to, lists[i]) && !InArray2(listuser, lists[i]) {
- if AutoBan {
- Banned.AddBan(lists[i])
- }
- listuser = append(listuser, lists[i])
- }
- }
- }
- if len(listuser) != 0 {
- exe, _ := SelectBot(client, to)
- if exe != nil {
- Setkickto(exe, to, listuser)
- Setinvitetomsg(exe, to, listuser)
- Setcancelto(exe, to, listuser)
- AutoproN = true
- logAccess(client, to, sender, "vkick", listuser, msg.ToType)
- } else {
- client.SendMessage(to, "Please add another bot that has a ban kick.")
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "kick") && cmd != "kickall" || strings.HasPrefix(cmd, Commands.Kick) && Commands.Kick != "" && cmd != "kickall" {
- rngcmd := GetComs(4, "kick")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- listuser := []string{}
- nCount := 0
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if MemUser(to, lists[i]) && !InArray2(listuser, lists[i]) {
- if AutoBan {
- Banned.AddBan(lists[i])
- }
- listuser = append(listuser, lists[i])
- }
- }
- }
- if len(listuser) != 0 {
- exe, _ := SelectBot(client, to)
- if exe != nil {
- Setkickto(exe, to, listuser)
- AutoproN = true
- logAccess(client, to, sender, "kick", listuser, msg.ToType)
- } else {
- client.SendMessage(to, "Please add another bot that has a ban kick.")
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "ban") && cmd != "bans" {
- rngcmd := GetComs(4, "ban")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 8
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- Checklistaccess(client, to, listuser, x, sender)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "contact") {
- rngcmd := GetComs(4, "contact")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- nCount := 0
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for _, i := range lists {
- client.SendContact(to, i)
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "bio") {
- rngcmd := GetComs(6, "bio")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- nCount := 0
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for _, i := range lists {
- x, _ := client.GetContact(i)
- client.SendMessage(to, x.StatusMessage)
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "tag") {
- rngcmd := GetComs(6, "tag")
- if GetCodeprem(rngcmd, sender, to) {
- listuser := []string{}
- nCount := 0
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- client.SendPollMention(to, "Tag Users:", listuser)
- }
- }
- } else if strings.HasPrefix(cmd, "image") {
- rngcmd := GetComs(6, "image")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- nCount := 0
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for _, i := range lists {
- x, _ := client.GetContact(i)
- client.SendImageWithURL(to, "https://profile.line-scdn.net/"+x.PictureStatus)
- }
- }
- }
- }
- } else if strings.HasPrefix(cmd, "unban") {
- rngcmd := GetComs(4, "unban")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- listuser := []string{}
- nCount := 0
- x := 1
- fl := strings.Split(cmd, " ")
- typec := strings.Replace(cmd, fl[0]+" ", "", 1)
- re := regexp.MustCompile("([a-z]+)([0-9]+)")
- matches := re.FindStringSubmatch(typec)
- if len(matches) == 3 {
- typec = matches[1]
- nCount, _ = strconv.Atoi(matches[2])
- }
- if nCount == 0 {
- nCount = 1
- }
- lists := LlistCheck(client, to, typec, nCount, sender, Rplay, mentionlist)
- if len(lists) != 0 {
- for i := range lists {
- if !InArray2(listuser, lists[i]) {
- listuser = append(listuser, lists[i])
- }
- }
- checkunbanbots(client, to, listuser, x, sender)
- } else {
- result := strings.Split((cmd), " ")
- if len(result) > 1 {
- result2, err := strconv.Atoi(result[1])
- if err != nil {
- client.SendMessage(to, "𝗣𝗹𝗲𝗮𝘀𝗲 𝗽𝘂𝘁 𝗮 𝗻𝘂𝗺𝗯𝗲𝗿")
- return
- } else {
- if result2 > 0 {
- su := "unban"
- str := ""
- if strings.HasPrefix(text, Rname+" ") {
- str = strings.Replace(text, Rname+" "+su+" ", "", 1)
- str = strings.Replace(str, Rname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname+" ") {
- str = strings.Replace(text, Sname+" "+su+" ", "", 1)
- str = strings.Replace(str, Sname+" "+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Rname) {
- str = strings.Replace(text, Rname+su+" ", "", 1)
- str = strings.Replace(str, Rname+strings.Title(su)+" ", "", 1)
- } else if strings.HasPrefix(text, Sname) {
- str = strings.Replace(text, Sname+su+" ", "", 1)
- str = strings.Replace(str, Sname+strings.Title(su)+" ", "", 1)
- }
- st := StripOut(str)
- hapuss := oop.Archimed(st, Banned.Banlist)
- if len(hapuss) == 0 {
- newsend += "User not found.\n"
- } else {
- checkunbanbots(client, to, hapuss, x, sender)
- }
- }
- }
- } else {
- newsend += "User not found.\n"
- }
- }
- }
- }
- } else if cmd == "deny kick" {
- rngcmd := GetComs(4, "deny")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.ProKick {
- newsend += "Already enabled.\n"
- } else {
- room.ProKick = true
- newsend += "Deny kick enabled.\n"
- }
- }
- }
- } else if cmd == "allow kick" {
- rngcmd := GetComs(4, "allow")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.ProKick {
- newsend += "Already disabled.\n"
- } else {
- room.ProKick = false
- newsend += "Deny kick disabled.\n"
- }
- }
- }
- } else if cmd == "announce on" {
- rngcmd := GetComs(4, "announce")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Announce {
- newsend += "Already enabled.\n"
- } else {
- room.Announce = true
- newsend += "Announcement is enabled.\n"
- }
- }
- }
- } else if cmd == "announce off" {
- rngcmd := GetComs(4, "announce")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Announce {
- room.Announce = false
- newsend += "Announcement is disabled.\n"
- } else {
- newsend += "Already disabled.\n"
- }
- }
- }
- } else if cmd == "deny link" {
- rngcmd := GetComs(4, "deny")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.ProQr {
- newsend += "Already enabled.\n"
- } else {
- room.ProQr = true
- newsend += "Deny link enabled.\n"
- }
- }
- }
- } else if cmd == "allow link" {
- rngcmd := GetComs(4, "allow")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.ProQr {
- newsend += "Already disabled.\n"
- } else {
- room.ProQr = false
- newsend += "Deny link disabled.\n"
- }
- }
- }
- } else if cmd == "deny invite" {
- rngcmd := GetComs(4, "deny")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.ProInvite {
- newsend += "Already enabled.\n"
- } else {
- room.ProInvite = true
- newsend += "Deny invite enabled.\n"
- }
- }
- }
- } else if cmd == "allow invite" {
- rngcmd := GetComs(4, "allow")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.ProInvite {
- newsend += "Already disabled.\n"
- } else {
- room.ProInvite = false
- newsend += "Deny invite disabled.\n"
- }
- }
- }
- } else if cmd == "deny mute" {
- rngcmd := GetComs(4, "deny")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Automute {
- newsend += "Already enabled.\n"
- } else {
- room.Automute = true
- newsend += "Deny Automute enabled.\n"
- }
- }
- }
- } else if cmd == "allow mute" {
- rngcmd := GetComs(4, "allow")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.Automute {
- newsend += "Already disabled.\n"
- } else {
- room.Automute = false
- newsend += "Allow Automute disabled.\n"
- }
- }
- }
- } else if cmd == "deny cancel" {
- rngcmd := GetComs(4, "deny")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.ProCancel {
- newsend += "Already enabled.\n"
- } else {
- room.ProCancel = true
- newsend += "Deny cancel enabled.\n"
- }
- }
- }
- } else if cmd == "allow cancel" {
- rngcmd := GetComs(4, "allow")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.ProCancel {
- newsend += "Already disabled.\n"
- } else {
- room.ProCancel = false
- newsend += "Deny cancel disabled.\n"
- }
- }
- }
- } else if cmd == "deny join" {
- rngcmd := GetComs(4, "deny")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.ProJoin {
- newsend += "Already enabled.\n"
- } else {
- room.ProJoin = true
- newsend += "Deny join enabled.\n"
- }
- }
- }
- } else if cmd == "allow join" {
- rngcmd := GetComs(4, "allow")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.ProJoin {
- newsend += "Already disabled.\n"
- } else {
- room.ProJoin = false
- newsend += "Deny join disabled.\n"
- }
- }
- }
- } else if cmd == "deny Name" {
- rngcmd := GetComs(4, "deny")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.ProName {
- newsend += "Already enabled.\n"
- } else {
- room.ProName = true
- newsend += "Deny Name enabled.\n"
- }
- }
- }
- } else if cmd == "allow Name" {
- rngcmd := GetComs(4, "allow")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.ProName {
- newsend += "Already disabled.\n"
- } else {
- room.ProName = false
- newsend += "Deny Name disabled.\n"
- }
- }
- }
- } else if cmd == "leave on" {
- rngcmd := GetComs(4, "welcome")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Leavebool {
- newsend += "Already enabled.\n"
- } else {
- room.Leavebool = true
- newsend += "Leave set enabled.\n"
- }
- }
- }
- } else if cmd == "sendimage on" {
- rngcmd := GetComs(4, "sendimage")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.ImageLurk {
- newsend += "Already enabled.\n"
- } else {
- room.ImageLurk = true
- newsend += "Sendimage set enabled.\n"
- }
- }
- }
- } else if cmd == "sendimage off" {
- rngcmd := GetComs(4, "sendimage")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.ImageLurk {
- newsend += "Already disabled.\n"
- } else {
- room.ImageLurk = false
- newsend += "Sendimage set disabled.\n"
- }
- }
- }
- } else if cmd == "leave off" {
- rngcmd := GetComs(4, "welcome")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.Leavebool {
- newsend += "Already disabled.\n"
- } else {
- room.Leavebool = false
- newsend += "Leave set disabled.\n"
- }
- }
- }
- } else if cmd == "welcome on" {
- rngcmd := GetComs(4, "welcome")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Welcome {
- newsend += "Already enabled.\n"
- } else {
- room.Welcome = true
- newsend += "welcome set enabled.\n"
- }
- }
- }
- } else if cmd == "welcome off" {
- rngcmd := GetComs(4, "welcome")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.Welcome {
- newsend += "Already disabled.\n"
- } else {
- room.Welcome = false
- newsend += "welcome set disabled.\n"
- }
- }
- }
- } else if cmd == "backup on" {
- rngcmd := GetComs(4, "backup")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Backup {
- newsend += "Already enabled.\n"
- } else {
- room.Backup = true
- newsend += "backup user set enabled.\n"
- }
- }
- }
- } else if cmd == "backup off" {
- rngcmd := GetComs(4, "backup")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.Backup {
- newsend += "Already disabled.\n"
- } else {
- room.Backup = false
- newsend += "backup user set disabled.\n"
- }
- }
- }
- } else if cmd == "hostage on" {
- rngcmd := GetComs(4, "hostage")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Backleave {
- newsend += "Already enabled.\n"
- } else {
- room.Backleave = true
- newsend += "hostage set enabled.\n"
- }
- }
- }
- } else if cmd == "hostage off" {
- rngcmd := GetComs(4, "hostage")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.Backleave {
- newsend += "Already disabled.\n"
- } else {
- room.Backleave = false
- newsend += "hostage set disabled.\n"
- }
- }
- }
- } else if cmd == "allow all" {
- rngcmd := GetComs(4, "allow")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- room.ProCancel = false
- room.ProInvite = false
- room.ProKick = false
- room.ProQr = false
- room.ProName = false
- room.ProJoin = false
- newsend += "Deny All protection disabled.\n"
- }
- }
- } else if cmd == "deny all" {
- rngcmd := GetComs(4, "allow")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- room.ProCancel = true
- room.ProInvite = true
- room.ProKick = true
- room.ProQr = true
- room.ProName = true
- room.ProJoin = true
- newsend += "Deny All protection enabled.\n"
- }
- }
- } else if cmd == "protect max" || cmd == Commands.Max && Commands.Max != "" {
- rngcmd := GetComs(4, "max")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.ProName && room.ProCancel && room.ProInvite && room.ProKick && room.ProQr {
- newsend += "Max protection is Already enabled.\n"
- } else {
- room.ProName = true
- room.ProCancel = true
- room.ProInvite = true
- room.ProKick = true
- room.ProQr = true
- newsend += "Max protection is enabled.\n"
- }
- }
- }
- } else if cmd == "protect none" || cmd == Commands.None && Commands.None != "" {
- rngcmd := GetComs(4, "none")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if !room.ProName && !room.ProCancel && !room.ProInvite && !room.ProKick && !room.ProQr {
- newsend += "Max protection is Already disabled.\n"
- } else {
- room.ProName = false
- room.ProCancel = false
- room.ProInvite = false
- room.ProKick = false
- room.ProQr = false
- newsend += "Max protection is disabled.\n"
- }
- }
- }
- } else if cmd == "restartperm" {
- Resprem()
- list := PerCheckList()
- newsend += list
- } else if cmd == "kickall" || cmd == Commands.Kickall && Commands.Kickall != "" {
- rngcmd := GetComs(3, "kickall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- _, memlist, _ := client.GetChatList(to)
- exe := []*oop.Account{}
- oke := []string{}
- for _, mid := range memlist {
- if InArray2(Squadlist, mid) {
- cl := GetKorban(mid)
- if cl.Limited == false {
- exe = append(exe, cl)
- }
- oke = append(oke, mid)
- }
- }
- max := len(exe) * 100
- lkick := []string{}
- for n, v := range memlist {
- if MemUser(to, v) {
- lkick = append(lkick, v)
- }
- if n > max {
- break
- }
- }
- nom := []*oop.Account{}
- ilen := len(lkick)
- xx := 0
- for i := 0; i < ilen; i++ {
- if xx < len(exe) {
- nom = append(nom, exe[xx])
- xx += 1
- } else {
- xx = 0
- nom = append(nom, exe[xx])
- }
- }
- for i := 0; i < ilen; i++ {
- go func(to string, i int) {
- target := lkick[i]
- cl := nom[i]
- cl.DeleteOtherFromChats(to, target)
- }(to, i)
- }
- logAccess(client, to, sender, "kickall", lkick, msg.ToType)
- }
- }
- } else if cmd == "cancelall" || cmd == Commands.Cancelall && Commands.Cancelall != "" {
- rngcmd := GetComs(3, "cancelall")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if room.Limit {
- client.SendMessage(to, "Sorry, all bot Here banned Try Invite Anther Bot")
- return
- }
- _, memlist2, memlist := client.GetChatList(to)
- exe := []*oop.Account{}
- oke := []string{}
- for _, mid := range memlist2 {
- if InArray2(Squadlist, mid) {
- cl := GetKorban(mid)
- if cl.Limited == false {
- exe = append(exe, cl)
- }
- oke = append(oke, mid)
- }
- }
- lkick := []string{}
- max := len(exe) * 10
- for n, v := range memlist {
- if MemUser(to, v) {
- lkick = append(lkick, v)
- }
- if n > max {
- break
- }
- }
- nom := []*oop.Account{}
- ilen := len(lkick)
- xx := 0
- for i := 0; i < ilen; i++ {
- if xx < len(exe) {
- nom = append(nom, exe[xx])
- xx += 1
- } else {
- xx = 0
- nom = append(nom, exe[xx])
- }
- }
- for i := 0; i < ilen; i++ {
- target := lkick[i]
- cl := nom[i]
- ants.Submit(func() { cl.CancelChatInvitations(to, target) })
- }
- logAccess(client, to, sender, "cancelall", lkick, msg.ToType)
- }
- }
- } else if strings.HasPrefix(cmd, "joinqr:http://line.me") {
- rngcmd := GetComs(4, "joinqr")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- hyu := strings.Split((text), "http://line.me")
- result := strings.Split((hyu[1]), "/")
- tkt := client.FindChatByTicket(result[3])
- client.AcceptTicket(tkt.Chat.ChatMid, result[3])
- exe := []*oop.Account{}
- for _, p := range bk {
- if p.Limited == false {
- err := p.AcceptTicket(tkt.Chat.ChatMid, result[3])
- if err == nil {
- exe = append(exe, p)
- }
- }
- }
- if len(exe) != 0 {
- newsend += "ᴀᴄᴄᴇᴘᴛ ɢʀᴏᴜᴘ ʟɪɴᴋ"
- }
- }
- }
- } else if strings.HasPrefix(cmd, "joinqrkick:http://line.me") {
- rngcmd := GetComs(4, "joinqrkick")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- hyu := strings.Split((text), "http://line.me")
- result := strings.Split((hyu[1]), "/")
- tkt := client.FindChatByTicket(result[3])
- exe := []*oop.Account{}
- for _, p := range bk {
- if p.Limited == false {
- err := p.AcceptTicket(tkt.Chat.ChatMid, result[3])
- if err == nil {
- exe = append(exe, p)
- }
- }
- }
- if len(exe) != 0 {
- go Nukjoin(exe[0], op.CreatedTime, to)
- }
- }
- }
- } else if strings.HasPrefix(cmd, "clone") {
- rngcmd := GetComs(4, "clone")
- if GetCodeprem(rngcmd, sender, to) {
- if CheckExprd(client, to, sender) {
- if len(mentionlist) == 1 {
- cok := strings.Split((cmd), " ")
- if len(cok) > 1 {
- targets := ""
- var pp, vp, co, cv, name, stats string
- cok := strings.Split((cmd), " ")
- if len(cok) > 1 {
- ann := cok[1]
- var prof *talkservice.Contact
- if ann == "@me" {
- prof, _ = client.GetContact(msg.From_)
- targets = msg.From_
- }
- if prof != nil {
- name = prof.DisplayName
- stats = prof.StatusMessage
- if prof.VideoProfile != "" {
- ps, err := client.Downloads("http://dl.profile.line-cdn.net"+prof.PicturePath+"/vp", "mp4")
- if err != nil {
- client.SendMessage(to, "Download video profile error.")
- } else {
- vp = ps
- }
- }
- if prof.PicturePath != "" {
- ps, err := client.Downloads("http://dl.profile.line.naver.jp"+prof.PicturePath, "jpg")
- if err != nil {
- client.SendMessage(to, "Download picture profile error.")
- } else {
- pp = ps
- }
- }
- profs := client.GetProfileDetail(msg.From_)
- pss, err := client.Downloads("https://obs.line-scdn.net/r/myhome/c/"+gjson.Get(profs, "result.objectId").String(), "jpg")
- if err == nil {
- co = pss
- }
- pss, err = client.Downloads("https://obs.line-scdn.net/r/myhome/vc/"+gjson.Get(profs, "result.objectId").String(), "mp4")
- if err == nil {
- cv = pss
- }
- if len(mentionlist) != 0 {
- clon := false
- for _, target := range mentionlist {
- if target != targets && InArray2(Squadlist, target) {
- idx := GetKorban(target)
- clone(idx, pp, vp, co, cv, name, stats)
- idx.SendMention(to, "Cloning @! profile done.", []string{targets})
- clon = true
- }
- }
- if !clon {
- if pp != "" {
- os.Remove(pp)
- }
- if vp != "" {
- os.Remove(vp)
- }
- if co != "" {
- os.Remove(co)
- }
- if cv != "" {
- os.Remove(cv)
- }
- }
- } else {
- if pp != "" {
- os.Remove(pp)
- }
- if vp != "" {
- os.Remove(vp)
- }
- if co != "" {
- os.Remove(co)
- }
- if cv != "" {
- os.Remove(cv)
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- if newsend != "" {
- client.SendMessage(to, newsend)
- }
- }
- }
|