@xped777

Проблема в часах в игровом боте вк что делать?

Проблема в часах в игровом боте вк, все было нормально и бац все капец
61132165c300c506633046.jpeg
Это ошибка
358 сткрока

this.users.forEach((user) => {
358>       message += `${user.color === multiply ? '' : ''} [id${user.user.id}|${user.user.firstName}] - ${utils.split(user.bet)} VKC на ${getColor(user.color)} цвет - ${user.color === multiply ? `победа (+${utils.split(user.bet * mapMultiply(multiply))} VKC)` : 'поражение'}\n`
    })
    await vk.api.messages.send({
      peer_id: this.chatId,
      message: stripIndents`
           Выигрышным номером был ${this.wonNumber} (${getColor(multiply)} цвет).
           Хеш игры: [${this.hash}]
           Зашифрованный текст: [${this.wonNumber}|${this.salt}]

           Итоги игры:
          ${message || 'Победителей нет'}

        `,
      attachment: images[this.wonNumber],
      disable_mentions: true,
      dont_parse_links: 1,
    })


392 строка
tick () {
    if (!this.isStarted) return
    if (this.time > 0) {
      this.time--
    } else {
 392>    this.getWinner()
    }
    return true
  }


const sessionManager = new SessionManager()
const sceneManager = new SceneManager()
class Game {
  constructor (chatId) {
    this.chatId = chatId
    this.wonNumber = 0
    this.salt = 0
    this.hash = 0
    this.time = 0
    this.users = []
    this.isStarted = false
    this.newGame()
313>  setInterval(() => { this.tick() }, 1000)
  }

  newGame () {
    this.wonNumber = random.integer(0, 53)
    this.salt = random.string(random.integer(6, 14))
    this.hash = crypto.createHash('sha256').update(`${this.wonNumber}|${this.salt}`).digest('hex')
    this.time = 40
    this.users = []
    this.isStarted = false
    console.log(this)
  }
  • Вопрос задан
  • 77 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы