Commit 500fb05 1 parent 06aba6e commit 500fb05 Copy full SHA for 500fb05
File tree 3 files changed +13
-2
lines changed
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class Messenger {
20
20
embeds . forEach ( embed => {
21
21
this . msg . channel . sendEmbed ( embed ) ;
22
22
} ) ;
23
- } ) ;
23
+ } ) . catch ( err => console . log ( err ) ) ;
24
24
}
25
25
26
26
negotiateMatch ( match ) {
Original file line number Diff line number Diff line change
1
+ const Url = require ( 'urijs' ) ;
2
+
3
+ module . exports = ( client , embed ) => {
4
+ console . log ( embed ) ;
5
+ if ( embed . url ) {
6
+ embed . url = Url ( embed . url ) . query ( { utm_source : 'discord' } ) . toString ( ) ;
7
+ }
8
+ return embed ;
9
+ }
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ const Discord = require('discord.js');
3
3
const Url = require ( 'urijs' ) ;
4
4
5
5
const manamoji = require ( './middleware/manamoji' ) ;
6
+ const utm = require ( './middleware/utm' ) ;
7
+
6
8
7
9
class TextResponse {
8
10
constructor ( client , cardName ) {
@@ -61,7 +63,7 @@ class TextResponse {
61
63
}
62
64
}
63
65
64
- TextResponse . prototype . middleware = [ manamoji ] ;
66
+ TextResponse . prototype . middleware = [ manamoji , utm ] ;
65
67
TextResponse . prototype . url = 'https://api.scryfall.com/cards/named' ;
66
68
67
69
You can’t perform that action at this time.
0 commit comments