fix small error

This commit is contained in:
The Foxon 2023-07-14 00:33:27 +12:00
parent 9d2fb05c34
commit b8e81b4248

View File

@ -41,8 +41,8 @@ export default class ChatController {
try {
const ch = await global.client.channels.fetch(config.chatChannelId)
const t = global.config.messageTime + 0.001
const time = (t / 3600 / 24).toFixed(100)
const t = global.config.messageTime
const time = (t / 3600 / 24).toString()
const { data, status } = await axios.get<MessageI[]>(
`${process.env.ECO_API_BASE || "https://eco.kamgames.xyz"}/api/v1/chat?startDay=${time}`, {
timeout: 5000,
@ -56,6 +56,8 @@ export default class ChatController {
return false
}
console.log(data)
if (data.length === 0) {
isSyncing = false
return true
@ -63,6 +65,7 @@ export default class ChatController {
const messages = data
if (!ch || !ch.isTextBased()) {
isSyncing = false
return false