Advertisement
kohpriwniranam

time & LogoDisplay

Nov 25th, 2023
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1.  
  2. type User struct {
  3. Set struct {
  4. LogoDisplay string `json:"logodisplay"`
  5. Stabilizer int `json:"stabilizer"`
  6. } `json:"Setinfo"`
  7. }
  8.  
  9. var(LogoDisplay string = "ηιяαηαм™")
  10.  
  11. func InsLogoDisplay() bool {if data.Set.LogoDisplay == "" {data.Set.LogoDisplay = LogoDisplay;return true};return false}
  12.  
  13. //====== [cmd] ======//
  14. } else if txt == "sets" {
  15. if getAccess(ctime,cl.Mid) {
  16. ret := "╭━ • 𝐒𝐞𝐭𝐭𝐢𝐧𝐠𝐬 • ━╮"
  17. if data.Set.KillMod {ret += "\n┃•🟢 Killmode"} else {ret += "\n┃•🔴 Killmode"}
  18. if data.Set.Stabilizer == 1 {ret += "\n┃•🟢 Stabilizer"} else {ret += "\n┃•🔴 Stabilizer"}
  19. ret += "\n┃•stabilizer ❨on/off❩"
  20. cl.SendMessage(to, ret)
  21. }
  22. } else if strings.HasPrefix(txt,"setlogodis"+":") {
  23. if getAccess(ctime,cl.Mid) {
  24. result := strings.Split((text),":")
  25. data.Set.LogoDisplay = result[1]
  26. cl.SendMessage(to, "LogoDisplay set to: " + data.Set.LogoDisplay)
  27. }
  28. } else if strings.HasPrefix(txt,"stabilizer"+" ") {
  29. if getAccess(ctime,cl.Mid) {
  30. result := strings.Split((text), " ")
  31. putSquad(cl, to)
  32. if result[1] == "on" {
  33. data.Set.Stabilizer = 1
  34. InsLogoDisplay()
  35. cl.SendMessage(to, "Stabilizer enable")
  36. } else if result[1] == "off" {
  37. data.Set.Stabilizer = 0
  38. cl.SendMessage(to, "Stabilizer disable")
  39. }
  40. SaveData()
  41. }
  42.  
  43. //====== [func ]======//
  44. func TimeDisplayName(cl *oop.Account) string {
  45. loc, _ := time.LoadLocation("Asia/Bangkok")
  46. ab:=time.Now().In(loc)
  47. hh := ab.Hour();mm := ab.Minute()
  48. var (hhconv string;mmconv string)
  49. if hh < 10 {hhconv = "0"+strconv.Itoa(hh)} else {hhconv = strconv.Itoa(hh)}
  50. if mm < 10 {mmconv = "0"+strconv.Itoa(mm)} else {mmconv = strconv.Itoa(mm)}
  51. ret := "("+hhconv+":"+mmconv+")"
  52. return ret
  53. }
  54. func speedStabilizer(cl *oop.Account) {
  55. for {
  56. elapsed := time.Since(timeStart)
  57. fmt.Println(""+botDuration(elapsed)+"")
  58. if data.Set.Stabilizer == 1 {
  59. <-time.After(6 * time.Minute)
  60. Td := TimeDisplayName(cl)
  61. num := fmt.Sprintf("°%v", cl.Count+1)
  62. Upname := fmt.Sprintf("%s%s%s", data.Set.LogoDisplay, num, Td)
  63. name,_ := cl.GetProfile()
  64. name.DisplayName = Upname
  65. cl.UpdateProfileAttributes(2, name.DisplayName)
  66. } else {
  67. <-time.After(380 * time.Second)
  68. fth,_ := cl.GetProfile()
  69. fth.DisplayName = fth.DisplayName
  70. cl.UpdateProfile(fth.DisplayName,fth.DisplayName)
  71. }
  72. }
  73. }
  74.  
  75. for num, auth := range Token {
  76. xcl := oop.Connect(num, auth)
  77. err := xcl.LoginWithAuthToken()
  78. if err == nil {
  79. go speedStabilizer(xcl)
  80. go func(num int){perBots(xcl)}(num)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement