Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion definitions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import os
import logging
from enum import Enum

import sys
import pandas as pd
from src.models.random_event import RandomFailureEvent, RandomSuccessEvent


def is_docker():
Expand Down Expand Up @@ -41,6 +42,8 @@ def read_str_file(path):
LONG_MESSAGE_LIMIT = 1 # long texts spanning into multiple messages.
STOPWORD_RATIO_THRESHOLD = 0.59
MIN_QUIZ_TIME_TO_ANSWER_SECONDS = 10
CRITICAL_FAILURE_CHANCE = 0.05
CRITICAL_SUCCESS_CHANCE = 0.05
CREDIT_HISTORY_COLUMNS = ['timestamp', 'user_id', 'target_user_id', 'credit_change', 'action_type', 'bet_type', 'success']

TIMEZONE = 'Europe/Warsaw'
Expand Down Expand Up @@ -225,3 +228,43 @@ class CreditActionType(Enum):
STEAL = 'steal' # steal()
QUIZ = 'quiz'
GIFT = 'gift'


STEAL_EVENTS = [
RandomFailureEvent("A swarm of angry bees stole your credits mid-escape — half gone!", lambda amount: -amount // 2),
RandomFailureEvent("The target turned into a dragon and breathed fire — you fled empty-handed!", lambda amount: -amount),
RandomFailureEvent("Your shadow betrayed you and ate the credits — 75% vanished!", lambda amount: int(-amount * 0.75)),
RandomFailureEvent("Gravity reversed, credits floated away — quarter lost!", lambda amount: -amount // 4),
RandomFailureEvent("Time looped, you stole from yourself — total paradox loss!", lambda amount: -amount),
RandomSuccessEvent("You accidentally robbed a bank vault — bonus jackpot!", lambda amount: amount // 2),
RandomSuccessEvent("The target's gold statue came to life and thanked you — extra gold!", lambda amount: amount),
RandomSuccessEvent("You found a portal to a credit dimension — double reality!", lambda amount: amount * 2),
RandomSuccessEvent("Aliens beamed down and upgraded your haul — triple cosmic bonus!", lambda amount: amount * 3),
RandomSuccessEvent("Your evil twin helped — lucky twin credits!", lambda amount: amount // 3),
]

BET_EVENTS = [
RandomFailureEvent("The roulette wheel turned into a black hole — sucked double losses!", lambda amount: -amount * 2),
RandomFailureEvent("Your bet offended the casino ghost — table haunted you away!", lambda amount: -amount),
RandomFailureEvent("The dealer was a vampire — drained your credits twice!", lambda amount: -amount * 2),
RandomFailureEvent("Bad luck gremlin possessed you — lost all plus gremlin fee!", lambda amount: -amount - 50),
RandomFailureEvent("The ball became sentient and rebelled — total anarchy wipeout!", lambda amount: -amount),
RandomSuccessEvent("Lady Luck was actually a wizard — enchanted double winnings!", lambda amount: amount),
RandomSuccessEvent("You summoned the jackpot demon — triple infernal payout!", lambda amount: amount * 3),
RandomSuccessEvent("Stars formed a winning constellation — triple celestial bonus!", lambda amount: amount * 3),
RandomSuccessEvent("Epic win? Nah, legendary streak — 5x mega bonus!", lambda amount: amount * 5),
RandomSuccessEvent("Casino turned into a fairy tale — unbelievable 10x magic!", lambda amount: amount * 10),
]

QUIZ_EVENTS = [
RandomFailureEvent("Distracted by a dancing squirrel — penalty for cuteness overload!", lambda: -10),
RandomFailureEvent("Your brain turned into jelly — extra wobbly penalty!", lambda: -20),
RandomFailureEvent("Wrong answer summoned a quiz troll — big oops penalty!", lambda: -30),
RandomFailureEvent("Memory erased by time travelers — lost in history!", lambda: -15),
RandomFailureEvent("Quiz apocalypse — severe cosmic fail penalty!", lambda: -50),
RandomSuccessEvent("Your answer echoed through dimensions — bonus echo credits!", lambda: 15),
RandomSuccessEvent("Quiz gods blessed you — divine knowledge payout!", lambda: 25),
RandomSuccessEvent("Time froze for your brilliance — frozen time bonus!", lambda: 50),
RandomSuccessEvent("You broke the quiz matrix — system crash payout!", lambda: 30),
RandomSuccessEvent("Genius level: Expert — ultimate expert bonus!", lambda: 100),
]
5 changes: 1 addition & 4 deletions src/stats/chat_commands.py → src/commands/chat_commands.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import os.path
import logging

from matplotlib import pyplot as plt
from telegram import Update
from telegram.ext import ContextTypes
import telegram
import pandas as pd
import unidecode

from definitions import USERS_PATH, CLEANED_CHAT_HISTORY_PATH, REACTIONS_PATH, UPDATE_REQUIRED_PATH, EmojiType, ArgType, MessageType, MAX_USERNAME_LENGTH, TEMP_DIR, TIMEZONE, PeriodFilterMode, \
from definitions import USERS_PATH, CLEANED_CHAT_HISTORY_PATH, REACTIONS_PATH, UPDATE_REQUIRED_PATH, EmojiType, ArgType, MessageType, MAX_USERNAME_LENGTH, TIMEZONE, \
ChartType, MAX_CWEL_USAGE_DAILY, CHAT_VIDEO_NOTES_DIR_PATH
import src.stats.utils as stats_utils
import src.core.utils as core_utils
Expand All @@ -17,7 +15,6 @@
from src.core.job_persistance import JobPersistance
from src.models.bot_state import BotState
from src.models.command_args import CommandArgs
import src.stats.charts
from src.models.youtube_download import YoutubeDownload
from src.stats import charts
from src.stats.word_stats import WordStats
Expand Down
Loading