Skip to main content
📞 1-888-784-3881🚀 Start Project
🎮Integrations

Discord Bots

Build powerful Discord bots with our SDK.

⏱️ 12 min read

Overview

Create Discord bots that interact with PropTechUSA data and receive real-time notifications.

Setup

1. Create Discord Bot

  • Go to discord.com/developers
  • Create a new application
  • Add a bot to your application
  • Copy the bot token
  • 2. Configure Webhook

    await proptech.integrations.discord.configure({
    

    webhookUrl: 'https://discord.com/api/webhooks/xxx/xxx',

    events: ['lead.created', 'daily.summary'],

    });

    Bot Commands

    Build interactive bot commands:

    // /leads command - list recent leads
    

    client.on('interactionCreate', async interaction => {

    if (interaction.commandName === 'leads') {

    const leads = await proptech.leads.list({ limit: 5 });

    const embed = new EmbedBuilder()

    .setTitle('Recent Leads')

    .setColor(0xd97757)

    .addFields(

    leads.data.map(lead => ({

    name: lead.name,

    value: ${lead.email} • ${lead.source},

    }))

    );

    await interaction.reply({ embeds: [embed] });

    }

    });

    Notification Embeds

    const embed = {
    

    title: '🎉 New Lead!',

    color: 0xd97757,

    fields: [

    { name: 'Name', value: 'John Doe', inline: true },

    { name: 'Source', value: 'Website', inline: true },

    { name: 'Property', value: '123 Main St', inline: false },

    ],

    timestamp: new Date().toISOString(),

    };