Skip to content

Commit

Permalink
Revert "[TEMP] migrate to .co domain"
Browse files Browse the repository at this point in the history
This reverts commit f4d8cee.
  • Loading branch information
StarManTheGamer committed Jul 6, 2024
1 parent 4a5ec2c commit 3f990e8
Show file tree
Hide file tree
Showing 30 changed files with 86 additions and 86 deletions.
2 changes: 1 addition & 1 deletion src/commands/blog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function blog (interaction: CommandInteraction) {

try {
const getData = async () => {
const response = await axios.get(`https://blog.polytoria.co/ghost/api/content/posts/?key=ac0766ccda2a1b1cc23ab02ebd&fields=title,url,meta_description,feature_image,published_at&include=tags,authors&limit=1&page=${currentPage}`)
const response = await axios.get(`https://blog.polytoria.com/ghost/api/content/posts/?key=ac0766ccda2a1b1cc23ab02ebd&fields=title,url,meta_description,feature_image,published_at&include=tags,authors&limit=1&page=${currentPage}`)
const data = response.data
const posts = data.posts
return posts[0]
Expand Down
4 changes: 2 additions & 2 deletions src/commands/guild/GuildMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios'

export async function fetchMembers (id: number, page: number) {
// Fetch the members data from the API
const memberResponse = await axios.get(`https://api.polytoria.co/v1/guilds/${id}/members?page=${page}&limit=15`)
const memberResponse = await axios.get(`https://api.polytoria.com/v1/guilds/${id}/members?page=${page}&limit=15`)
const memberData = memberResponse.data.members
const totalMembers = memberResponse.data.total
const totalPages = memberResponse.data.pages
Expand All @@ -14,7 +14,7 @@ export async function fetchMembers (id: number, page: number) {

// Prepare the members' usernames list
const memberUsernames = memberData
.map((member: any) => `[${member.user.username}](https://polytoria.co/users/${member.user.id})`)
.map((member: any) => `[${member.user.username}](https://polytoria.com/users/${member.user.id})`)
.join('\n')

// Format and return the result string
Expand Down
4 changes: 2 additions & 2 deletions src/commands/guild/GuildShouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export async function fetchShouts (guildID: number, page: number): Promise<strin
let allShouts: any[] = []

async function fetchPage (pageNumber: number) {
const response = await axios.get(`https://polytoria.co/api/guilds/${guildID}/shouts?page=${pageNumber}`)
const response = await axios.get(`https://polytoria.com/api/guilds/${guildID}/shouts?page=${pageNumber}`)
const data = response.data

if (data.meta) {
Expand All @@ -23,7 +23,7 @@ export async function fetchShouts (guildID: number, page: number): Promise<strin
}

const shouts = allShouts.map((shout: any) => {
return `**${shout.title}**\n${shout.content}\n*Posted by [${shout.author.username}](https://polytoria.co/users/${shout.author.id})*`
return `**${shout.title}**\n${shout.content}\n*Posted by [${shout.author.username}](https://polytoria.com/users/${shout.author.id})*`
})

return shouts.join('\n\n')
Expand Down
4 changes: 2 additions & 2 deletions src/commands/guild/GuildStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios'

export async function fetchStore (id: number, page: number) {
// Fetch the store data from the API
const storeResponse = await axios.get(`https://api.polytoria.co/v1/guilds/${id}/store?page=${page}&limit=15`)
const storeResponse = await axios.get(`https://api.polytoria.com/v1/guilds/${id}/store?page=${page}&limit=15`)
const storeData = storeResponse.data.assets
const totalAssets = storeResponse.data.total
const totalPages = storeResponse.data.pages
Expand All @@ -14,7 +14,7 @@ export async function fetchStore (id: number, page: number) {

// Prepare the store assets list
const storeItems = storeData
.map((item: any, index: number) => `\`\`${(index + 1) + (page - 1) * 15}\`\` [${item.name}](https://polytoria.co/store/${item.id})`)
.map((item: any, index: number) => `\`\`${(index + 1) + (page - 1) * 15}\`\` [${item.name}](https://polytoria.com/store/${item.id})`)
.join('\n')

// Format and return the result string
Expand Down
12 changes: 6 additions & 6 deletions src/commands/guild/guilds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function guild (interaction:CommandInteraction) {

await interaction.deferReply()

const response = await axios.get(`https://api.polytoria.co/v1/guilds/${guildID}`, { validateStatus: () => true })
const response = await axios.get(`https://api.polytoria.com/v1/guilds/${guildID}`, { validateStatus: () => true })
const data = response.data
const creator = data.creator

Expand Down Expand Up @@ -48,13 +48,13 @@ export async function guild (interaction:CommandInteraction) {
const embed = new EmbedBuilder()
.setTitle(data.name + ' ' + (data.isVerified === true ? emojiUtils.checkmark : ''))
.setDescription(data.description === '' ? 'No description set.' : data.description)
.setURL('https://polytoria.co/guilds/' + data.id.toString())
.setURL('https://polytoria.com/guilds/' + data.id.toString())
.setThumbnail(data.thumbnail)
.setColor(data.color)
.addFields(
{
name: 'Creator',
value: `[${creator.name}](https://polytoria.co/users/${creator.id})`,
value: `[${creator.name}](https://polytoria.com/users/${creator.id})`,
inline: true
},
{
Expand Down Expand Up @@ -87,19 +87,19 @@ export async function guild (interaction:CommandInteraction) {
.setTitle(data.name + ' - Members ' + (data.isVerified === true ? emojiUtils.checkmark : ''))
.setThumbnail(data.thumbnail)
.setColor(data.color)
.setURL('https://polytoria.co/guilds/' + data.id.toString())
.setURL('https://polytoria.com/guilds/' + data.id.toString())

const storeEmbed = new EmbedBuilder()
.setTitle(data.name + ' - Store ' + (data.isVerified === true ? emojiUtils.checkmark : ''))
.setThumbnail(data.thumbnail)
.setColor(data.color)
.setURL('https://polytoria.co/guilds/' + data.id.toString())
.setURL('https://polytoria.com/guilds/' + data.id.toString())

const shoutsEmbed = new EmbedBuilder()
.setTitle(data.name + ' - Shouts ' + (data.isVerified === true ? emojiUtils.checkmark : ''))
.setThumbnail(data.thumbnail)
.setColor(data.color)
.setURL('https://polytoria.co/guilds/' + data.id.toString())
.setURL('https://polytoria.com/guilds/' + data.id.toString())

const dropdown = new StringSelectMenuBuilder()
.setCustomId('dropdown_menu')
Expand Down
8 changes: 4 additions & 4 deletions src/commands/place.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function place (interaction:CommandInteraction) {

await interaction.deferReply()

const response = await axios.get(`https://api.polytoria.co/v1/places/${placeID}`, { validateStatus: () => true })
const response = await axios.get(`https://api.polytoria.com/v1/places/${placeID}`, { validateStatus: () => true })
const data = response.data
const rating = data.rating
const creator = data.creator
Expand Down Expand Up @@ -66,12 +66,12 @@ export async function place (interaction:CommandInteraction) {
thumbnail: {
url: `${data.thumbnail}`
},
url: `https://polytoria.co/places/${data.id}`,
url: `https://polytoria.com/places/${data.id}`,
color: 0xFF5454,
fields: [
{
name: 'Creator',
value: `[${creator.name}](https://polytoria.co/users/${creator.id})`,
value: `[${creator.name}](https://polytoria.com/users/${creator.id})`,
inline: true
},
{
Expand Down Expand Up @@ -120,7 +120,7 @@ export async function place (interaction:CommandInteraction) {
const actionRow = new ActionRowBuilder<ButtonBuilder>()
.addComponents(
new ButtonBuilder()
.setURL(`https://polytoria.co/places/${data.id}`)
.setURL(`https://polytoria.com/places/${data.id}`)
.setLabel('View on Polytoria')
.setStyle(ButtonStyle.Link)
)
Expand Down
8 changes: 4 additions & 4 deletions src/commands/random/randomGuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { randomUtils } from '../../utils/randomUtils.js'

export async function randomGuild (interaction: CommandInteraction): Promise<any> {
const randomId = randomUtils.randomInt(1, 545)
const apiUrl = `https://api.polytoria.co/v1/guilds/${randomId}`
const apiUrl = `https://api.polytoria.com/v1/guilds/${randomId}`

const randomData = await randomUtils.randomize(
apiUrl,
Expand All @@ -28,13 +28,13 @@ export async function randomGuild (interaction: CommandInteraction): Promise<any
const embed = new EmbedBuilder()
.setTitle(data.name + ' ' + (data.isVerified === true ? emojiUtils.checkmark : ''))
.setDescription(data.description === '' ? 'No description set.' : data.description)
.setURL('https://polytoria.co/guilds/' + data.id.toString())
.setURL('https://polytoria.com/guilds/' + data.id.toString())
.setThumbnail(data.thumbnail)
.setColor(data.color)
.addFields(
{
name: 'Creator',
value: `[${creator.name}](https://polytoria.co/users/${creator.id})`,
value: `[${creator.name}](https://polytoria.com/users/${creator.id})`,
inline: true
},
{
Expand Down Expand Up @@ -71,7 +71,7 @@ export async function randomGuild (interaction: CommandInteraction): Promise<any
const actionRow = new ActionRowBuilder<ButtonBuilder>()
.addComponents(
new ButtonBuilder()
.setURL(`https://polytoria.co/guilds/${data.id}`)
.setURL(`https://polytoria.com/guilds/${data.id}`)
.setLabel('View on Polytoria')
.setStyle(ButtonStyle.Link),
redoButton
Expand Down
6 changes: 3 additions & 3 deletions src/commands/random/randomPlace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import emojiUtils from '../../utils/emojiUtils.js'

export async function randomPlace (interaction: CommandInteraction): Promise<any> {
const randomId = randomUtils.randomInt(1, 7940)
const apiUrl = `https://api.polytoria.co/v1/places/${randomId}`
const apiUrl = `https://api.polytoria.com/v1/places/${randomId}`

const randomData = await randomUtils.randomize(
apiUrl,
Expand Down Expand Up @@ -63,12 +63,12 @@ export async function randomPlace (interaction: CommandInteraction): Promise<any
thumbnail: {
url: `${data.thumbnail}`
},
url: `https://polytoria.co/places/${data.id}`,
url: `https://polytoria.com/places/${data.id}`,
color: 0xFF5454,
fields: [
{
name: 'Creator',
value: `[${creator.name}](https://polytoria.co/users/${creator.id})`,
value: `[${creator.name}](https://polytoria.com/users/${creator.id})`,
inline: true
},
{
Expand Down
10 changes: 5 additions & 5 deletions src/commands/random/randomStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import emojiUtils from '../../utils/emojiUtils.js'

export async function randomStore (interaction: CommandInteraction): Promise<any> {
const randomId = randomUtils.randomInt(7674, 30361)
const apiUrl = `https://api.polytoria.co/v1/store/${randomId}`
const apiUrl = `https://api.polytoria.com/v1/store/${randomId}`

const randomData = await randomUtils.randomize(
apiUrl,
Expand Down Expand Up @@ -33,13 +33,13 @@ export async function randomStore (interaction: CommandInteraction): Promise<any
}

const creatorLink = creator.type === 'user'
? `https://polytoria.co/users/${creator.id}`
: `https://polytoria.co/guilds/${creator.id}`
? `https://polytoria.com/users/${creator.id}`
: `https://polytoria.com/guilds/${creator.id}`

const embed = new EmbedBuilder({
title: data.name + ' ' + (data.isLimited === true ? emojiUtils.star : ''),
description: data.description === '' ? 'No description set.' : data.description,
url: `https://polytoria.co/store/${data.id}`,
url: `https://polytoria.com/store/${data.id}`,
thumbnail: {
url: thumbnailURL
},
Expand Down Expand Up @@ -87,7 +87,7 @@ export async function randomStore (interaction: CommandInteraction): Promise<any
const actionRow = new ActionRowBuilder<ButtonBuilder>()
.addComponents(
new ButtonBuilder()
.setURL(`https://polytoria.co/store/${data.id}`)
.setURL(`https://polytoria.com/store/${data.id}`)
.setLabel('View on Polytoria')
.setStyle(ButtonStyle.Link),
redoButton
Expand Down
8 changes: 4 additions & 4 deletions src/commands/random/randomUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import emojiUtils from '../../utils/emojiUtils.js'

export async function randomUser (interaction: CommandInteraction): Promise<any> {
const randomId = randomUtils.randomInt(1, 42260)
const apiUrl = `https://api.polytoria.co/v1/users/${randomId}`
const apiUrl = `https://api.polytoria.com/v1/users/${randomId}`

const randomData = await randomUtils.randomize(
apiUrl,
Expand Down Expand Up @@ -35,7 +35,7 @@ export async function randomUser (interaction: CommandInteraction): Promise<any>

const embed = new EmbedBuilder({
title: data.username + badges,
url: `https://polytoria.co/users/${data.id}`,
url: `https://polytoria.com/users/${data.id}`,
description: data.description,
color: 0xFF5454,
thumbnail: {
Expand Down Expand Up @@ -86,7 +86,7 @@ export async function randomUser (interaction: CommandInteraction): Promise<any>
})

if (data.playing && data.playing.name) {
const gameLink = `https://polytoria.co/places/${data.playing.placeID}`
const gameLink = `https://polytoria.com/places/${data.playing.placeID}`
const playingMessage = emojiUtils.playing + `** Currently playing [${data.playing.name}](${gameLink})**`
embed.setDescription(playingMessage + '\n\n' + data.description)
}
Expand All @@ -99,7 +99,7 @@ export async function randomUser (interaction: CommandInteraction): Promise<any>
const actionRow = new ActionRowBuilder<ButtonBuilder>()
.addComponents(
new ButtonBuilder()
.setURL(`https://polytoria.co/users/${data.id}`)
.setURL(`https://polytoria.com/users/${data.id}`)
.setLabel('View on Polytoria')
.setStyle(ButtonStyle.Link),
redoButton
Expand Down
4 changes: 2 additions & 2 deletions src/commands/search/place-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function placeSearch (interaction:CommandInteraction) {
await interaction.deferReply()

const response = await axios.get(
`https://polytoria.co/api/places?page=1&search=${searchQuery}&genre=all&sort=popular`,
`https://polytoria.com/api/places?page=1&search=${searchQuery}&genre=all&sort=popular`,
{ params: {}, validateStatus: () => true }
)
const data = response.data.data
Expand All @@ -35,7 +35,7 @@ export async function placeSearch (interaction:CommandInteraction) {

const topPlaces = data.slice(0, 15)
for (const place of topPlaces) {
description += `\`${index}\` [${place.name}](https://polytoria.co/places/${place.id}) ${
description += `\`${index}\` [${place.name}](https://polytoria.com/places/${place.id}) ${
''
}\n`
index++
Expand Down
4 changes: 2 additions & 2 deletions src/commands/search/store-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function storeSearch (interaction:CommandInteraction) {
await interaction.deferReply()

const response = await axios.get(
`https://polytoria.co/api/store/items?types[]=hat&types[]=tool&types[]=face&types[]=shirt&types[]=pants&page=1&search=${searchQuery}&sort=createdAt&order=desc&showOffsale=false&collectiblesOnly=false`,
`https://polytoria.com/api/store/items?types[]=hat&types[]=tool&types[]=face&types[]=shirt&types[]=pants&page=1&search=${searchQuery}&sort=createdAt&order=desc&showOffsale=false&collectiblesOnly=false`,
{ params: {}, validateStatus: () => true }
)
const data = response.data.data
Expand All @@ -35,7 +35,7 @@ export async function storeSearch (interaction:CommandInteraction) {
let description = ''

for (const item of data) {
description += `\`${index}\` [${item.name}](https://polytoria.co/store/${item.id}) ${
description += `\`${index}\` [${item.name}](https://polytoria.com/store/${item.id}) ${
item.isLimited === true ? emojiUtils.star : ''
}\n`
index++
Expand Down
6 changes: 3 additions & 3 deletions src/commands/search/toolbox-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export async function toolbox (interaction:CommandInteraction) {

await interaction.deferReply()

const apiURL = 'https://polytoria.co/api/library?page=1' + searchQuery + '&type=model'
const apiURL = 'https://polytoria.com/api/library?page=1' + searchQuery + '&type=model'

const response = await axios.get(apiURL, { validateStatus: () => true })
const meta = response.data.meta

// Change Page Function, Fetch current page
async function changePage (): Promise<string> {
const apiURL = 'https://polytoria.co/api/library' + '?page=' + currentPage + searchQuery + '&type=model'
const apiURL = 'https://polytoria.com/api/library' + '?page=' + currentPage + searchQuery + '&type=model'

const response = await axios.get(apiURL, { validateStatus: () => true })
let resultString: string = ''
Expand All @@ -34,7 +34,7 @@ export async function toolbox (interaction:CommandInteraction) {

// @ts-expect-error
response.data.data.forEach((data) => {
resultString += `[${data.name}](https://polytoria.co/models/${data.id})\n`
resultString += `[${data.name}](https://polytoria.com/models/${data.id})\n`
})

return resultString
Expand Down
4 changes: 2 additions & 2 deletions src/commands/search/user-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function userSearch (interaction:CommandInteraction) {
await interaction.deferReply()

const response = await axios.get(
`https://api.polytoria.co/v1/users?search=${searchQuery}&limit=15`,
`https://api.polytoria.com/v1/users?search=${searchQuery}&limit=15`,
{ params: {}, validateStatus: () => true }
)
const data = response.data.users
Expand All @@ -35,7 +35,7 @@ export async function userSearch (interaction:CommandInteraction) {
let description = ''

for (const user of data) {
description += `\`${index}\` [${user.username}](https://polytoria.co/users/${user.id}) ${
description += `\`${index}\` [${user.username}](https://polytoria.com/users/${user.id}) ${
user.isStaff === true ? emojiUtils.polytoria : ''
}\n`
index++
Expand Down
10 changes: 5 additions & 5 deletions src/commands/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ import { IStatus } from '../../types/index.js'
const urlToCheck = [
{
name: 'Main site',
url: 'https://polytoria.co'
url: 'https://polytoria.com/'
},
{
name: 'Public APIs',
url: 'https://api.polytoria.co/v1/users/7348'
url: 'https://api.polytoria.com/v1/users/7348'
},
{
name: 'Blog',
url: 'https://blog.polytoria.co/'
url: 'https://blog.polytoria.com/'
},
{
name: 'Docs',
url: 'https://docs.polytoria.co/'
url: 'https://docs.polytoria.com/'
},
{
name: 'Helpdesk',
url: 'https://help.polytoria.co/'
url: 'https://help.polytoria.com/'
}
]

Expand Down
4 changes: 2 additions & 2 deletions src/commands/store/owners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from 'axios'

// Function to fetch owners from the API
export async function fetchOwners (itemID: number, page: number): Promise<{ total: number, inventories: { serial: number, user: { username: string, id: number } }[], pages: number }> {
const response = await axios.get(`https://api.polytoria.co/v1/store/${itemID}/owners?limit=10&page=${page}`)
const response = await axios.get(`https://api.polytoria.com/v1/store/${itemID}/owners?limit=10&page=${page}`)
return response.data
}

Expand All @@ -15,7 +15,7 @@ export function buildOwnersEmbed (ownersData: { total: number, inventories: { se
.setThumbnail(thumbnail)

const ownersContent = ownersData.inventories.map((owner) => {
return `Serial #${owner.serial}. [${owner.user.username}](https://polytoria.co/users/${owner.user.id})`
return `Serial #${owner.serial}. [${owner.user.username}](https://polytoria.com/users/${owner.user.id})`
})

ownersEmbed.setDescription(`> **Page ${page}/${ownersData.pages} **\n\n` + ownersContent.join('\n'))
Expand Down
Loading

0 comments on commit 3f990e8

Please sign in to comment.