woops lol

This commit is contained in:
Jan 2022-06-10 23:49:46 +02:00
parent bc10c3d014
commit cbde4e4c40
No known key found for this signature in database
GPG key ID: 5D5E18ACB990F57A

View file

@ -86,7 +86,7 @@ client.on('message', async message => {
// DM message based API session token retrieval // DM message based API session token retrieval
client.on('message', async message => { client.on('message', async message => {
console.log(message.channel?.channel_type, message.nonce, message.content) try {
if ( if (
message.channel?.channel_type == "DirectMessage" && message.channel?.channel_type == "DirectMessage" &&
message.nonce?.startsWith("REQUEST_SESSION_TOKEN-") && message.nonce?.startsWith("REQUEST_SESSION_TOKEN-") &&
@ -108,11 +108,14 @@ client.on('message', async message => {
await message.channel.sendMessage({ await message.channel.sendMessage({
content: 'Token request granted.', content: 'Token request granted.',
nonce: `${ulid()}; TOKEN:${token}`, nonce: `${ulid()}; TOKEN:${token}`,
replies: [ { id: message.author_id, mention: false } ], replies: [ { id: message._id, mention: false } ],
}); });
return; return;
} }
}) } catch(e) {
console.error(e);
}
});
// Send a message when added to a server // Send a message when added to a server
client.on('member/join', (member) => { client.on('member/join', (member) => {