Markus-Rost 4 年 前
コミット
ac020a8f00
2 ファイル変更3 行追加0 行削除
  1. 1 0
      functions/verify.js
  2. 2 0
      interactions/verify.js

+ 1 - 0
functions/verify.js

@@ -503,6 +503,7 @@ global.verifyOauthUser = function(state, access_token, settings) {
 				return;
 			}
 			username = body.username;
+			console.log( channel.guild.id + ': OAuth2: ' + username );
 		}, error => {
 			console.log( '- Error while getting the mediawiki profile: ' + error );
 		} ) : null )

+ 2 - 0
interactions/verify.js

@@ -291,6 +291,7 @@ function slash_verify(interaction, lang, wiki, channel) {
 		interaction.message.allowed_mentions = allowed_mentions;
 
 		if ( interaction?.message?.embeds?.[0]?.fields?.[1]?.value === lang.get('verify.oauth_used') && interaction?.message?.embeds?.[0]?.url?.startsWith( wiki.origin ) ) {
+			console.log( interaction.guild_id + ': Button: ' + interaction.data.custom_id + ': OAuth2: ' + username );
 			interaction.message.components[0].components[0].disabled = true;
 			return interaction.client.api.interactions(interaction.id, interaction.token).callback.post( {
 				data: {
@@ -328,6 +329,7 @@ function slash_verify(interaction, lang, wiki, channel) {
 			if ( wiki.isWikimedia() ) oauth = 'wikimedia';
 			if ( wiki.isMiraheze() ) oauth = 'miraheze';
 			if ( oauth && process.env[`oauth-${oauth}`] && process.env[`oauth-${oauth}-secret`] ) {
+				console.log( interaction.guild_id + ': Button: ' + interaction.data.custom_id + ': OAuth2' );
 				let state = `${oauth} ${wiki.hostname} ${global.shardId}` + Date.now().toString(16) + randomBytes(16).toString('hex');
 				while ( oauthVerify.has(state) ) {
 					state = `${oauth} ${wiki.hostname} ${global.shardId}` + Date.now().toString(16) + randomBytes(16).toString('hex');