common update

This commit is contained in:
2025-06-18 11:48:41 +07:00
parent 88c4ee362e
commit 047290e2ea
27 changed files with 1533 additions and 87 deletions
+36
View File
@@ -0,0 +1,36 @@
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
# Bot configuration
intents = discord.Intents.default()
intents.message_content = True
intents.members = True
intents.voice_states = True
intents.guilds = True
bot = commands.Bot(command_prefix='!', intents=intents)
# Initialize repositories
from repositories import ServerRepository, ChannelRepository, ChannelAppRepository, UserRepository
server_repo = ServerRepository()
channel_repo = ChannelRepository()
channel_app_repo = ChannelAppRepository()
user_repo = UserRepository()
# Store user cooldowns
from typing import Dict, Set
from datetime import datetime
user_cooldowns: Dict[int, datetime] = {}
active_voice_users: Set[int] = set()
# Constants
CHAT_EXP_POINTS = 1
VOICE_EXP_POINTS_PER_MINUTE = 2
CHAT_COOLDOWN = 60 # seconds