Added project structure
This commit is contained in:
parent
ec2dcc2b4b
commit
a781aaa41d
6
.gitignore
vendored
6
.gitignore
vendored
@ -138,3 +138,9 @@ dmypy.json
|
|||||||
# Cython debug symbols
|
# Cython debug symbols
|
||||||
cython_debug/
|
cython_debug/
|
||||||
|
|
||||||
|
# custom vs code
|
||||||
|
PythonImportHelper-v2-Completion.json
|
||||||
|
appsettings.*.json
|
||||||
|
|
||||||
|
# idea
|
||||||
|
.idea/
|
@ -1,3 +0,0 @@
|
|||||||
# kd_discord_bot
|
|
||||||
|
|
||||||
Discord moderation Bot for the Keksdose discord server.
|
|
15
appsettings.json
Normal file
15
appsettings.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"TimeFormatSettings": {
|
||||||
|
"DateFormat": "%Y-%m-%d",
|
||||||
|
"TimeFormat": "%H:%M:%S",
|
||||||
|
"DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f",
|
||||||
|
"DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S"
|
||||||
|
},
|
||||||
|
|
||||||
|
"LoggingSettings": {
|
||||||
|
"Path": "logs/",
|
||||||
|
"Filename": "log_$start_time.log",
|
||||||
|
"ConsoleLogLevel": "ERROR",
|
||||||
|
"FileLogLevel": "WARN"
|
||||||
|
}
|
||||||
|
}
|
13
cpl-workspace.json
Normal file
13
cpl-workspace.json
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"WorkspaceSettings": {
|
||||||
|
"DefaultProject": "bot",
|
||||||
|
"Projects": {
|
||||||
|
"bot": "src/bot/bot.json",
|
||||||
|
"bot-commands": "src/bot_commands/bot-commands.json",
|
||||||
|
"bot-events": "src/bot_events/bot-events.json",
|
||||||
|
"bot-core": "src/bot_core/bot-core.json",
|
||||||
|
"bot-data": "src/bot_data/bot-data.json"
|
||||||
|
},
|
||||||
|
"Scripts": {}
|
||||||
|
}
|
||||||
|
}
|
1
src/bot/__init__.py
Normal file
1
src/bot/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
16
src/bot/application.py
Normal file
16
src/bot/application.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl_core.application import ApplicationABC
|
||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
|
from cpl_core.console import Console
|
||||||
|
from cpl_core.dependency_injection import ServiceProviderABC
|
||||||
|
|
||||||
|
|
||||||
|
class Application(ApplicationABC):
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||||
|
ApplicationABC.__init__(self, config, services)
|
||||||
|
|
||||||
|
async def configure(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
async def main(self):
|
||||||
|
Console.write_line('Hello World')
|
15
src/bot/appsettings.json
Normal file
15
src/bot/appsettings.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"TimeFormatSettings": {
|
||||||
|
"DateFormat": "%Y-%m-%d",
|
||||||
|
"TimeFormat": "%H:%M:%S",
|
||||||
|
"DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f",
|
||||||
|
"DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S"
|
||||||
|
},
|
||||||
|
|
||||||
|
"LoggingSettings": {
|
||||||
|
"Path": "logs/",
|
||||||
|
"Filename": "log_$start_time.log",
|
||||||
|
"ConsoleLogLevel": "ERROR",
|
||||||
|
"FileLogLevel": "WARN"
|
||||||
|
}
|
||||||
|
}
|
48
src/bot/bot.json
Normal file
48
src/bot/bot.json
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "bot",
|
||||||
|
"Version": {
|
||||||
|
"Major": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0.dev1"
|
||||||
|
},
|
||||||
|
"Author": "Sven Heidemann",
|
||||||
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
|
"Description": "Keksdose bot",
|
||||||
|
"LongDescription": "Discord bot for the Keksdose discord Server",
|
||||||
|
"URL": "https://www.sh-edraft.de",
|
||||||
|
"CopyrightDate": "2022",
|
||||||
|
"CopyrightName": "sh-edraft.de",
|
||||||
|
"LicenseName": "MIT",
|
||||||
|
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||||
|
"Dependencies": [
|
||||||
|
"cpl-core>=2022.7.0",
|
||||||
|
"cpl-translation==2022.7.0",
|
||||||
|
"cpl-query==2022.7.0"
|
||||||
|
],
|
||||||
|
"DevDependencies": [
|
||||||
|
"cpl-cli>=2022.7.0.post1"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.10.4",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "bot.main",
|
||||||
|
"EntryPoint": "bot",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
18
src/bot/main.py
Normal file
18
src/bot/main.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import asyncio
|
||||||
|
|
||||||
|
from cpl_core.application import ApplicationBuilder
|
||||||
|
|
||||||
|
from bot.application import Application
|
||||||
|
from bot.startup import Startup
|
||||||
|
|
||||||
|
|
||||||
|
async def main():
|
||||||
|
app_builder = ApplicationBuilder(Application)
|
||||||
|
app_builder.use_startup(Startup)
|
||||||
|
app: Application = await app_builder.build_async()
|
||||||
|
await app.run_async()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
ml = asyncio.get_event_loop()
|
||||||
|
ml.run_until_complete(main())
|
16
src/bot/startup.py
Normal file
16
src/bot/startup.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl_core.application import StartupABC
|
||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
|
from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC
|
||||||
|
from cpl_core.environment import ApplicationEnvironment
|
||||||
|
|
||||||
|
|
||||||
|
class Startup(StartupABC):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
StartupABC.__init__(self)
|
||||||
|
|
||||||
|
async def configure_configuration(self, configuration: ConfigurationABC, environment: ApplicationEnvironment) -> ConfigurationABC:
|
||||||
|
return configuration
|
||||||
|
|
||||||
|
async def configure_services(self, services: ServiceCollectionABC, environment: ApplicationEnvironment) -> ServiceProviderABC:
|
||||||
|
return services.build_service_provider()
|
1
src/bot_commands/__init__.py
Normal file
1
src/bot_commands/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
46
src/bot_commands/bot-commands.json
Normal file
46
src/bot_commands/bot-commands.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "bot-commands",
|
||||||
|
"Version": {
|
||||||
|
"Major": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0.dev1"
|
||||||
|
},
|
||||||
|
"Author": "Sven Heidemann",
|
||||||
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
|
"Description": "Keksdose bot - commands",
|
||||||
|
"LongDescription": "Discord bot for the Keksdose discord Server - command package",
|
||||||
|
"URL": "https://www.sh-edraft.de",
|
||||||
|
"CopyrightDate": "2022",
|
||||||
|
"CopyrightName": "sh-edraft.de",
|
||||||
|
"LicenseName": "MIT",
|
||||||
|
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||||
|
"Dependencies": [
|
||||||
|
"cpl-core>=2022.7.0"
|
||||||
|
],
|
||||||
|
"DevDependencies": [
|
||||||
|
"cpl-cli>=2022.7.0"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.10.4",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "",
|
||||||
|
"EntryPoint": "",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
1
src/bot_core/__init__.py
Normal file
1
src/bot_core/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
46
src/bot_core/bot-core.json
Normal file
46
src/bot_core/bot-core.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "bot-core",
|
||||||
|
"Version": {
|
||||||
|
"Major": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0.dev1"
|
||||||
|
},
|
||||||
|
"Author": "Sven Heidemann",
|
||||||
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
|
"Description": "Keksdose bot - core",
|
||||||
|
"LongDescription": "Discord bot for the Keksdose discord Server - core package",
|
||||||
|
"URL": "https://www.sh-edraft.de",
|
||||||
|
"CopyrightDate": "2022",
|
||||||
|
"CopyrightName": "sh-edraft.de",
|
||||||
|
"LicenseName": "MIT",
|
||||||
|
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||||
|
"Dependencies": [
|
||||||
|
"cpl-core>=2022.7.0"
|
||||||
|
],
|
||||||
|
"DevDependencies": [
|
||||||
|
"cpl-cli>=2022.7.0"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.10.4",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "",
|
||||||
|
"EntryPoint": "",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
1
src/bot_data/__init__.py
Normal file
1
src/bot_data/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
46
src/bot_data/bot-data.json
Normal file
46
src/bot_data/bot-data.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "bot-data",
|
||||||
|
"Version": {
|
||||||
|
"Major": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0.dev1"
|
||||||
|
},
|
||||||
|
"Author": "Sven Heidemann",
|
||||||
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
|
"Description": "Keksdose bot - data",
|
||||||
|
"LongDescription": "Discord bot for the Keksdose discord Server - database package",
|
||||||
|
"URL": "https://www.sh-edraft.de",
|
||||||
|
"CopyrightDate": "2022",
|
||||||
|
"CopyrightName": "sh-edraft.de",
|
||||||
|
"LicenseName": "MIT",
|
||||||
|
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||||
|
"Dependencies": [
|
||||||
|
"cpl-core>=2022.7.0"
|
||||||
|
],
|
||||||
|
"DevDependencies": [
|
||||||
|
"cpl-cli>=2022.7.0.post1"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.10.4",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "library",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "",
|
||||||
|
"EntryPoint": "",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
1
src/bot_events/__init__.py
Normal file
1
src/bot_events/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
46
src/bot_events/bot-events.json
Normal file
46
src/bot_events/bot-events.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "bot-events",
|
||||||
|
"Version": {
|
||||||
|
"Major": "1",
|
||||||
|
"Minor": "0",
|
||||||
|
"Micro": "0.dev1"
|
||||||
|
},
|
||||||
|
"Author": "Sven Heidemann",
|
||||||
|
"AuthorEmail": "sven.heidemann@sh-edraft.de",
|
||||||
|
"Description": "Keksdose bot - events",
|
||||||
|
"LongDescription": "Discord bot for the Keksdose discord Server - event package",
|
||||||
|
"URL": "https://www.sh-edraft.de",
|
||||||
|
"CopyrightDate": "2022",
|
||||||
|
"CopyrightName": "sh-edraft.de",
|
||||||
|
"LicenseName": "MIT",
|
||||||
|
"LicenseDescription": "MIT, see LICENSE for more details.",
|
||||||
|
"Dependencies": [
|
||||||
|
"cpl-core>=2022.7.0"
|
||||||
|
],
|
||||||
|
"DevDependencies": [
|
||||||
|
"cpl-cli>=2022.7.0"
|
||||||
|
],
|
||||||
|
"PythonVersion": ">=3.10.4",
|
||||||
|
"PythonPath": {
|
||||||
|
"linux": ""
|
||||||
|
},
|
||||||
|
"Classifiers": []
|
||||||
|
},
|
||||||
|
"BuildSettings": {
|
||||||
|
"ProjectType": "console",
|
||||||
|
"SourcePath": "",
|
||||||
|
"OutputPath": "../../dist",
|
||||||
|
"Main": "",
|
||||||
|
"EntryPoint": "",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user