r/Discord_Bots • u/Excellent-Brush2158 • 7h ago
Question How can I have roles assigned without using bot
I seen a server using a webhook and it actually assigns a role not an actual bot it’s a webhook how can it be possible ?
r/Discord_Bots • u/Excellent-Brush2158 • 7h ago
I seen a server using a webhook and it actually assigns a role not an actual bot it’s a webhook how can it be possible ?
r/Discord_Bots • u/Upper-Bid-9222 • 23h ago
I'm developing a Python asyncio Discord notification bot that monitors blockchain transactions. It uses PostgreSQL for durable delivery state and has an optional Fast Alert pipeline.
The intended flow:
What I've observed:
During one production session, we recorded 41 full-card Discord API ACKs:
However, there were no [FAST_PREVIEW] markers in the session logs.
This does not necessarily mean the feature is broken.
The feature defaults to disabled, and its effective runtime setting for that session has not been confirmed. Some events may lack the minimum verified evidence, and the implementation intentionally skips preview when full enrichment finishes first.
Simplified scheduling code:
This is a sanitized reduction of the preview scheduling logic, not verbatim production code.
minimum_future and full_task represent existing asyncio Tasks/Futures. The full task represents enrichment/routing readiness, not a Discord full-message ACK.
Recipient authorization, durable ownership, detailed error handling, revision checks, and POST/PATCH implementation are intentionally omitted.
import asyncio
import logging
logger = logging.getLogger(__name__)
async def maybe_publish_preview(
*,
enabled,
minimum_future,
full_task,
is_eligible,
publish_preview,
):
# These early exits are currently silent.
if not enabled or minimum_future is None:
return
await asyncio.wait(
(minimum_future, full_task),
return_when=asyncio.FIRST_COMPLETED,
)
# Prefer the full path if it is already ready.
if (
full_task.done()
or not minimum_future.done()
or minimum_future.cancelled()
):
return
minimum_evidence = minimum_future.result()
# Includes evidence validity and recipient checks.
if not is_eligible(minimum_evidence):
return
# Full readiness may have changed.
if full_task.done():
return
# Abstracts transport and durable ownership.
result = await publish_preview(minimum_evidence)
# Logged only if the call returns.
logger.info("preview_result=%s", result)
What concerns me:
Several execution paths return without explaining why no preview was sent.
Also, .done() is true when a task completes successfully, fails, or is cancelled. In this simplified flow, those outcomes are not distinguished.
Likewise, minimum_future.result() or publish_preview() may raise an exception before a preview-result log is recorded.
This makes it difficult to determine whether:
My questions:
asyncio.FIRST_COMPLETED?My goal:
I want to reduce the time until users receive their first useful Discord notification, ideally below one second when possible.
However, I don't want to weaken financial/security verification, send duplicate messages, update the wrong message, or incorrectly mark a preview as a completed full alert.
I'm looking for instrumentation and validation strategies before changing production behavior.
I can provide small sanitized code excerpts or synthetic traces if needed.