Attestation Discord Bot
Last updated
Last updated
Copyright Sign 2021-2024
EthSign's AttestationBot is a gatekeeping bot centered around attestations. Users can attest anything; by simply choosing an attestation's schema ID, Discord server administrators can use attestations from a specific schema to verify users within their Discord community. For a user's Discord account to be verified, the user must create an attestation with the chosen schema ID and sign a message with their wallet address to link their Discord account. Discord administrators can also require that a specific Result
field be set to true
on the attestations to add another layer of verification. Once these checks pass verification, users will be granted a role in Discord, granting them desired access as defined by the verification role in the server.
Register attestation data for the server's verification. Requires testnet (true/false), mode (on-chain/off-chain), the schema ID for verification, and whether or not to check the Result
field (true/false). Optionally, Discord Server admins can supply an attester address for querying attestations created by a single address (a trusted delegate address).
Generates a pre-defined Discord Role in the server with default permissions. If the name is left blank, the role's name will default to "Verified".
Sets the verification role to whichever role the user passes in as an argument.
If set to on, displays the number of verified users in the server.
DMs user a link for verification. Upon success, a role will be given to the user. Upon failure, tells the user why it failed (no role setup in server, no attestation linked to server, user already verified, etc).
IDs are generated in the following format: {mode}_{chainType}_{chainId}_{id}
Example schema ID: onchain_evm_80001_0x3
Example attestation ID: onchain_evm_80001_0x11
Register the Attestation-specific data for a server.
Set the verified role for a server.
Show the number of verified users in a server.
Users can now verify their Discord accounts to be granted special permissions as defined by the verified role.
Run /verify and click the link provided by direct message.
Connect MetaMask to the website.
Click the “Verify” button and sign the relevant message in MetaMask.
Return to Discord.
NOTE: If for any reason the role is removed from a verified Discord account in a Discord server, the user can simply re-run /verify and be granted the role without additional verification.
Validates request body message and signature for the given ID. If successful, the user is granted a role in the relevant Discord server, and the attestation ID is returned for display purposes. Failure will result in an error message.
Determines if the provided interaction ID exists in our backend. If successful, it will return data about the relevant Discord user for displaying on our frontend. Failure will result in an error message.
Discord-specific endpoint used for all Discord bot commands generated through a Discord server.
Used for pinging uptime of the server.
Querying for attestations and parsing the response:
Parsing the attestation data into a JSON Object: