Skip to content

Commit

Permalink
feat: use zeepki.st instead of zeepkist.wopian.me (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
wopian committed Apr 7, 2023
1 parent 886d968 commit 3f48b3c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
9 changes: 5 additions & 4 deletions src/commands/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { HTTPError } from 'ky-universal'

import { Command } from '../command.js'
import { listRecords } from '../components/lists/listRecords.js'
import { STEAM_URL, ZEEPKIST_URL } from '../constants.js'
import { database } from '../services/database.js'
import { getPlayerSummaries } from '../services/steam.js'
import {
Expand All @@ -38,7 +39,7 @@ const addDiscordAuthor = (
embed.setAuthor({
name: linkedAccount.username,
iconURL: linkedAccount.avatarURL() ?? '',
url: `https://zeepkist.wopian.me/user/${steamId}`
url: `${ZEEPKIST_URL}/user/${steamId}`
})
if (linkedAccount.hexAccentColor) {
embed.setColor(linkedAccount.hexAccentColor)
Expand Down Expand Up @@ -198,7 +199,7 @@ export const user: Command = {
const embed = new EmbedBuilder()
.setColor(0xff_92_00)
.setTitle(`${user.steamName}'s Stats`)
.setURL(`https://zeepkist.wopian.me/user/${user.steamId}`)
.setURL(`${ZEEPKIST_URL}/user/${user.steamId}`)
.setThumbnail(steamUser.avatarfull)
.addFields(
{
Expand Down Expand Up @@ -328,11 +329,11 @@ export const user: Command = {
new ButtonBuilder()
.setStyle(ButtonStyle.Link)
.setLabel('More Stats')
.setURL(`https://zeepkist.wopian.me/user/${user.steamId}`),
.setURL(`${ZEEPKIST_URL}/user/${user.steamId}`),
new ButtonBuilder()
.setStyle(ButtonStyle.Link)
.setLabel('Steam Profile')
.setURL(`https://steamcommunity.com/profiles/${user.steamId}`)
.setURL(`${STEAM_URL}/profiles/${user.steamId}`)
])

log.info(`Sending message`, interaction)
Expand Down
7 changes: 3 additions & 4 deletions src/components/paginated/paginatedLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
EmbedBuilder
} from 'discord.js'

import { STEAM_URL, ZEEPKIST_URL } from '../../constants.js'
import { log } from '../../utils/index.js'
import { addMedalTimes } from '../fields/addMedalTimes.js'
import { addPersonalBest } from '../fields/addPersonalBest.js'
Expand Down Expand Up @@ -87,17 +88,15 @@ export const paginatedLevel = async (properties: PaginatedData) => {
new ButtonBuilder()
.setStyle(ButtonStyle.Link)
.setLabel('More Stats')
.setURL(`https://zeepkist.wopian.me/level/${level.id}`)
.setURL(`${ZEEPKIST_URL}/level/${level.id}`)
])

if (level.workshopId !== '0') {
buttons.addComponents([
new ButtonBuilder()
.setStyle(ButtonStyle.Link)
.setLabel('Subscribe to Level')
.setURL(
`https://steamcommunity.com/sharedfiles/filedetails/?id=${level.workshopId}`
)
.setURL(`${STEAM_URL}/sharedfiles/filedetails/?id=${level.workshopId}`)
])
}

Expand Down
4 changes: 4 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ import { config } from 'dotenv'

config()

export const ZEEPKIST_URL = 'https://zeepki.st'
export const STEAM_URL = 'https://steamcommunity.com/'

export const API_URL = 'https://api.zeepkist-gtr.com/'
export const STEAM_API_URL = 'https://api.steampowered.com/'
export const GITHUB_API_URL = 'https://api.github.com/'

export const IS_PRODUCTION = Boolean(process.env.ZEEPKIST_BOT_PRODUCTION)
export const PAGINATION_LIMIT = 10
3 changes: 2 additions & 1 deletion src/listeners/ready.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActivityType, Client } from 'discord.js'

import { commands } from '../commands.js'
import { ZEEPKIST_URL } from '../constants.js'
import { log } from '../utils/index.js'

export default async (client: Client) => {
Expand All @@ -13,7 +14,7 @@ export default async (client: Client) => {
{
type: ActivityType.Watching,
name: 'Zeepkist',
url: 'https://zeepkist.wopian.me'
url: ZEEPKIST_URL
}
],
status: 'online'
Expand Down
4 changes: 2 additions & 2 deletions src/utils/format.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test(
'displays level link',
macro,
formatLevel(level),
'[Level 1](https://zeepkist.wopian.me/level/1) by _Author Name_'
'[Level 1](https://zeepki.st/level/1) by _Author Name_'
)

// formatUser
Expand All @@ -53,7 +53,7 @@ test(
'displays user link',
macro,
formatUser(user),
'[User Name](https://zeepkist.wopian.me/user/2)'
'[User Name](https://zeepki.st/user/2)'
)

// formatOrdinal
Expand Down
10 changes: 5 additions & 5 deletions src/utils/format.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { formatDistanceToNowStrict } from 'date-fns'
import { bold, hyperlink, italic } from 'discord.js'

import { ZEEPKIST_URL } from '../constants.js'
import { Level } from '../models/level.js'
import { User } from '../models/user.js'
import { numberToMonospace } from './index.js'
Expand All @@ -9,13 +10,12 @@ export const formatRank = (rank: number): string =>
bold(`${numberToMonospace(rank)}`.padStart(3, ' '))

export const formatLevel = (level: Level): string =>
`${hyperlink(
level.name,
`https://zeepkist.wopian.me/level/${level.id}`
)} by ${italic(level.author)}`
`${hyperlink(level.name, `${ZEEPKIST_URL}/level/${level.id}`)} by ${italic(
level.author
)}`

export const formatUser = (user: User): string =>
hyperlink(user.steamName, `https://zeepkist.wopian.me/user/${user.steamId}`)
hyperlink(user.steamName, `${ZEEPKIST_URL}/user/${user.steamId}`)

export const formatRelativeDate = (date: string) => {
return formatDistanceToNowStrict(new Date(date), {
Expand Down

0 comments on commit 3f48b3c

Please sign in to comment.