File tree Expand file tree Collapse file tree 4 files changed +93
-3
lines changed Expand file tree Collapse file tree 4 files changed +93
-3
lines changed Original file line number Diff line number Diff line change 1+ -- One-Task-bit-Bot DB Scheme --
2+
3+ -- ENUM's --
4+ CREATE TYPE lan AS ENUM (' UKRANIAN' , ' ENGLISH' );
5+
6+ -- TABLE users
7+ CREATE TABLE users (
8+ id BIGSERIAL PRIMARY KEY ,
9+ user_name VARCHAR (255 ) NOT NULL UNIQUE,
10+ language lan NOT NULL DEFAULT ' ENGLISH' ,
11+ register_date TIMESTAMP NOT NULL DEFAULT NOW()
12+ );
13+
14+ -- TABLE tasks
15+ CREATE TABLE tasks (
16+ id SERIAL PRIMARY KEY ,
17+ user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE ,
18+ task_name VARCHAR (255 ) NOT NULL ,
19+ status BOOLEAN NOT NULL DEFAULT FALSE,
20+ start_time TIMESTAMP ,
21+ creation_date TIMESTAMP NOT NULL DEFAULT NOW()
22+ );
23+
24+ -- TABLE ideas
25+ CREATE TABLE ideas (
26+ id SERIAL PRIMARY KEY ,
27+ user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE ,
28+ idea_name VARCHAR (255 ) NOT NULL ,
29+ creation_date TIMESTAMP NOT NULL DEFAULT NOW()
30+ );
31+
32+
Original file line number Diff line number Diff line change 11from typing import Any
22from aiogram .types import Message
33
4- async def start_command (message : Message , ** kwargs : Any ) -> None :
5- await message .answer ("Hello!" )
4+ from messages import *
65
6+ # Start Command Handler
7+ async def start_command (message : Message )-> None :
78
9+ user_id : int = message .from_user .id
10+ user_name : str = message .from_user .username
11+
12+ print (f"--[INFO] - User { user_id } ({ user_name } ) - started the bot" )
13+
14+ await message .answer (START_MSG )
15+
16+ # Help Command Handler
17+ async def help_command (message : Message ) -> None :
18+
19+ user_id : int = message .from_user .id
20+ user_name : str = message .from_user .username
21+
22+ print (f"--[INFO] - User { user_id } ({ user_name } ) - asked for help" )
23+
24+ await message .answer (HELP_MSG )
25+
26+ # Menu Command Handler
27+ async def menu_command (message : Message ) -> None :
28+
29+ user_id : int = message .from_user .id
30+ user_name : str = message .from_user .username
31+
32+ print (f"--[INFO] - User { user_id } ({ user_name } ) - asked for menu" )
33+
34+ await message .answer (MENU_MSG )
Original file line number Diff line number Diff line change 55from aiogram .types import Message
66
77from config import TOKEN
8- from bot .commands import start_command
8+ from bot .commands import *
99
1010dp : Dispatcher = Dispatcher ()
1111
12+ # Commands Handlers
1213@dp .message (Command ("start" ))
1314async def start (message : Message ):
1415 await start_command (message )
1516
17+ @dp .message (Command ("help" ))
18+ async def help (message : Message ):
19+ await help_command (message )
1620
21+ @dp .message (Command ("menu" ))
22+ async def menu (message : Message ):
23+ await menu_command (message )
24+
25+ # Main Function
1726async def main ():
1827 bot : Bot = Bot (token = TOKEN )
1928 await dp .start_polling (bot )
2029
30+ # Start point
2131if __name__ == "__main__" :
32+ print ("-- STARTING ROCKY --\n " )
2233 asyncio .run (main ())
Original file line number Diff line number Diff line change 1+ START_MSG : str = "👋 Hey there!\n I'm 🦝 Rocky — your personal focus assistant.\n Ready to configure language?"
2+ START_MSG_AGAIN : str = "👋 Welcome back, legend.\n Rocky missed you. Let’s keep crushing it 💥"
3+
4+ HELP_MSG : str = "❓ Need help? Just type \n /add to create a task, \n /idea to save an idea, \n /done to complete your task."
5+
6+ MAKE_TASK_MSG : str = "🧠 What's your next focus task?"
7+ TASK_CREATED_MSG : str = "✅ Got it! Your task has been created."
8+ TASK_COMPLETED_MSG : str = "🎯 Boom! Task completed. Great job!"
9+ TASK_DELETED_MSG : str = "🗑️ Task removed from your queue."
10+ TASK_UPDATED_MSG : str = "🔁 Task updated successfully."
11+
12+ IDEAS_MSG : str = "💡 Here are all your brilliant ideas:"
13+ CREATE_IDEA_MSG : str = "💬 What's your idea? Type it below:"
14+ IDEA_CREATED_MSG : str = "✨ Idea saved! Never lose a thought again."
15+ DELETE_IDEA_MSG : str = "⚠️ Are you sure you want to delete this idea?"
16+
17+ ERROR_MSG : str = "⚠️ Oops! Something went wrong. Try again or send /help."
18+
19+ MENU_MSG = "📋 Your Main Menu:\n \n ✅ /add – Create a new task\n 💡 /idea – Save an idea\n 🎯 /myday – View your day\n 🔧 /settings – Settings & preferences\n ✨ /help – Need guidance?\n \n Rocky is here to help you stay focused! 🦝"
20+
You can’t perform that action at this time.
0 commit comments