Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
class GiftService
Re-export
import { GiftService } from "https://deno.land/x/sptaki@1.2.0/services/mod.ts";

Constructors

new
GiftService(
logger: ILogger,
mailSendService: MailSendService,
hashUtil: HashUtil,
timeUtil: TimeUtil,
profileHelper: ProfileHelper,
configServer: ConfigServer,
)

Properties

protected
configServer: ConfigServer
protected
giftConfig: IGiftsConfig
protected
hashUtil: HashUtil
protected
logger: ILogger
protected
mailSendService: MailSendService
protected
profileHelper: ProfileHelper
protected
timeUtil: TimeUtil

Methods

protected
getMessageType(giftData: Gift): MessageType

Convert GiftSenderType into a dialog MessageType

protected
getSenderId(giftData: Gift): string

Get sender id based on gifts sender type enum

giftExists(giftId: string): boolean

Does a gift with a specific ID exist in db

sendGiftToPlayer(playerId: string, giftId: string): GiftSentResult

Send player a gift from a range of sources

sendPraporStartingGift(sessionId: string, day: number): void

Prapor sends gifts to player for first week after profile creation