|
|
|
@ -11,14 +11,14 @@ const command = {
|
|
|
|
|
)
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
.then((data) => data.data.introduceSession)
|
|
|
|
|
.catch((err) => console.log(err));
|
|
|
|
|
.catch((err) =>
|
|
|
|
|
console.error("Error when creating a mailbox: " + err.message)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
await client
|
|
|
|
|
.say(
|
|
|
|
|
msg.channelName,
|
|
|
|
|
`${msg.displayName}, your temporary email has been created! Use the ID to fetch new mails! ID: ${data.id} Address: ${data.addresses[0].address}`
|
|
|
|
|
)
|
|
|
|
|
.catch((err) => console.log(err));
|
|
|
|
|
await client.say(
|
|
|
|
|
msg.channelName,
|
|
|
|
|
`${msg.displayName}, your temporary email has been created! Use the ID to fetch new mails! ID: ${data.id} Address: ${data.addresses[0].address}`
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -30,12 +30,15 @@ const command = {
|
|
|
|
|
)
|
|
|
|
|
.then((res) => res.json())
|
|
|
|
|
.then((data) => data.data.session)
|
|
|
|
|
.catch((err) => console.log(err));
|
|
|
|
|
.catch((err) =>
|
|
|
|
|
console.error("Error when fetching mailbox: " + err.message)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (data.mails.length === 0) {
|
|
|
|
|
await client
|
|
|
|
|
.say(msg.channelName, `${msg.displayName}, no mails found`)
|
|
|
|
|
.catch((err) => console.log(err));
|
|
|
|
|
await client.say(
|
|
|
|
|
msg.channelName,
|
|
|
|
|
`${msg.displayName}, no mails found`
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -47,24 +50,20 @@ const command = {
|
|
|
|
|
)
|
|
|
|
|
.catch((err) => console.log(err));
|
|
|
|
|
|
|
|
|
|
await client
|
|
|
|
|
.say(
|
|
|
|
|
msg.channelName,
|
|
|
|
|
`${msg.displayName}, Body: ${data.mails[0].text
|
|
|
|
|
.replaceAll("\n", " ")
|
|
|
|
|
.substring(0, 400)}`
|
|
|
|
|
)
|
|
|
|
|
.catch((err) => console.log(err));
|
|
|
|
|
await client.say(
|
|
|
|
|
msg.channelName,
|
|
|
|
|
`${msg.displayName}, Body: ${data.mails[0].text
|
|
|
|
|
.replaceAll("\n", " ")
|
|
|
|
|
.substring(0, 400)}`
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default: {
|
|
|
|
|
await client
|
|
|
|
|
.say(
|
|
|
|
|
msg.channelName,
|
|
|
|
|
`${msg.displayName}, supply an action (create or fetch)`
|
|
|
|
|
)
|
|
|
|
|
.catch((err) => console.log(err));
|
|
|
|
|
await client.say(
|
|
|
|
|
msg.channelName,
|
|
|
|
|
`${msg.displayName}, supply an action (create or fetch)`
|
|
|
|
|
);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|