@@ -37,6 +37,7 @@ class VCNotifyManagerClass {
3737 // If a user is already watching for this person, disable the notification
3838 if ( typeof vswIndex !== "undefined" ) {
3939 this . watchers . splice ( vswIndex , 1 ) ;
40+ this . logToggle ( watchedId , notifiedId , false ) ;
4041
4142 return false ;
4243 } else {
@@ -63,7 +64,44 @@ class VCNotifyManagerClass {
6364 }
6465 }
6566
66- logToggle ( watched : User , notified : User , active : boolean ) {
67+ logToggle ( watchedId : string , notifiedId : string , active : boolean ) {
68+ const client = ( InteractionBot . client as ClusterClient ) . shards . first ( ) ! ;
69+ const watched = client . users . get ( watchedId ) ;
70+ const notified = client . users . get ( notifiedId ) ;
71+
72+ if ( ! watched || ! notified ) {
73+ Signale . info ( {
74+ prefix : "vcNotify" ,
75+ message : `${ notifiedId } - VC Notification toggled to "${ active } " for ${ watchedId } ` ,
76+ } ) ;
77+
78+ Webhooks . execute ( Webhooks . ids . vcNotifyLog , {
79+ avatarUrl : client . user ! . avatarUrl ,
80+ embed : {
81+ title : `VC Notification Toggled` ,
82+ fields : [
83+ {
84+ name : "Active" ,
85+ value : String ( active ) ,
86+ inline : true ,
87+ } ,
88+ {
89+ name : "User" ,
90+ value : `<@${ notifiedId } >` ,
91+ inline : true ,
92+ } ,
93+ {
94+ name : "Watching for" ,
95+ value : `<@${ watchedId } >` ,
96+ inline : true ,
97+ } ,
98+ ] ,
99+ } ,
100+ } ) ;
101+
102+ return ;
103+ }
104+
67105 Signale . info ( {
68106 prefix : "vcNotify" ,
69107 message : `${ notified . name } #${ notified . discriminator } - VC Notification toggled to "${ active } " for ${ watched . name } #${ watched . discriminator } ` ,
0 commit comments