@@ -63,37 +63,37 @@ class Kandan.Plugins.MusicPlayer
63
63
64
64
65
65
@ registerPlayModifier: ()->
66
- Kandan .Modifiers .register @playRegex , (message , state ) =>
67
- url = $ .trim (message .content . substr (message . content .indexOf (" " ) + 1 ));
68
- if true and Kandan .Data .Channels .activeChannelId ()? # and state == Kandan.Helpers.Activities.ACTIVE_STATE commented out because state == undefined for some reason
66
+ Kandan .Modifiers .register @playRegex , (message , activity ) =>
67
+ url = $ .trim (message .substr (message .indexOf (" " ) + 1 ));
68
+ if true and Kandan .Data .Channels .activeChannelId ()?
69
69
rawInput = Kandan .Helpers .Utils .unescape (url)
70
70
soundUrl = null
71
71
soundUrl = @ localSounds (rawInput)
72
72
soundUrl ?= rawInput
73
73
74
- @ playUrl (message .channel_id , soundUrl)
74
+ @ playUrl (activity .channel_id , soundUrl)
75
75
else
76
76
console .log " Not playing stale song"
77
77
78
78
message .content = @ playTemplate ({url : url})
79
79
return Kandan .Helpers .Activities .buildFromBaseTemplate message
80
80
81
81
@ registerStopModifier: ()->
82
- Kandan .Modifiers .register @stopRegex , (message , state ) =>
83
- url = $ .trim (message .content . substr (message . content .indexOf (" " ) + 1 ));
82
+ Kandan .Modifiers .register @stopRegex , (message , activity ) =>
83
+ url = $ .trim (message .substr (message .indexOf (" " ) + 1 ));
84
84
if true and Kandan .Data .Channels .activeChannelId ()?
85
- @ stopSound (message .channel_id )
85
+ @ stopSound (activity .channel_id )
86
86
87
- message . content = @ stopTemplate ()
88
- return Kandan . Helpers . Activities . buildFromBaseTemplate message
87
+ message = @ stopTemplate ()
88
+ return message
89
89
90
90
@ registerResumeModifier: ()->
91
- Kandan .Modifiers .register @resumeRegex , (message , state ) =>
91
+ Kandan .Modifiers .register @resumeRegex , (message , activity ) =>
92
92
if true and Kandan .Data .Channels .activeChannelId ()?
93
- @ play (message .channel_id )
93
+ @ play (activity .channel_id )
94
94
95
- message . content = @ resumeTemplate ()
96
- return Kandan . Helpers . Activities . buildFromBaseTemplate message
95
+ message = @ resumeTemplate ()
96
+ return message
97
97
98
98
99
99
# TODO display error about song not being added by creating an activity locally
0 commit comments