Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Classes/APIBots/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export function getProjectSlugUrl(slug: string): string {
}

export function getProjectUrl(contractAddr: string, projectId: string): string {
return `https://www.artblocks.io/collections/${contractAddr}-${projectId}`
return `https://www.artblocks.io/collection/${contractAddr}-${projectId}`
}

export function buildArtBlocksTokenURL(
Expand Down
5 changes: 1 addition & 4 deletions src/Classes/ArtIndexerBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
getProjectUrl,
getProjectSlugUrl,
} from './APIBots/utils'
import { ProjectConfig } from '../ProjectConfig/projectConfig'
import { randomColor } from '../Utils/smartBotResponse'
dotenv.config()

Expand Down Expand Up @@ -730,8 +729,6 @@ export class ArtIndexerBot {

async checkBirthdays(
channels: Collection<string, Channel>,
projectConfig: ProjectConfig,
artistChannel: boolean
) {
const now = new Date()
const [year, month, day] = now.toISOString().split('T')[0].split('-')
Expand All @@ -744,7 +741,7 @@ export class ArtIndexerBot {
projBot.startTime.getFullYear().toString() !== year &&
!sentMessages[projBot.id]
) {
projBot.sendBirthdayMessage(channels, projectConfig, artistChannel)
projBot.sendBirthdayMessage(channels)
sentMessages[projBot.id] = true
}
})
Expand Down
17 changes: 1 addition & 16 deletions src/Classes/ProjectBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
getProjectUrl,
getTokenApiUrl,
getTokenUrl,
isCoreContract,
} from './APIBots/utils'

import { ensOrAddress, replaceVideoWithGIF } from './APIBots/utils'
Expand All @@ -25,7 +24,6 @@ import {
getLowestPricedTokenByProject,
} from '../Data/queryGraphQL'
import { CHANNEL_BLOCK_TALK, discordClient, triviaBot } from '..'
import { ProjectConfig } from '../ProjectConfig/projectConfig'
import { ProjectHandlerHelper } from './ProjectHandlerHelper'
import { UpcomingProjectDetailFragment } from '../../generated/graphql'
import { getDayName, getMonthName, getDayOfMonth } from '../Utils/common'
Expand Down Expand Up @@ -353,8 +351,6 @@ export class ProjectBot {

async sendBirthdayMessage(
channels: Collection<string, Channel>,
projectConfig: ProjectConfig,
artistChannel: boolean
) {
try {
console.log('sending birthday message(s) for:', this.projectName)
Expand Down Expand Up @@ -398,20 +394,9 @@ export class ProjectBot {
})

// Send all birthdays to #block-talk
let channel = channels.get(CHANNEL_BLOCK_TALK) as TextChannel
const channel = channels.get(CHANNEL_BLOCK_TALK) as TextChannel
channel?.send({ embeds: [embedContent] })

if (
artistChannel &&
isCoreContract(this.coreContract) &&
projectConfig.projectToChannel[this.projectNumber]
) {
// Send in artist channel if one exists
channel = channels.get(
projectConfig.projectToChannel[this.projectNumber]
) as TextChannel
channel.send({ embeds: [embedContent] })
}
} catch (err) {
console.error(
'Error sending birthday message for:',
Expand Down
7 changes: 0 additions & 7 deletions src/Classes/SchedulerBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,8 @@ export class ScheduleBot {
{ timezone: 'America/Chicago', name: 'Bday' },
() => {
console.log('Birthday Time!')
const now = new Date()
const hour = now.toLocaleString('en-US', {
timeZone: 'America/Chicago',
hour: 'numeric',
})
artIndexerBot.checkBirthdays(
this.channels,
this.projectConfig,
hour.includes('9') // Only post in artist channels at 9am runtime
)
}
)
Expand Down