Skip to main content

interactions.py adapter for Mochi - auto-instruments commands, guild joins/leaves, and health snapshots

Project description

mochi-analytics-interactions

interactions.py adapter for Mochi analytics.

Install

pip install mochi-analytics mochi-analytics-interactions discord-py-interactions

Usage

import interactions
from mochi_analytics import MochiClient
from mochi_analytics_interactions import attach_mochi

mochi = MochiClient(url="https://mochi.example.com", api_key="mochi_sk_...")

client = interactions.Client()
detach = attach_mochi(client, mochi)

client.start("...")

Commands are recorded on CommandCompletion, which interactions.py dispatches in a finally — so it fires for failures too, and a preceding CommandError is what marks an invocation unsuccessful. Neither event reports how long the command took, so durationMs is omitted unless you pass auto_track_commands=False and wrap your callbacks with wrap_command.

An AutoShardedClient sends one snapshot per shard, each carrying that shard's own guild count.

See the interactions.py guide for the full documentation.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mochi_analytics_interactions-0.2.0.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mochi_analytics_interactions-0.2.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file mochi_analytics_interactions-0.2.0.tar.gz.

File metadata

File hashes

Hashes for mochi_analytics_interactions-0.2.0.tar.gz
Algorithm Hash digest
SHA256 caaabc6284013a3ec50710f7fc1b7059baf7e75dc31b315a5e01736cb05b4aaf
MD5 024db04341722f8fdd487fc1f09af26e
BLAKE2b-256 50fa97501d77c9ee0ead497459ce7df25a239eaa8923ef9f5d07a1aca4aeaeda

See more details on using hashes here.

Provenance

The following attestation bundles were made for mochi_analytics_interactions-0.2.0.tar.gz:

Publisher: release-please.yml on mochi-analytics/mochi-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mochi_analytics_interactions-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mochi_analytics_interactions-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e8206ce7584bbd2c15057c7376cfa3511439b963f2990cb904b80284993abfb
MD5 9a747269c8bb5afc30964fa94526b970
BLAKE2b-256 d158e20b607d798666839fbe2979640511fe47544800662b16cb24efc56ba65d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mochi_analytics_interactions-0.2.0-py3-none-any.whl:

Publisher: release-please.yml on mochi-analytics/mochi-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page