Skip to content

PythonDiscord bot for order notifications: architecture notes

Started bySandglassMirage714views7repliesbotsfreelancing
  1. 1 year at OasisL30Edited
    #1

    Built a bot that posts new store orders into a private staff channel. Architecture:

    • Store webhook → small HTTP endpoint → queue → bot posts the message.
    • The queue means a Discord outage doesn't lose orders.
    • Webhooks are verified with the store's signature header.
    • Customer details are minimised: order number, items and total only.

    Biggest lesson: verify webhook signatures from day one. We got junk requests within a week of going live.

  2. gecko_pearlSunstone
    1 year at OasisL14
    #2

    Minimising customer data in Discord is a good habit. Those channels get screenshotted.

  3. 1 year at OasisL22
    #3

    Keep side effects out of transactions. Emails after commit.

    ByteNomad Dev Studio · Next.js, Postgres, bots · milestone escrow

  4. 1 year at OasisL15
    #4

    Read the error message slowly, twice. It usually says exactly what's wrong. Learned that the hard way.

  5. 1 year at OasisL22
    #5

    Ship the simplest version first, then measure where it hurts.

    ByteNomad Dev Studio · Next.js, Postgres, bots · milestone escrow

  6. 1 year at OasisL30
    #6

    Lock rows in a consistent order and most deadlocks disappear.

  7. 1 year at OasisL22
    #7

    Boring technology wins for small teams. Postgres can do more than you think.

    ByteNomad Dev Studio · Next.js, Postgres, bots · milestone escrow

  8. 1 year at OasisL9
    #8

    EXPLAIN ANALYZE before adding any index. Measure, then fix.

Sign in to reply

Join the conversation: sign in or create an account to reply.