Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Bizordec committed Apr 27, 2022
0 parents commit 1344aaf
Show file tree
Hide file tree
Showing 61 changed files with 7,233 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Create .env file based on this file and fill the variables.
# cp .env.example .env

# VK login and password.
# Required if both KATE_TOKEN and VK_OFFICIAL_TOKEN not specified.
VK_LOGIN=
VK_PASSWORD=

# Numeric id of VK community.
# Required.
VK_COMMUNITY_ID=

# VK community token.
# To obtain it:
# 1. Go to your community page;
# 2. "Manage" -> "API usage" -> "Access usage" -> "Create token";
# 3. Select "Allow access to community management";
# 4. Copy token and paste here.
# Required.
VK_COMMUNITY_TOKEN=

# Title for your server (1-14 characters).
# Required.
VK_SERVER_TITLE=

# Numeric id of main Telegram channel.
# Required if channel is private.
TGM_CHANNEL_ID=

# Name of main Telegram channel.
# Required if TGM_CHANNEL_ID not specified.
TGM_CHANNEL_USERNAME=

# Numeric id of playlist Telegram channel.
# Optional if you don't need playlist channel,
# otherwise required if channel is private.
TGM_PL_CHANNEL_ID=

# Name of playlist Telegram channel.
# Optional if you don't need playlist channel,
# otherwise required if TGM_PL_CHANNEL_ID not specified.
TGM_PL_CHANNEL_USERNAME=

# Phone number of Telegram client account.
# Required if you need Telegram bot.
TGM_CLIENT_PHONE=

# Token of Telegram bot.
# Read more: https://core.telegram.org/bots#6-botfather
# Required.
TGM_BOT_TOKEN=

# Id and hash for your Telegram application.
# Read more: https://core.telegram.org/api/obtaining_api_id
# Required.
TGM_API_ID=
TGM_API_HASH=

# Server URL, which will be used by VK for callback events.
# Required.
SERVER_URL=

# VK user tokens.
# Required if VK_LOGIN and VK_PASSWORD not specified, otherwise tokens will be auto generated.
KATE_TOKEN=
VK_OFFICIAL_TOKEN=

# App's language
# Default: "en"
VTT_LANGUAGE=

# VK API language
# Default: value of VTT_LANGUAGE
VK_API_LANGUAGE=
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
venv
.venv
__pycache__
vk_config.v2.json
celeryconfig.py
.env*
!.env.example
node_modules
*.db
*.session
*.session-journal
celerybeat-*
94 changes: 94 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Telegram Bot",
"type": "python",
"request": "launch",
"module": "app.bot.main",
"justMyCode": false
},
{
"name": "Python: VK Callback receiver",
"type": "python",
"request": "launch",
"module": "uvicorn",
"args": [
"app.main:app",
"--log-config",
"app/logging_config.yaml",
"--log-level",
"debug",
],
"jinja": true,
"justMyCode": false
},
{
"name": "Python: Wall worker",
"type": "python",
"request": "launch",
"module": "celery",
"console": "integratedTerminal",
"args": [
"-A",
"app.celery_worker",
"worker",
"-Q",
"vtt-wall",
"-l",
"info",
"-P",
"solo",
],
"justMyCode": false
},
{
"name": "Python: Playlist worker",
"type": "python",
"request": "launch",
"module": "celery",
"console": "integratedTerminal",
"args": [
"-A",
"app.celery_worker",
"worker",
"-Q",
"vtt-playlist",
"-l",
"info",
"-P",
"solo",
],
"justMyCode": false
},
{
"name": "Python: DB cleanup scheduler",
"type": "python",
"request": "launch",
"module": "celery",
"console": "integratedTerminal",
"args": [
"-A",
"app.celery_worker",
"beat",
"-l",
"debug",
],
"justMyCode": false
},
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"env": {
"PYTHONPATH": "${workspaceFolder}:${env:PYTHONPATH}"
},
"justMyCode": false
},
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true,
},
"editor.formatOnSave": true,
},
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black",
}
Loading

0 comments on commit 1344aaf

Please sign in to comment.