small update

This commit is contained in:
Boki 2025-06-24 08:17:44 -04:00
parent efc734ca9e
commit 28b9822d55
3 changed files with 5 additions and 47 deletions

View file

@ -1,16 +1,10 @@
import { getRandomUserAgent } from '@stock-bot/utils';
import type { CeoHandler } from '../ceo.handler';
interface ProcessIndividualSymbolPayload {
ceoId: string;
symbol: string;
timestamp?: string;
}
export async function processIndividualSymbol(
this: CeoHandler,
payload: ProcessIndividualSymbolPayload,
_context: unknown
payload: any,
_context: any
): Promise<unknown> {
const { ceoId, symbol, timestamp } = payload;
const proxy = this.proxy?.getProxy();
@ -48,27 +42,7 @@ export async function processIndividualSymbol(
return null; // No data to process
}
const latestSpielTime = data.spiels[0]?.timestamp;
interface Spiel {
spiel: string;
spiel_reply_to_id: string;
spiel_reply_to: string;
spiel_reply_to_name: string;
spiel_reply_to_edited: boolean;
user_id: string;
name: string;
timestamp: string;
spiel_id: string;
color: string;
parent_id: string;
public_id: string;
parent_channel: string;
parent_timestamp: string;
votes: number;
editable: boolean;
edited: boolean;
}
const posts = data.spiels.map((spiel: Spiel) => ({
const posts = data.spiels.map((spiel: any) => ({
ceoId,
spiel: spiel.spiel,
spielReplyToId: spiel.spiel_reply_to_id,

View file

@ -32,23 +32,9 @@ export async function updateCeoChannels(
const totalChannels = results.channel_categories[0].total_channels;
const totalPages = Math.ceil(totalChannels / channels.length);
const exchanges: { exchange: string; countryCode: string }[] = [];
interface Channel {
symbol: string;
exchange: string;
title: string;
type: string;
channel: string;
spiel_count: number;
unread_count: number;
is_following: boolean;
last_viewed_timestamp: string;
last_timestamp: string;
company_details?: Record<string, unknown>;
}
const symbols = channels.map((channel: Channel) => {
const symbols = channels.map((channel: any) => {
// check if exchange is in the exchanges array object
if (!exchanges.find((e) => e.exchange === channel.exchange)) {
if (!exchanges.find((e: any) => e.exchange === channel.exchange)) {
exchanges.push({
exchange: channel.exchange,
countryCode: 'CA',