-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(spotify): add ban and unban commands (#4009)
* feat(spotify): add ban and unban commands * add missing migrations * add ban unban docs
- Loading branch information
Showing
10 changed files
with
375 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
{ | ||
"song-not-found": "Sorry, $sender, track was not found on spotify", | ||
"song-requested": "$sender, you requested song $name from $artist" | ||
"song-requested": "$sender, you requested song $name from $artist", | ||
"not-banned-song-not-playing": "$sender, no song is currently playing to ban.", | ||
"song-banned": "$sender, song $name from $artist is banned.", | ||
"song-unbanned": "$sender, song $name from $artist is unbanned.", | ||
"song-not-found-in-banlist": "$sender, song by spotifyURI $uri was not found in ban list.", | ||
"cannot-request-song-is-banned": "$sender, cannot request banned song $name from $artist." | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { EntitySchema } from 'typeorm'; | ||
|
||
export interface SpotifySongBanInterface { | ||
spotifyUri: string; | ||
title: string; | ||
artists: string[]; | ||
} | ||
|
||
export const SpotifySongBan = new EntitySchema<Readonly<Required<SpotifySongBanInterface>>>({ | ||
name: 'spotify_song_ban', | ||
columns: { | ||
spotifyUri: { type: String, primary: true }, | ||
title: { type: String }, | ||
artists: { type: 'simple-array' }, | ||
}, | ||
}); |
14 changes: 14 additions & 0 deletions
14
src/bot/database/migration/mysql/1596014060721-spotifyBanList.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,14 @@ | ||
import {MigrationInterface, QueryRunner} from 'typeorm'; | ||
|
||
export class spotifyBanList1596014060721 implements MigrationInterface { | ||
name = 'spotifyBanList1596014060721'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query('CREATE TABLE `spotify_song_ban` (`spotifyUri` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `artists` text NOT NULL, PRIMARY KEY (`spotifyUri`)) ENGINE=InnoDB'); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query('DROP TABLE `spotify_song_ban`'); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/bot/database/migration/postgres/1596014156038-spotifyBanList.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,14 @@ | ||
import {MigrationInterface, QueryRunner} from 'typeorm'; | ||
|
||
export class spotifyBanList1596014156038 implements MigrationInterface { | ||
name = 'spotifyBanList1596014156038'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`CREATE TABLE "spotify_song_ban" ("spotifyUri" character varying NOT NULL, "title" character varying NOT NULL, "artists" text NOT NULL, CONSTRAINT "PK_f9ba62ed678a1e426db17acc387" PRIMARY KEY ("spotifyUri"))`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP TABLE "spotify_song_ban"`); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
src/bot/database/migration/sqlite/1595974777207-spotifyBanList.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,14 @@ | ||
import {MigrationInterface, QueryRunner} from 'typeorm'; | ||
|
||
export class spotifyBanList1595974777207 implements MigrationInterface { | ||
name = 'spotifyBanList1595974777207'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`CREATE TABLE "spotify_song_ban" ("spotifyUri" varchar PRIMARY KEY NOT NULL, "title" varchar NOT NULL, "artists" text NOT NULL)`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP TABLE "spotify_song_ban"`); | ||
} | ||
|
||
} |
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
Oops, something went wrong.