Currency Drop + Pick
The Drop Currency System in OneeChan is an automated chat-based event where currency randomly appears in designated channels, and users must type pick to collect it. The system ensures engagement-base
How It Works
The bot listens for messages in configured
Chat Channels
(Configure the channels using the Configurations Keys)If certain conditions are met (active users, message count), a currency drop is triggered.
The bot posts a currency drop message.
Users must type "pick" before the
PickTTL
(Default 25 seconds) timer runs out to claim the currency.The bot distributes the currency to the first user who picks it up.
A
DropCooldown
is applied before the next drop can occur.
Drop System Behavior
Listening for Chat Activity
The system is triggered whenever a user sends a message in a configured chat channel.
The bot ignores messages from bots to prevent abuse.
The bot checks whether the drop system is enabled and if the message was sent in an allowed chat channel.
Drop Triggers
A drop will only occur if two conditions are met:
Minimum number of unique users chatting (
PickMinimumChatters
)Minimum number of messages sent (
PickMinimumMessages
)
These numbers are tracked using Redis, ensuring that currency drops are based on real activity.
Cooldowns
A global cooldown (
DropCoolDown
) is applied to prevent frequent drops.Each user also has a personal cooldown to prevent them from repeatedly picking up currency.
Picking Up Currency
Command: "pick"
When a user types
pick
, the bot checks:Is there an active drop?
Is the user eligible to pick up the currency? (not on cooldown)
If successful, the user receives a random amount of currency within the configured range (
PickMin
andPickMax
).The bot logs the currency gain and applies a cooldown to the user.
Example Output:
@User has picked up 15 coins! 💰
The currency is automatically deposited into the user’s balance.
The bot deletes the "pick" message to keep the chat clean.
Technical Details
Redis for Activity Tracking
Active Users: Tracked with
activeUsersKey
, ensuring the system only triggers for engaged users.Message Count: Stored as
messageCountKey
, tracking the number of messages in the channel.Drop Cooldown: Ensures that drops do not happen too frequently.
Currency Drop Process
Bot checks activity levels (message count and active users).
If conditions are met:
A drop is announced in the chat.
The bot stores the drop in Redis, marking it as active.
Users type
pick
to claim the drop.The bot checks Redis to see if the user is eligible.
The bot assigns the currency and applies cooldowns.
Message Cleanup
The bot deletes the "pick" message after processing.
The currency drop announcement is removed automatically after a set time (
DropTTL
).Uses RabbitMQ for delayed message deletion, keeping the chat clean.
1. A Currency Drop Appears
💰 Some coins just randomly appeared! Type "pick" to collect them, but hurry!
3. A User Picks Up the Drop
User2: pick
Bot: @User2 picked up 15 coins! 💰
(User2 is now on cooldown before they can pick up again)
Configuration & Setup
No direct setup is required, except configuring server keys (
/setup
).The system is entirely automated based on server activity.
This system ensures engagement-based rewards, promoting active participation in chat while keeping the experience fair and balanced.
Last updated