mirror of
https://github.com/TheNetsky/Microsoft-Rewards-Script.git
synced 2026-01-21 23:43:57 +00:00
v3 init
Based of v3.0.0b10.
This commit is contained in:
91
src/functions/Activities.ts
Normal file
91
src/functions/Activities.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
import type { MicrosoftRewardsBot } from '../index'
|
||||
import type { Page } from 'patchright'
|
||||
|
||||
// App
|
||||
import { DailyCheckIn } from './activities/app/DailyCheckIn'
|
||||
import { ReadToEarn } from './activities/app/ReadToEarn'
|
||||
import { AppReward } from './activities/app/AppReward'
|
||||
|
||||
// API
|
||||
import { UrlReward } from './activities/api/UrlReward'
|
||||
import { Quiz } from './activities/api/Quiz'
|
||||
import { FindClippy } from './activities/api/FindClippy'
|
||||
|
||||
// Browser
|
||||
import { SearchOnBing } from './activities/browser/SearchOnBing'
|
||||
import { Search } from './activities/browser/Search'
|
||||
|
||||
import type { BasePromotion, DashboardData, FindClippyPromotion } from '../interface/DashboardData'
|
||||
import type { Promotion } from '../interface/AppDashBoardData'
|
||||
|
||||
export default class Activities {
|
||||
private bot: MicrosoftRewardsBot
|
||||
|
||||
constructor(bot: MicrosoftRewardsBot) {
|
||||
this.bot = bot
|
||||
}
|
||||
|
||||
// Browser Activities
|
||||
doSearch = async (data: DashboardData, page: Page, isMobile: boolean): Promise<number> => {
|
||||
const search = new Search(this.bot)
|
||||
return await search.doSearch(data, page, isMobile)
|
||||
}
|
||||
|
||||
doSearchOnBing = async (promotion: BasePromotion, page: Page): Promise<void> => {
|
||||
const searchOnBing = new SearchOnBing(this.bot)
|
||||
await searchOnBing.doSearchOnBing(promotion, page)
|
||||
}
|
||||
|
||||
/*
|
||||
doABC = async (page: Page): Promise<void> => {
|
||||
const abc = new ABC(this.bot)
|
||||
await abc.doABC(page)
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
doPoll = async (page: Page): Promise<void> => {
|
||||
const poll = new Poll(this.bot)
|
||||
await poll.doPoll(page)
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
doThisOrThat = async (page: Page): Promise<void> => {
|
||||
const thisOrThat = new ThisOrThat(this.bot)
|
||||
await thisOrThat.doThisOrThat(page)
|
||||
}
|
||||
*/
|
||||
|
||||
// API Activities
|
||||
doUrlReward = async (promotion: BasePromotion): Promise<void> => {
|
||||
const urlReward = new UrlReward(this.bot)
|
||||
await urlReward.doUrlReward(promotion)
|
||||
}
|
||||
|
||||
doQuiz = async (promotion: BasePromotion): Promise<void> => {
|
||||
const quiz = new Quiz(this.bot)
|
||||
await quiz.doQuiz(promotion)
|
||||
}
|
||||
|
||||
doFindClippy = async (promotions: FindClippyPromotion): Promise<void> => {
|
||||
const urlReward = new FindClippy(this.bot)
|
||||
await urlReward.doFindClippy(promotions)
|
||||
}
|
||||
|
||||
// App Activities
|
||||
doAppReward = async (promotion: Promotion): Promise<void> => {
|
||||
const urlReward = new AppReward(this.bot)
|
||||
await urlReward.doAppReward(promotion)
|
||||
}
|
||||
|
||||
doReadToEarn = async (): Promise<void> => {
|
||||
const readToEarn = new ReadToEarn(this.bot)
|
||||
await readToEarn.doReadToEarn()
|
||||
}
|
||||
|
||||
doDailyCheckIn = async (): Promise<void> => {
|
||||
const dailyCheckIn = new DailyCheckIn(this.bot)
|
||||
await dailyCheckIn.doDailyCheckIn()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user