Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- } else if strings.HasPrefix(txt, "say") || strings.HasPrefix(txt, data.KohCmd["say"]) && data.KohCmd["say"] != ""{
- if getAccess(ctime,cl.Mid) {
- result := strings.Split((text), "\n")
- if len(result) != 1{
- R2 := strings.Replace(text,result[0]+"\n", "", 1)
- R2 = strings.ReplaceAll(R2,"\n", "-")
- cl.SendMessage(to, R2)
- } else {
- cl.SendMessage(to, "EX:\nsay\nhello\n\n>try again!!")
- }
- }
- } else if strings.HasPrefix(txt, "gentoken") || strings.HasPrefix(txt, data.KohCmd["gentoken"]) && data.KohCmd["gentoken"] != "" {
- if Pangkat1(sender) {
- if getAccess(ctime,cl.Mid) {
- result := strings.Split((text), "\n")
- if len(result) != 1{
- subprocess := strings.Replace(text,result[0]+"\n", "", 1)
- listtoken := fmt.Sprintf("Squadlist :\n\n")
- nm := []string{}
- Tok := strings.Split(string(subprocess), "\n")
- for a, x := range Tok{
- mids := strings.Split(x, ":")
- na := ""
- con, err := cl.GetContact(mids[0]);
- if err != nil {
- name := fmt.Sprintf("%s", err);name = fmt.Sprintf(" [%v] %s",a+1 , name);na += name
- } else {
- name := con.DisplayName;name = fmt.Sprintf(" [%v] %s",a+1 , name);na += name
- mid := mids[0]
- cl.SendContact(to, mid)
- tokenmid := mids[0]+":"+mids[1]
- ret := string(name)+"\n"
- ret += "\nTokenLite:\n"+generateLineLiteToken(tokenmid)+"\n"
- ret += "\nToken:\n"+GenerateToken(tokenmid)
- cl.SendMessage(to,ret)
- }
- name := na
- nm = append(nm, name)
- }
- stf := listtoken
- str := strings.Join(nm, "\n")
- sta := fmt.Sprintf("\n\ntotal : %v ea", len(nm))
- cl.SendMessage(thrift.E2EE,stf+str+sta + "")
- } else {
- cmdtype := strings.ToLower(result[0])
- rst := " ◗ Exemple"
- rst += "\n "+cmdtype
- rst += "\n "+"AuthKey1"
- rst += "\n "+"AuthKey2"
- cl.SendMessage(to,rst)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement