-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(discord): notify when no game servers are available (#2811)
- Loading branch information
1 parent
e8dc7f8
commit e0b666d
Showing
6 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/plugins/discord/notifications/no-free-game-servers-available.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { EmbedBuilder } from 'discord.js'; | ||
|
||
interface NoFreeGameServersAvailableOptions { | ||
game: { | ||
number: string; | ||
url: string; | ||
}; | ||
client: { | ||
name: string; | ||
iconUrl: string; | ||
}; | ||
} | ||
|
||
export const noFreeGameServersAvailable = ( | ||
options: NoFreeGameServersAvailableOptions, | ||
): EmbedBuilder => { | ||
return new EmbedBuilder() | ||
.setTitle('No free game servers available') | ||
.setColor('#ff0000') | ||
.setDescription( | ||
`Game number: **[${options.game.number}](${options.game.url})**`, | ||
) | ||
.setFooter({ | ||
text: options.client.name, | ||
iconURL: options.client.iconUrl, | ||
}) | ||
.setTimestamp(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters