Skip to content

Commit 171a54a

Browse files
committed
🔄️ update schema every 2 minutes
1 parent 59b46ec commit 171a54a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/classes/SchemaManager.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import axios from 'axios';
33
import log from '../lib/logger';
44
import { Webhook } from '../types/DiscordWebhook';
55
import * as timersPromises from 'timers/promises';
6-
import filterAxiosError from '@tf2autobot/filter-axios-error';
76
import fs from 'fs';
87
import path from 'path';
98

@@ -41,7 +40,7 @@ export default class SchemaManager {
4140
return new Promise((resolve, reject) => {
4241
this.schemaManager = new SchemaTF2({
4342
apiKey: process.env.STEAM_API_KEY,
44-
updateTime: 5 * 60 * 1000
43+
updateTime: 2 * 60 * 1000
4544
});
4645

4746
this.schemaManager.init(err => {
@@ -353,7 +352,7 @@ function constructWebhook({
353352
description: string;
354353
color: string;
355354
}): Webhook {
356-
return {
355+
const toReturn = {
357356
username: 'Schema.autobot.tf',
358357
avatar_url: 'https://autobot.tf/images/tf2autobot.png',
359358
embeds: [
@@ -367,6 +366,8 @@ function constructWebhook({
367366
}
368367
]
369368
};
369+
log.debug('discord: ', toReturn);
370+
return toReturn;
370371
}
371372

372373
type WebhookType = 'items' | 'effects' | 'paintkits' | 'skus';

0 commit comments

Comments
 (0)