Summary: j3lte/pastedeno forced me to rewrite the codebase from CommonJS to a ECMAScript module. ([])
Summary: The entire bot's source code has been migrated to Discord.js because discord.py has become significantly deprecated, particularly in its interactions with Discord's API. (f9161b0)
- Converted the interaction reply from embed to an ephemeral plaintext message since its more concise. (fdf5e66)
- Renamed
/set-public-key
command to/set-gpg-key
command ([edb21da][https://github.com/ibnaleem/gnupg-discord/commit/fdf5e66496ef64dda62cafa7419168ba4db8e6e6]) - Implemented a check to see if a user is already in the database: if they aren't, they'll be added; if they are, their GPG key will be updated to the new one. Even if it's a resubmission (i.e., the GPG key is the same as the stored one), this operation will still be performed for the sake of simplicity, as adding another check would reduce efficiency. (05f3d35)
- Implemented the
/set-public-key
command to prompt users for their GPG public key and store it in the database. (c377085) - Created a db.js file to interact with MongoDB Client to store user's GPG keys. (cab313d )
- Initialisation of index.js (f9161b0)
End-to-End Encrypted Messages (8eb0c9e)
- Utilize the
/send
command to send End-to-End encrypted messages to other members - Before sending messages, users need the PGP fingerprint of the recipient. Note: Future updates may include the storage of public fingerprints for ease of access (users can opt-out as always)
- Members can communicate across different servers as long as they share a server with GnuPG. For instance,
User1
inServer1
andUser2
inServer2
, not in each other's servers, can exchange encrypted messages if GnuPG is present in bothServer1
andServer2
- Encryption is applied to messages prior to their transmission to the Discord API
- No storage of messages occurs
- Users are prompted through a TextInput Modal to input the PGP fingerprint, user ID, and message
- PGP fingerprints are unique alphanumeric strings generated from a user's public key, serving as a distinctive identifier and ensuring the integrity of encrypted communications
Decrypted Messages Will Delete After 5 Minutes in DMs (b027f54)
- After a user receives decrypted text by our bot in their DMs, the message will remain for 5 minutes before the bot deletes it, contrary to the previous feature which allowed decrypted messages to stay in DMs forever
- Encrypted and decrypted messages will be sent to the command channel if the interaction user (command invoker) has their DMs off (
discord.Forbidden
) - Decrypted messages that are sent in command channels will be ephemeral
Added TextInput Modal to Encryption Command (11d0175)
- Upon invoking the command, users input their PGP fingerprint and message in a TextInput Modal, just like the decryption command. This allows users to encrypted longer messages
Added Hash Command (eb4313f)
- Users are prompted with 6 hash functions and a text argument for hashing their text
Added Decryption Command (31ee975)
- Upon invoking the command, users input their PGP Private Key and message in a TextInput Modal
- Private keys and passphrases are imported using gnupg-python, and deleted after decryption. Private keys and passphrases are not stored. See How Decryption Works with GnuPG Discord
- Decrypted messages are sent to users via DMs, accompanied by an ephemeral interaction response prompting them to check DMs
Added Encryption Command (c7715e9)
- Upon invoking the command, users input their PGP fingerprint and message in the required command arguments
- Encrypted messages are sent to users via DMs, accompanied by an ephemeral interaction response prompting them to check DMs