You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constemailMessage=`*Temporary Email Address:*\n\n${inbox.address}\n\nA token for checking this inbox will be sent in the next message. Use it with the .checkmail command.`;
10
+
awaitm.reply(emailMessage);
11
+
12
+
// Send the token as a separate, individual message
13
+
awaitm.reply(inbox.token);
14
+
15
+
// Send instructions as a third message
16
+
awaitm.reply('Long press and copy the token above to use with the .checkmail command.');
17
+
18
+
}catch(error){
19
+
console.error('Error:',error);
20
+
m.reply('Failed to create a temporary email address.');
21
+
}
22
+
}elseif(command==='checkmail'){
23
+
if(!text){
24
+
m.reply('Please provide the token of the temporary email you want to check.');
25
+
return;
26
+
}
27
+
28
+
try{
29
+
constemails=awaittempmail.checkInbox(text);
30
+
if(!emails){
31
+
m.reply(`No messages found or the inbox has expired.`);
32
+
return;
33
+
}
34
+
35
+
if(emails.length===0){
36
+
m.reply(`No messages found in the inbox.`);
37
+
return;
38
+
}
39
+
40
+
constmessages=emails.map(email=>{
41
+
return`
42
+
*From:* ${email.from}
43
+
*Subject:* ${email.subject}
44
+
*Date:* ${newDate(email.date).toLocaleString()}
45
+
*Body:*
46
+
${email.body}
47
+
`;
48
+
}).join('\n\n---\n\n');
49
+
50
+
constreplyMessage=`*Messages in inbox:*\n\n${messages}`;
0 commit comments