Skip to content

Commit e0c58b9

Browse files
committed
chore: Embed URLs for Othello games
1 parent 3120c17 commit e0c58b9

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ DISCORD_ADMINS=ADMIN_ID_1,ADMIN_ID_2
1414
USE_WEB=true
1515
WEB_PORT=8080
1616

17+
WEB_URL=partbot.partman.dev
18+
1719
MONGO_URL=URL_HERE

src/ps/games/othello/index.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,19 @@ export class Othello extends Game<State> {
146146
.map(player => `${player.name} (${player.turn})${player.id === winner ? ` ${winnerIcon}` : ''}`)
147147
.join(' vs ');
148148
const count = this.count();
149-
return (
150-
new EmbedBuilder()
151-
.setColor('#008000')
152-
.setAuthor({ name: 'Othello - Room Match' })
153-
.setTitle(title)
154-
// .setURL // TODO: Link game logs on Web
155-
.addFields([
156-
{
157-
name: [count.B, count.W].join(' - '),
158-
value: this.state.board
159-
.map(row => row.map(cell => (cell ? { B: ':black_circle:', W: ':white_circle:' }[cell] : ':green_circle:')).join(''))
160-
.join('\n'),
161-
},
162-
])
163-
);
149+
return new EmbedBuilder()
150+
.setColor('#008000')
151+
.setAuthor({ name: 'Othello - Room Match' })
152+
.setTitle(title)
153+
.setURL(`${process.env.WEB_URL}/othello/${this.id.replace(/^#/, '')}`)
154+
.addFields([
155+
{
156+
name: [count.B, count.W].join(' - '),
157+
value: this.state.board
158+
.map(row => row.map(cell => (cell ? { B: ':black_circle:', W: ':white_circle:' }[cell] : ':green_circle:')).join(''))
159+
.join('\n'),
160+
},
161+
]);
164162
}
165163

166164
render(side: Turn) {

0 commit comments

Comments
 (0)