Advertisement
kohpriwniranam

gentoken

Apr 1st, 2024
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1.  
  2. } else if strings.HasPrefix(txt, "say") || strings.HasPrefix(txt, data.KohCmd["say"]) && data.KohCmd["say"] != ""{
  3. if getAccess(ctime,cl.Mid) {
  4. result := strings.Split((text), "\n")
  5. if len(result) != 1{
  6. R2 := strings.Replace(text,result[0]+"\n", "", 1)
  7. R2 = strings.ReplaceAll(R2,"\n", "-")
  8. cl.SendMessage(to, R2)
  9. } else {
  10. cl.SendMessage(to, "EX:\nsay\nhello\n\n>try again!!")
  11. }
  12. }
  13. } else if strings.HasPrefix(txt, "gentoken") || strings.HasPrefix(txt, data.KohCmd["gentoken"]) && data.KohCmd["gentoken"] != "" {
  14. if Pangkat1(sender) {
  15. if getAccess(ctime,cl.Mid) {
  16. result := strings.Split((text), "\n")
  17. if len(result) != 1{
  18. subprocess := strings.Replace(text,result[0]+"\n", "", 1)
  19. listtoken := fmt.Sprintf("Squadlist :\n\n")
  20. nm := []string{}
  21. Tok := strings.Split(string(subprocess), "\n")
  22. for a, x := range Tok{
  23. mids := strings.Split(x, ":")
  24. na := ""
  25. con, err := cl.GetContact(mids[0]);
  26. if err != nil {
  27. name := fmt.Sprintf("%s", err);name = fmt.Sprintf(" [%v] %s",a+1 , name);na += name
  28. } else {
  29. name := con.DisplayName;name = fmt.Sprintf(" [%v] %s",a+1 , name);na += name
  30. mid := mids[0]
  31. cl.SendContact(to, mid)
  32. tokenmid := mids[0]+":"+mids[1]
  33. ret := string(name)+"\n"
  34. ret += "\nTokenLite:\n"+generateLineLiteToken(tokenmid)+"\n"
  35. ret += "\nToken:\n"+GenerateToken(tokenmid)
  36. cl.SendMessage(to,ret)
  37. }
  38. name := na
  39. nm = append(nm, name)
  40. }
  41. stf := listtoken
  42. str := strings.Join(nm, "\n")
  43. sta := fmt.Sprintf("\n\ntotal : %v ea", len(nm))
  44. cl.SendMessage(thrift.E2EE,stf+str+sta + "")
  45. } else {
  46. cmdtype := strings.ToLower(result[0])
  47. rst := " ◗ Exemple"
  48. rst += "\n "+cmdtype
  49. rst += "\n "+"AuthKey1"
  50. rst += "\n "+"AuthKey2"
  51. cl.SendMessage(to,rst)
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement