2024-05-24 20:08:22 -03:00
module . exports = function ( bot , msg ) {
const chatId = msg . chat . id ;
const userName = msg . from . first _name ;
const userId = msg . from . id ;
const userHandle = msg . from . username ;
const isBot = msg . from . is _bot ;
const userPremium = msg . from . is _premium ;
2024-05-25 12:37:34 -03:00
const userLang = msg . from . language _code ;
2024-06-01 22:47:36 +00:00
let haveUsername = "" ;
2024-05-24 20:57:44 -03:00
let userPremiumOutput = "" ;
if ( userPremium ) {
2024-06-02 00:26:48 +00:00
userPremiumOutput = "*You have a Telegram Premium subscription.*" ;
2024-05-24 20:57:44 -03:00
} else {
2024-06-02 00:26:48 +00:00
userPremiumOutput = "*You don't have a Telegram Premium subscription.*" ;
}
2024-05-24 20:08:22 -03:00
2024-06-01 22:47:36 +00:00
if ( userHandle ) {
2024-06-02 15:18:27 +00:00
haveUsername = ` *Your username is:* \` @ ${ userHandle } \` ` ;
2024-06-01 22:47:36 +00:00
} else {
2024-06-02 15:18:27 +00:00
haveUsername = ` *Your username is:* \` none \` ` ;
2024-06-02 00:26:48 +00:00
}
2024-06-01 22:47:36 +00:00
2024-06-02 15:18:27 +00:00
const message = ` *Your name is:* \` ${ userName } \` \n ${ haveUsername } \n *Your ID is:* \` ${ userId } \` \n *You are a bot:* \` ${ isBot } \` \n *Your language:* \` ${ userLang } \` \n \n ${ userPremiumOutput } ` ;
2024-05-24 20:57:44 -03:00
2024-06-02 00:26:48 +00:00
bot . sendMessage ( chatId , message , { parse _mode : 'Markdown' } )
2024-06-02 13:27:01 +00:00
. catch ( error => console . error ( 'WARN: Message cannot be sent: ' , error ) ) ;
2024-06-02 00:26:48 +00:00
}