Skip to content

Commit

Permalink
latest
Browse files Browse the repository at this point in the history
  • Loading branch information
1to3for5vi7ate9x committed Jan 30, 2025
1 parent 1bf7f50 commit 60ec018
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions characters/neuronlink.character.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "NeuronLink",
"plugins": [],
"clients": ["discord"],
"clients": ["discord","telegram"],
"modelProvider": "ollama",
"settings": {
"secrets": {},
Expand All @@ -23,7 +23,7 @@
"knowledge": [
"Twitter: https://x.com/NeuronLinkAI",
"Discord: https://discord.gg/neuronlink",
"Telegram: https://t.me/NeuronLinkAI",
"Telegram: https://t.me/Neuron_Link",
"Website: https://neuronlink.ai"
],
"messageExamples": [
Expand Down
22 changes: 11 additions & 11 deletions packages/client-discord/src/messageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import { DiscordUserClient } from './discordUserClient';

// Constants
const MARKETING_CONSTANTS = {
MIN_MARKETING_INTERVAL: 2 * 60 * 1000, // 2 minutes
MAX_MARKETING_INTERVAL: 2 * 60 * 1000, // 2 minutes
BASE_WAIT_TIME: 4 * 60 * 1000, // 4 minutes
MIN_MESSAGES_BEFORE_REPLY: 2, // Reduced for testing
TIME_REDUCTION_PER_MESSAGE: 1 * 60 * 1000, // 1 minute
MIN_WAIT_TIME: 2 * 60 * 1000, // 2 minutes
MAX_MARKETING_MESSAGES_PER_GROUP: 96
MIN_MARKETING_INTERVAL: 6 * 60 * 60 * 1000, // 6 hours
MAX_MARKETING_INTERVAL: 6 * 60 * 60 * 1000, // 6 hours
BASE_WAIT_TIME: 6 * 60 * 60 * 1000, // 6 hours
MIN_MESSAGES_BEFORE_REPLY: 2,
TIME_REDUCTION_PER_MESSAGE: 30 * 60 * 1000, // 30 minutes
MIN_WAIT_TIME: 4 * 60 * 60 * 1000, // 4 hours
MAX_MARKETING_MESSAGES_PER_GROUP: 4 // 4 messages per day max (24/6)
};

// Base templates that incorporate character's style and behavior
Expand Down Expand Up @@ -90,9 +90,9 @@ export class MessageManager {
private lastMarketingTimes: Map<string, number> = new Map();
private channelMessageCounts: Map<string, number> = new Map();
private channelTimeReductions: Map<string, number> = new Map();
private readonly MIN_MARKETING_INTERVAL = 2 * 60 * 1000; // 2 minutes
private readonly MAX_MARKETING_INTERVAL = 2 * 60 * 1000; // 2 minutes
private readonly MAX_MARKETING_MESSAGES_PER_CHANNEL = 96; // Max messages per channel per day
private readonly MIN_MARKETING_INTERVAL = 6 * 60 * 60 * 1000; // 6 hours
private readonly MAX_MARKETING_INTERVAL = 6 * 60 * 60 * 1000; // 6 hours
private readonly MAX_MARKETING_MESSAGES_PER_CHANNEL = 4; // Max messages per channel per day
private marketingEnabled: boolean = false;

constructor(runtime: IAgentRuntime, client: DiscordUserClient) {
Expand Down Expand Up @@ -579,7 +579,7 @@ export class MessageManager {
private scheduleNextMarketingMessage(channelName: string): void {
if (!this.marketingEnabled) return;

const interval = this.MIN_MARKETING_INTERVAL; // Use fixed 2-minute interval for testing
const interval = this.MIN_MARKETING_INTERVAL; // Use fixed 6-hour interval
elizaLogger.log(`Scheduling next marketing message for ${channelName} in ${Math.floor(interval/1000)} seconds`);

setTimeout(async () => {
Expand Down
14 changes: 7 additions & 7 deletions packages/client-telegram/src/messageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ export class MessageManager {
private groupTimeReductions: Map<string, number> = new Map(); // Track accumulated time reductions

// Base timing constants
private readonly MIN_MARKETING_INTERVAL = 2 * 60 * 1000; // 2 minutes
private readonly MAX_MARKETING_INTERVAL = 2 * 60 * 1000; // 2 minutes
private readonly BASE_WAIT_TIME = 4 * 60 * 1000; // 4 minutes
private readonly MIN_MESSAGES_BEFORE_REPLY = 2; // Reduced for testing
private readonly TIME_REDUCTION_PER_MESSAGE = 1 * 60 * 1000; // 1 minute
private readonly MIN_WAIT_TIME = 2 * 60 * 1000; // 2 minutes
private readonly MAX_MARKETING_MESSAGES_PER_GROUP = 96; // Max marketing messages per group per day
private readonly MIN_MARKETING_INTERVAL = 6 * 60 * 60 * 1000; // 6 hours
private readonly MAX_MARKETING_INTERVAL = 6 * 60 * 60 * 1000; // 6 hours
private readonly BASE_WAIT_TIME = 6 * 60 * 60 * 1000; // 6 hours
private readonly MIN_MESSAGES_BEFORE_REPLY = 2;
private readonly TIME_REDUCTION_PER_MESSAGE = 30 * 60 * 1000; // 30 minutes
private readonly MIN_WAIT_TIME = 4 * 60 * 60 * 1000; // 4 hours
private readonly MAX_MARKETING_MESSAGES_PER_GROUP = 4; // 4 messages per day max (24/6)
private marketingEnabled: boolean = false;

constructor(runtime: IAgentRuntime, client: TelegramClient) {
Expand Down

0 comments on commit 60ec018

Please sign in to comment.