1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- import TwitterTypes from 'twitter-d';
- import QQBot from './koishi';
- interface IWorkerOption {
- lock: ILock;
- lockfile: string;
- bot: QQBot;
- workInterval: number;
- webshotDelay: number;
- consumerKey: string;
- consumerSecret: string;
- accessTokenKey: string;
- accessTokenSecret: string;
- mode: number;
- wsUrl: string;
- }
- export declare class ScreenNameNormalizer {
- static _queryUser: (username: string) => Promise<string>;
- static normalize: (username: string) => string;
- static normalizeLive(username: string): Promise<string>;
- }
- export declare let sendTweet: (id: string, receiver: IChat) => void;
- export interface ITimelineQueryConfig {
- username: string;
- count?: number;
- since?: string;
- until?: string;
- noreps?: boolean;
- norts?: boolean;
- }
- export declare let sendTimeline: (conf: {
- username: string;
- count?: string;
- since?: string;
- until?: string;
- noreps?: string;
- norts?: string;
- }, receiver: IChat) => void;
- export declare type FullUser = TwitterTypes.FullUser;
- export declare type Entities = TwitterTypes.Entities;
- export declare type ExtendedEntities = TwitterTypes.ExtendedEntities;
- export declare type MediaEntity = TwitterTypes.MediaEntity;
- interface ITweet extends TwitterTypes.Status {
- user: FullUser;
- retweeted_status?: Tweet;
- }
- export declare type Tweet = ITweet;
- export declare type Tweets = ITweet[];
- export default class {
- private client;
- private lock;
- private lockfile;
- private workInterval;
- private bot;
- private webshotDelay;
- private webshot;
- private mode;
- private wsUrl;
- constructor(opt: IWorkerOption);
- launch: () => void;
- queryUser: (username: string) => Promise<string>;
- queryTimelineReverse: (conf: ITimelineQueryConfig) => Promise<ITweet[]>;
- queryTimeline: ({ username, count, since, until, noreps, norts }: ITimelineQueryConfig) => Promise<ITweet[]>;
- private workOnTweets;
- getTweet: (id: string, sender: (msg: string, text: string, author: string) => void) => Promise<void>;
- private sendTweets;
- work: () => void;
- }
- export {};
|