Switching to goarch_api.

This commit is contained in:
Elliott Pardee 2018-08-24 06:22:32 -04:00
parent a0938b3406
commit cebd5bf401
12 changed files with 598 additions and 409 deletions

View File

@ -1,6 +1,13 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="goarch_api.*" />
</list>
</option>
</inspection_tool>
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />

439
.idea/workspace.xml generated
View File

@ -2,29 +2,16 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="b1c872ee-962e-4a94-aa78-0eb1f70757c1" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/OrthoBot.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/dictionaries/elliott.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/LICENSE.txt" afterDir="false" />
<change afterPath="$PROJECT_DIR$/QA.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/bot.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/central.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/config.example.ini" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/extensions/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/extensions/vylogger.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/handlers/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/handlers/commandlogic/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/handlers/commandlogic/commandbridge.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/handlers/commandlogic/settings/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/handlers/commandlogic/settings/misc.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/handlers/commandlogic/strings.json" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/handlers/commands.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/bot.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/bot.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/handlers/commandlogic/__init__.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/handlers/commandlogic/commandbridge.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/handlers/commandlogic/settings/__init__.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/handlers/commandlogic/settings/misc.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/handlers/commandlogic/strings.json" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/handlers/commands.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/handlers/commands.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
@ -36,90 +23,114 @@
<session id="-578934931">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.open.time.2" value="1" />
<entry key="project.opened" value="1" />
<entry key="project.closed" value="6" />
<entry key="project.open.time.18" value="1" />
<entry key="project.open.time.2" value="2" />
<entry key="project.open.time.24" value="1" />
<entry key="project.open.time.25" value="1" />
<entry key="project.open.time.29" value="1" />
<entry key="project.open.time.39" value="1" />
<entry key="project.open.time.6" value="1" />
<entry key="project.opened" value="8" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="ini" value="16" />
<entry key="json" value="656" />
<entry key="md" value="1130" />
<entry key="py" value="3048" />
<entry key="Python Console" value="378" />
<entry key="dummy" value="14" />
<entry key="ini" value="84" />
<entry key="json" value="670" />
<entry key="md" value="1136" />
<entry key="py" value="9977" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="JSON" value="656" />
<entry key="Markdown" value="1130" />
<entry key="PLAIN_TEXT" value="16" />
<entry key="Python" value="3048" />
<entry key="JSON" value="670" />
<entry key="Markdown" value="1136" />
<entry key="PLAIN_TEXT" value="98" />
<entry key="Python" value="10355" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="gitignore" value="1" />
<entry key="ini" value="5" />
<entry key="json" value="1" />
<entry key="ini" value="7" />
<entry key="json" value="2" />
<entry key="md" value="2" />
<entry key="py" value="6" />
<entry key="py" value="19" />
<entry key="versiondb" value="1" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="JSON" value="1" />
<entry key="JSON" value="2" />
<entry key="Markdown" value="2" />
<entry key="PLAIN_TEXT" value="7" />
<entry key="Python" value="6" />
<entry key="PLAIN_TEXT" value="9" />
<entry key="Python" value="19" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/handlers/commandlogic/settings/misc.py">
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/strings.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="130">
<caret line="51" column="20" selection-start-line="51" selection-start-column="20" selection-end-line="51" selection-end-column="20" />
<folding>
<element signature="e#748#757#0" expanded="true" />
</folding>
<state relative-caret-position="92">
<caret line="4" column="105" selection-start-line="4" selection-start-column="105" selection-end-line="4" selection-end-column="105" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/QA.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="FIRST">
<first_editor relative-caret-position="115">
<caret line="17" column="47" lean-forward="true" selection-start-line="17" selection-start-column="47" selection-end-line="17" selection-end-column="47" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/handlers/commandlogic/commandbridge.py">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/command_bridge.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-338">
<caret line="539" column="83" selection-start-line="539" selection-start-column="83" selection-end-line="539" selection-end-column="83" />
<state relative-caret-position="198">
<caret line="46" column="34" selection-start-line="46" selection-start-column="34" selection-end-line="46" selection-end-column="34" />
<folding>
<element signature="e#748#759#0" expanded="true" />
<marker date="1534392845608" expanded="true" signature="1416:1417" ph="..." />
<marker date="1535106011980" expanded="true" signature="1084:1085" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/.gitignore">
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/settings/misc.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="268">
<caret line="113" column="14" lean-forward="true" selection-start-line="113" selection-start-column="14" selection-end-line="113" selection-end-column="14" />
<state relative-caret-position="-216">
<caret line="22" column="24" lean-forward="true" selection-start-line="22" selection-start-column="24" selection-end-line="22" selection-end-column="24" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/embed_builders.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1481">
<caret line="49" column="22" lean-forward="true" selection-start-line="49" selection-start-column="22" selection-end-line="49" selection-end-column="22" />
<folding>
<element signature="e#0#36#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/config.example.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="115">
<caret line="5" column="17" selection-start-line="5" selection-start-column="17" selection-end-line="5" selection-end-column="17" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/config.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="115">
<caret line="5" column="17" selection-start-line="5" selection-start-column="17" selection-end-line="5" selection-end-column="17" />
</state>
</provider>
</entry>
@ -127,8 +138,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/handlers/commands.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="115">
<caret line="33" column="15" selection-start-line="33" selection-start-column="15" selection-end-line="33" selection-end-column="15" />
<state relative-caret-position="60">
<caret line="32" column="6" selection-start-line="32" selection-start-column="6" selection-end-line="32" selection-end-column="6" />
<folding>
<element signature="e#748#757#0" expanded="true" />
</folding>
@ -136,23 +147,11 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="FIRST">
<first_editor relative-caret-position="184">
<caret line="17" selection-start-line="17" selection-end-line="17" selection-end-column="48" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/bot.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-4723">
<caret line="41" column="9" selection-start-line="41" selection-start-column="9" selection-end-line="41" selection-end-column="9" />
<state relative-caret-position="106">
<caret line="77" column="97" selection-start-line="77" selection-start-column="97" selection-end-line="77" selection-end-column="97" />
<folding>
<element signature="e#748#762#0" expanded="true" />
</folding>
@ -160,10 +159,10 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/central.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1242">
<state relative-caret-position="851">
<caret line="45" column="36" selection-start-line="45" selection-start-column="36" selection-end-line="45" selection-end-column="36" />
<folding>
<element signature="e#748#767#0" expanded="true" />
@ -174,6 +173,13 @@
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>BibleBot</find>
@ -182,6 +188,7 @@
<find>misc</find>
<find>votd</find>
<find>random</find>
<find>&lt;+</find>
</findStrings>
<replaceStrings>
<replace />
@ -196,17 +203,21 @@
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/QA.md" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/src/handlers/commandlogic/translation.json" />
<option value="$PROJECT_DIR$/src/handlers/commandlogic/settings/misc.py" />
<option value="$PROJECT_DIR$/src/config.example.ini" />
<option value="$PROJECT_DIR$/src/config.ini" />
<option value="$PROJECT_DIR$/src/handlers/commandlogic/strings.json" />
<option value="$PROJECT_DIR$/src/bot.py" />
<option value="$PROJECT_DIR$/src/handlers/commands.py" />
<option value="$PROJECT_DIR$/src/handlers/commandlogic/commandbridge.py" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/src/central.py" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/src/handlers/commandlogic/commandbridge.py" />
<option value="$PROJECT_DIR$/src/handlers/commandlogic/embed_builders.py" />
<option value="$PROJECT_DIR$/src/config.example.ini" />
<option value="$PROJECT_DIR$/src/config.ini" />
<option value="$PROJECT_DIR$/src/handlers/command_logic/embed_builders.py" />
<option value="$PROJECT_DIR$/src/bot.py" />
<option value="$PROJECT_DIR$/src/handlers/command_logic/strings.json" />
<option value="$PROJECT_DIR$/src/handlers/commands.py" />
<option value="$PROJECT_DIR$/src/handlers/command_logic/command_bridge.py" />
</list>
</option>
</component>
@ -224,6 +235,7 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
@ -252,21 +264,20 @@
<item name="OrthoBot" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="handlers" type="462c0819:PsiDirectoryNode" />
<item name="commandlogic" type="462c0819:PsiDirectoryNode" />
<item name="command_logic" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="OrthoBot" type="b2602c69:ProjectViewProjectNode" />
<item name="OrthoBot" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="handlers" type="462c0819:PsiDirectoryNode" />
<item name="commandlogic" type="462c0819:PsiDirectoryNode" />
<item name="command_logic" type="462c0819:PsiDirectoryNode" />
<item name="settings" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
@ -319,7 +330,28 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/handlers/commandlogic/commandbridge.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/handlers/commandlogic/command_bridge.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="embed_builders" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="OrthoBot" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/handlers/command_logic" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/handlers/command_logic/embed_builders.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
@ -331,9 +363,11 @@
<list>
<item itemvalue="Python.Run OrthoBotInternal" />
<item itemvalue="Python.commandbridge" />
<item itemvalue="Python.embed_builders" />
</list>
<recent_temporary>
<list>
<item itemvalue="Python.embed_builders" />
<item itemvalue="Python.commandbridge" />
</list>
</recent_temporary>
@ -364,24 +398,43 @@
<frame x="54" y="27" width="1312" height="741" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Favorites" side_tool="true" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24980605" />
<window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.24980605" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info anchor="bottom" id="Version Control" />
<window_info anchor="bottom" id="Python Console" />
<window_info anchor="bottom" id="Terminal" visible="true" weight="0.3305648" />
<window_info anchor="bottom" id="Event Log" side_tool="true" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" weight="0.3294702" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.32890365" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.3294702" />
<window_info anchor="bottom" id="Version Control" order="7" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.3305648" />
<window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="10" weight="0.32890365" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
<layout-to-restore>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24980605" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.32890365" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.3294702" />
<window_info anchor="bottom" id="Version Control" order="7" />
<window_info anchor="bottom" id="Terminal" order="8" weight="0.3305648" />
<window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="10" weight="0.32890365" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout-to-restore>
</component>
<component name="UnknownFeatures">
<option featureType="com.intellij.fileTypeFactory" implementationName="*.ini" />
@ -390,101 +443,44 @@
<option name="myLimit" value="2678400000" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/config.example.ini">
<entry file="file://$PROJECT_DIR$/databases/versiondb" />
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="184">
<caret line="8" column="15" lean-forward="true" selection-start-line="8" selection-start-column="15" selection-end-line="8" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/handlers/commandlogic/strings.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="46">
<caret line="5" column="172" selection-start-line="5" selection-start-column="172" selection-end-line="5" selection-end-column="172" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/QA.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="FIRST">
<first_editor relative-caret-position="115">
<caret line="17" column="47" lean-forward="true" selection-start-line="17" selection-start-column="47" selection-end-line="17" selection-end-column="47" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/bot.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-4723">
<caret line="41" column="9" selection-start-line="41" selection-start-column="9" selection-end-line="41" selection-end-column="9" />
<folding>
<element signature="e#748#762#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/handlers/commandlogic/settings/misc.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="130">
<caret line="51" column="20" selection-start-line="51" selection-start-column="20" selection-end-line="51" selection-end-column="20" />
<folding>
<element signature="e#748#757#0" expanded="true" />
</folding>
<state relative-caret-position="2599">
<caret line="113" column="14" selection-start-line="113" selection-start-column="14" selection-end-line="113" selection-end-column="14" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="FIRST">
<first_editor relative-caret-position="184">
<caret line="17" selection-start-line="17" selection-end-line="17" selection-end-column="48" />
<first_editor relative-caret-position="391">
<caret line="17" column="54" selection-start-line="17" selection-start-column="54" selection-end-line="17" selection-end-column="54" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/handlers/commands.py">
<entry file="file://$PROJECT_DIR$/venv/lib/python3.6/site-packages/goarch_api/daily.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="115">
<caret line="33" column="15" selection-start-line="33" selection-start-column="15" selection-end-line="33" selection-end-column="15" />
<folding>
<element signature="e#748#757#0" expanded="true" />
</folding>
<state relative-caret-position="138">
<caret line="13" column="28" lean-forward="true" selection-start-line="13" selection-start-column="28" selection-end-line="13" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/handlers/commandlogic/commandbridge.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-338">
<caret line="539" column="83" selection-start-line="539" selection-start-column="83" selection-end-line="539" selection-end-column="83" />
<folding>
<element signature="e#748#759#0" expanded="true" />
<marker date="1534392845608" expanded="true" signature="1416:1417" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/databases/versiondb">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/src/config.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="184">
<caret line="8" column="15" lean-forward="true" selection-start-line="8" selection-start-column="15" selection-end-line="8" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="268">
<caret line="113" column="14" lean-forward="true" selection-start-line="113" selection-start-column="14" selection-end-line="113" selection-end-column="14" />
<entry file="file://$PROJECT_DIR$/QA.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="FIRST">
<first_editor relative-caret-position="391">
<caret line="17" column="47" selection-start-line="17" selection-start-column="47" selection-end-line="17" selection-end-column="47" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/central.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1242">
<state relative-caret-position="851">
<caret line="45" column="36" selection-start-line="45" selection-start-column="36" selection-end-line="45" selection-end-column="36" />
<folding>
<element signature="e#748#767#0" expanded="true" />
@ -492,5 +488,98 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/venv/lib/python3.6/site-packages/goarch_api/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="506">
<caret line="22" column="8" selection-start-line="22" selection-start-column="8" selection-end-line="22" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/venv/lib/python3.6/site-packages/goarch_api/lectionary.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="16" column="8" selection-start-line="16" selection-start-column="8" selection-end-line="16" selection-end-column="8" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/venv/lib/python3.6/site-packages/goarch_api/saint.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="207">
<caret line="15" column="8" selection-start-line="15" selection-start-column="8" selection-end-line="15" selection-end-column="8" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/config.example.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="115">
<caret line="5" column="17" selection-start-line="5" selection-start-column="17" selection-end-line="5" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/config.ini">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="115">
<caret line="5" column="17" selection-start-line="5" selection-start-column="17" selection-end-line="5" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/bot.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="106">
<caret line="77" column="97" selection-start-line="77" selection-start-column="97" selection-end-line="77" selection-end-column="97" />
<folding>
<element signature="e#748#762#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/settings/misc.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-216">
<caret line="22" column="24" lean-forward="true" selection-start-line="22" selection-start-column="24" selection-end-line="22" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/embed_builders.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1481">
<caret line="49" column="22" lean-forward="true" selection-start-line="49" selection-start-column="22" selection-end-line="49" selection-end-column="22" />
<folding>
<element signature="e#0#36#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/strings.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="92">
<caret line="4" column="105" selection-start-line="4" selection-start-column="105" selection-end-line="4" selection-end-column="105" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/handlers/commands.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="32" column="6" selection-start-line="32" selection-start-column="6" selection-end-line="32" selection-end-column="6" />
<folding>
<element signature="e#748#757#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/command_bridge.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="198">
<caret line="46" column="34" selection-start-line="46" selection-start-column="34" selection-end-line="46" selection-end-column="34" />
<folding>
<element signature="e#748#759#0" expanded="true" />
<marker date="1535106011980" expanded="true" signature="1084:1085" ph="..." />
</folding>
</state>
</provider>
</entry>
</component>
</project>

View File

@ -15,7 +15,7 @@ source venv/bin/activate
cp src/config.example.ini src/config.ini
$EDITOR src/config.ini
pip install -U "https://github.com/Rapptz/discord.py/archive/rewrite.zip#egg=discord.py[voice]"
pip install -U tinydb colorama requests bs4 lxml
pip install -U tinydb colorama requests bs4 lxml pyaes
python src/bot.py
```

View File

@ -24,7 +24,7 @@ import os
import discord
import central
from handlers.commandlogic.settings import misc
from handlers.command_logic import embed_builders
from handlers.commands import CommandHandler
dir_path = os.path.dirname(os.path.realpath(__file__))
@ -39,7 +39,7 @@ configVersion.read(dir_path + "/config.example.ini")
class OrthoBot(discord.AutoShardedClient):
def __init__(self, *args, loop=None, **kwargs):
super().__init__(*args, loop=loop, **kwargs)
#self.bg_task = self.loop.create_task(self.run_dailies())
self.bg_task = self.loop.create_task(self.run_dailies())
self.current_page = None
self.total_pages = None
@ -74,15 +74,15 @@ class OrthoBot(discord.AutoShardedClient):
current_time = datetime.datetime.utcnow().strftime("%H:%M")
if daily_time == current_time:
pass
embed = embed_builders.create_daily_embed()
await channel.send("Here is today's daily readings and saints/feasts:")
await channel.send(embed=embed)
except Exception:
pass
await asyncio.sleep(60)
async def on_message(self, raw):
await self.wait_until_ready()
sender = raw.author
identifier = sender.name + "#" + sender.discriminator
channel = raw.channel
@ -231,11 +231,7 @@ class OrthoBot(discord.AutoShardedClient):
await msg.clear_reactions()
else:
if "reference" not in res and "text" not in res:
# noinspection PyBroadException
try:
await channel.send(embed=res["message"])
except Exception:
pass
else:
if res["message"] is not None:
await channel.send(res["message"])

View File

@ -0,0 +1 @@
__all__ = ["command_bridge.py"]

View File

@ -20,22 +20,11 @@ import json
import math
import os
import sys
from datetime import date, timedelta
from http.client import HTTPConnection
import logging
import html
import discord
import requests
from bs4 import BeautifulSoup
HTTPConnection.debuglevel = 0
logging.getLogger("requests").setLevel(logging.WARNING)
logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger("urllib3.connectionpool").setLevel(logging.WARNING)
from handlers.commandlogic.settings import misc
from handlers.command_logic.settings import misc
from . import embed_builders
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(dir_path + "/../..")
@ -51,27 +40,28 @@ def run_command(command, args, user, guild, channel):
if command == "orthobot":
embed.title = lang["orthobot"].replace("<orthobotversion>", central.version.split("v")[1])
embed.description = lang["code"].replace("repositoryLink", "https://github.com/vypr/OrthoBot")
embed.description = lang["code"].replace("repositoryLink", "https://github.com/Oikonomia/OrthoBot")
embed.color = 303102
embed.set_thumbnail(url=central.icon)
embed.set_footer(text=central.version, icon_url=central.icon)
response = lang["commandlist"]
response2 = lang["commandlist2"]
#response2 = lang["commandlist2"]
response3 = lang["guildcommandlist"]
response = response.replace("<orthobotversion>", central.version)
response = response.replace("* ", "")
response = response.replace("+", central.config["OrthoBot"]["commandPrefix"])
response2 = response2.replace("* ", "")
response2 = response2.replace("+", central.config["OrthoBot"]["commandPrefix"])
#response2 = response2.replace("* ", "")
#response2 = response2.replace("+", central.config["OrthoBot"]["commandPrefix"])
response3 = response3.replace("* ", "")
response3 = response3.replace("+", central.config["OrthoBot"]["commandPrefix"])
embed.add_field(name=lang["commandlistName"], value=response, inline=False)
embed.add_field(name=lang["councillistName"], value=response2, inline=False)
#embed.add_field(name=lang["councillistName"], value=response2, inline=False)
embed.add_field(name=lang["guildcommandlistName"], value=response3, inline=False)
return {
@ -138,8 +128,46 @@ def run_command(command, args, user, guild, channel):
"level": "info",
"message": pages[0]
}
elif command == "yesterday":
return_embed = embed_builders.create_daily_embed("yesterday")
return {
"level": "info",
"message": return_embed
}
elif command == "today":
return_embed = create_embed()
return_embed = embed_builders.create_daily_embed()
return {
"level": "info",
"message": return_embed
}
elif command == "tomorrow":
return_embed = embed_builders.create_daily_embed("tomorrow")
return {
"level": "info",
"message": return_embed
}
elif command == "random":
return_embed = embed_builders.create_daily_embed("random")
return {
"level": "info",
"message": return_embed
}
elif command == "saint" or command == "feast":
return_embed = embed_builders.create_saint_embed(args[0])
return {
"level": "info",
"message": return_embed
}
elif command == "lectionary" or command == "reading":
if len(args) == 4:
return_embed = embed_builders.create_lectionary_embed(args[0], args[1], args[2], _date=args[3])
else:
return_embed = embed_builders.create_lectionary_embed(args[0], args[1], args[2])
return {
"level": "info",
@ -151,7 +179,7 @@ def run_command(command, args, user, guild, channel):
if str(user.id) != central.config["OrthoBot"]["owner"]:
if not perms.manage_guild:
embed.color = 16723502
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + lang["commands"]["setdailytime"],
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + "setdailytime",
value=lang["setdailytimenoperm"])
return {
@ -163,7 +191,7 @@ def run_command(command, args, user, guild, channel):
embed.color = 303102
embed.set_footer(text=central.version, icon_url=central.icon)
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + lang["commands"]["setdailytime"],
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + "setdailytime",
value=lang["setdailytimesuccess"])
return {
@ -172,7 +200,7 @@ def run_command(command, args, user, guild, channel):
}
else:
embed.color = 16723502
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + lang["commands"]["setdailytime"],
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + "setdailytime",
value=lang["setdailytimefail"])
return {
@ -185,7 +213,7 @@ def run_command(command, args, user, guild, channel):
if str(user.id) != central.config["OrthoBot"]["owner"]:
if not perms.manage_guild:
embed.color = 16723502
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + lang["commands"]["cleardailytime"],
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + "cleardailytime",
value=lang["cleardailytimenoperm"])
return {
@ -197,7 +225,7 @@ def run_command(command, args, user, guild, channel):
embed.color = 303102
embed.set_footer(text=central.version, icon_url=central.icon)
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + lang["commands"]["cleardailytime"],
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + "cleardailytime",
value=lang["cleardailytimesuccess"])
return {
@ -217,10 +245,8 @@ def run_command(command, args, user, guild, channel):
response = response.replace("<time>", time + " UTC")
response = response.replace("<channel>", channel)
response = response.replace("<setdailytime>", lang["commands"]["setdailytime"])
response = response.replace("<cleardailytime>", lang["commands"]["cleardailytime"])
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + lang["commands"]["dailytime"],
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + "dailytime",
value=response)
return {
@ -230,25 +256,21 @@ def run_command(command, args, user, guild, channel):
else:
response = lang["nodailytimeused"]
response = response.replace("<setdailytime>", lang["commands"]["setdailytime"])
embed.color = 16723502
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + lang["commands"]["dailytime"],
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + "dailytime",
value=response)
return {
"level": "err",
"message": embed
}
elif command == "random":
pass
elif command == "users":
embed.color = 303102
embed.set_footer(text=central.version, icon_url=central.icon)
processed = len(args[0].users)
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + lang["commands"]["users"],
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + "users",
value=lang["users"] + ": " + str(processed))
return {
@ -261,87 +283,16 @@ def run_command(command, args, user, guild, channel):
processed = len(args[0].guilds)
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + lang["commands"]["servers"],
embed.add_field(name=central.config["OrthoBot"]["commandPrefix"] + "servers",
value=lang["servers"].replace("<count>", str(processed)))
return {
"level": "info",
"message": embed
}
elif command == "creeds":
embed.color = 303102
embed.set_footer(text=central.version, icon_url=central.icon)
response = lang["creedstext"]
response = response.replace("<apostles>", lang["commands"]["apostles"])
response = response.replace("<nicene>", lang["commands"]["nicene"])
response = response.replace("<chalcedonian>", lang["commands"]["chalcedonian"])
response = response.replace("<athanasian>", lang["commands"]["athanasian"])
embed.add_field(name=lang["creeds"], value=response)
return {
"level": "info",
"message": embed
}
elif command == "apostles":
embed.color = 303102
embed.set_footer(text=central.version, icon_url=central.icon)
embed.add_field(name=lang["apostlescreed"], value=lang["apostlestext1"])
return {
"level": "info",
"message": embed
}
elif command == "nicene":
embed.color = 303102
embed.set_footer(text=central.version, icon_url=central.icon)
embed.add_field(name=lang["nicenecreed"], value=lang["nicenetext1"])
embed.add_field(name=u"\u200B", value=lang["nicenetext2"])
embed.add_field(name=u"\u200B", value=lang["nicenetext3"])
embed.add_field(name=u"\u200B", value=lang["nicenetext4"])
return {
"level": "info",
"message": embed
}
elif command == "chalcedonian":
embed.color = 303102
embed.set_footer(text=central.version, icon_url=central.icon)
embed.add_field(name=lang["chalcedoniancreed"], value=lang["chalcedoniantext1"])
embed.add_field(name=u"\u200B", value=lang["chalcedoniantext2"])
return {
"level": "info",
"message": embed
}
elif command == "athanasian":
embed.color = 303102
embed.set_footer(text=central.version, icon_url=central.icon)
embed.add_field(name=lang["pseudoathanasiancreed"],
value=lang["pseudoathanasiantext1"] + "https://www.ccel.org/creeds/athanasian.creed.html")
return {
"level": "info",
"message": embed
}
elif command == "invite":
return {
"level": "info",
"text": True,
"message": "<https://discordapp.com/oauth2/authorize?" +
"client_id=361033318273384449&scope=bot&permissions=93248>"
}
def run_owner_command(bot, command, args, lang):
embed = discord.Embed()
def run_owner_command(bot, command, args):
if command == "puppet":
message = ""
@ -509,64 +460,3 @@ def search(query):
return {}
else:
return None
def create_embed():
url = "https://oca.org/saints/lives"
saints_to_display = 3
resp = requests.get(url)
embed = discord.Embed()
embed.color = 303102
embed.set_footer(text=central.version + " | Saints from OCA, Readings from GOArch",
icon_url=central.icon)
if resp is not None:
soup = BeautifulSoup(resp.text, "lxml")
section = soup.find("section", {"class": "saints"})
saints = section.find_all("article", {"class": "saint"})
for index, saint in enumerate(saints):
if index < saints_to_display:
if index == 0:
embed.set_thumbnail(url = saint.find("img")["src"])
embed.add_field(name=saint.find("h2", {"class": "name"}).get_text(),
value=saint.find("p", {"class": "description"}).get_text(), inline=False)
embed.add_field(name="For more about today's saints (including the remaining " +
str(len(saints) - saints_to_display) + "):", value=url, inline=False)
goarch = requests.get("https://www.goarch.org/chapel")
goarch_soup = BeautifulSoup(goarch.text, "lxml")
readings = goarch_soup.find("ul", {"class": "oc-readings"}).find_all("li")
for reading in readings:
reading_link = reading.find("a")
if "type=epistle" in reading_link["href"]:
strong = reading_link.find("strong")
strong.decompose()
icon = reading_link.find("i")
icon.decompose()
embed.add_field(name="Epistle Reading", value=reading_link.get_text(), inline=True)
elif "type=gospel" in reading_link["href"]:
strong = reading_link.find("strong")
strong.decompose()
icon = reading_link.find("i")
icon.decompose()
embed.add_field(name="Gospel Reading", value=reading_link.get_text(), inline=True)
return embed
return None
if __name__ == "__main__":
create_embed()

View File

@ -0,0 +1,188 @@
from datetime import date, timedelta
import random
import textwrap
import os
import sys
from goarch_api.daily import Daily
from goarch_api.lectionary import Lectionary
from goarch_api.saint import Saint
import discord
from http.client import HTTPConnection
import logging
HTTPConnection.debuglevel = 0
logging.getLogger("requests").setLevel(logging.WARNING)
logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger("urllib3.connectionpool").setLevel(logging.WARNING)
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(dir_path + "/../..")
import central # noqa: E402
def random_date():
start = date.fromtimestamp(0)
end = start + timedelta(days=(365.5 * 50))
return start + (end - start) * random.random()
def create_daily_embed(day="today"):
dates = {
"yesterday": (date.today() - timedelta(1)),
"tomorrow": (date.today() + timedelta(1)),
"random": random_date()
}
saints_to_display = 3
try:
if day == "today":
daily = Daily()
else:
date_formatted = f"{dates[day].month}/{dates[day].day}/{dates[day].year}"
daily = Daily(date_formatted)
except Exception:
day = "random"
date_formatted = f"{dates[day].month}/{dates[day].day}/{dates[day].year}"
daily = Daily(date_formatted)
daily.get_data()
embed = discord.Embed()
embed.color = 303102
embed.title = daily.formatted_date
embed.url = daily.public_url
embed.set_thumbnail(url=daily.icon)
for index, saint in enumerate(daily.saints):
saint.get_data()
if index == 0:
if daily.lectionary_title == saint.title:
embed.description = ""
if daily.fasting:
embed.description = daily.fasting
else:
embed.description = "No Fasting"
if daily.tone:
embed.description += f" / {daily.tone}"
else:
if daily.fasting:
embed.title += f" / {daily.fasting}"
else:
embed.title += " / No Fasting"
if daily.tone:
embed.title += f" / {daily.tone}"
embed.description = daily.lectionary_title
if index < saints_to_display:
if len(saint.readings) > 0:
biography_excerpt = textwrap.shorten(saint.readings[0].body, width=250, placeholder="...")
embed.add_field(name=f"{saint.title} ({saint.id})",
value=f"© {saint.readings[0].copyright} // " + biography_excerpt, inline=False)
else:
embed.add_field(name=f"{saint.title} ({saint.id})", value="No information provided.", inline=False)
name = "For more about today's saints and feasts"
if saints_to_display < len(daily.saints):
name += f" (including the remaining {str(len(daily.saints) - saints_to_display)})"
embed.add_field(name=f"{name}:", value=daily.public_url)
for reading in daily.readings:
title = f"{reading.type_bb.title()} Reading ({reading.id}, {reading.event})"
title = title.replace("Mg ", "Matins Gospel ")
embed.add_field(name=title, value=reading.translation.short_title, inline=True)
embed.set_footer(icon_url=central.icon,
text=f"{central.version} | Greek Orthodox Archdiocese of America")
return embed
def create_saint_embed(_id):
saint = Saint(_id)
saint.get_data()
embed = discord.Embed()
embed.color = 303102
embed.title = f"{saint.title} ({saint.id})"
embed.url = saint.public_url
if len(saint.icons) > 0:
embed.set_thumbnail(url=saint.icons[0].url)
if len(saint.readings) > 0:
biography_excerpt = textwrap.shorten(saint.readings[0].body, width=600, placeholder="...")
embed.add_field(name="Biography",
value=f"© {saint.readings[0].copyright} // " + biography_excerpt, inline=False)
else:
embed.add_field(name=saint.title, value="No information provided.", inline=False)
for reading in saint.lectionary:
# this is not a Reading object, it is a LectionaryReading object
if reading.type == "E":
_type = "Epistle Reading"
elif reading.type == "G":
_type = "Gospel Reading"
elif reading.type == "MG":
_type = "Matins Gospel Reading"
else:
_type = reading.type
_type += f" ({reading.id}, {saint.id})"
embed.add_field(name=_type, value=reading.short_title, inline=True)
for hymn in saint.hymns:
embed.add_field(name=f"{hymn.short_title} ({hymn.tone})",
value=f"© {hymn.translation.copyright} // {hymn.translation.body}", inline=False)
name = "For more about this saint/feast"
embed.add_field(name=f"{name}:", value=saint.public_url, inline=False)
embed.set_footer(icon_url=central.icon,
text=f"{central.version} | Greek Orthodox Archdiocese of America")
return embed
def create_lectionary_embed(_type, _id, event, _date=None):
lectionary = Lectionary(_type, _id, event, date=_date)
lectionary.get_data()
embed = discord.Embed()
embed.color = 303102
embed.title = f"{lectionary.display_title} ({_id}, {event})"
embed.description = lectionary.event
embed.url = lectionary.public_url
embed.set_thumbnail(url=lectionary.icon.url)
for translation in lectionary.translations:
reading_excerpt = textwrap.shorten(translation.body, width=600, placeholder="...")
embed.add_field(name=translation.short_title,
value=reading_excerpt, inline=False)
name = "For more about this lectionary/reading"
embed.add_field(name=f"{name}:", value=lectionary.public_url, inline=False)
embed.set_footer(icon_url=central.icon,
text=f"{central.version} | Greek Orthodox Archdiocese of America")
return embed

View File

@ -2,7 +2,7 @@
"orthobot": "OrthoBot v<orthobotversion> by Elliott Pardee (vypr)",
"code": "Code: <repositoryLink>",
"commandlist": "* `+search query` - search for saints/icons\n* `+random` - get a random saint/icon\n* `+yesterday` - get the readings and saints for yesterday\n* `+today` - get the readings and saints for today\n* `+tomorrow` - get the readings and saints for tomorrow\n* `+users` - list all users throughout all servers (not counting duplicates or bots)\n* `+servers` - show how many servers OrthoBot is in\n* `+invite` - get the invite link for OrthoBot",
"commandlist": "* `+search query` - search for saints/icons\n* `+random` - get a random daily reading\n* `+yesterday` - get the readings and saints for yesterday\n* `+today` - get the readings and saints for today\n* `+tomorrow` - get the readings and saints for tomorrow\n* `+users` - list all users throughout all servers (not counting duplicates or bots)\n* `+servers` - show how many servers OrthoBot is in\n* `+invite` - get the invite link for OrthoBot",
"commandlist2": "* `+councils` - the ecumenical councils (contains further commands)\n* `+documents` - important documents in Church history (contains further commands)",
"guildcommandlist": "* `+setdailytime TIME` - set the daily readings time to TIME (TIME must be 24h format and in UTC)\n* `+cleardailytime` - clear the daily readings time\n* `+dailytime` - see the daily readings time and channel",
@ -18,8 +18,8 @@
"setdailytimesuccess": "Set daily time successfully.",
"setdailytimenoperm": "You must have the 'Manage Server' permission to modify a guild's daily time!",
"setdailytimefail": "Failed to set daily time, the time must be 24-hour format like `01:00` or `13:00`.",
"dailytimeused": "The daily time for this guild is `<time>` and will be published in `#<channel>`.\n\nHave someone with the 'Manage Server' permission use `+<setdailytime>` to set a different daily time or `+<cleardailytime>` to clear the daily time.",
"nodailytimeused": "I couldn't find this guild in my database, has someone with the 'Manage Server' permission used `+<setdailytime>` yet?",
"dailytimeused": "The daily time for this guild is `<time>` and will be published in `#<channel>`.\n\nHave someone with the 'Manage Server' permission use `+setdailytime` to set a different daily time or `+cleardailytime` to clear the daily time.",
"nodailytimeused": "I couldn't find this guild in my database, has someone with the 'Manage Server' permission used `+setdailytime` yet?",
"cleardailytimesuccess": "Cleared daily time successfully.",
"cleardailytimenoperm": "You must have the 'Manage Server' permission to clear a guild's daily time!",

View File

@ -1 +0,0 @@
__all__ = ["commandbridge"]

View File

@ -21,7 +21,7 @@ import sys
import discord
from handlers.commandlogic import commandbridge as command_bridge
from handlers.command_logic import command_bridge
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(dir_path + "/..")
@ -30,36 +30,21 @@ import central # noqa: E402
command_map = {
"orthobot": 0,
"search": 1,
# "search": 1,
"yesterday": 0,
"today": 0,
"tomorrow": 0,
"saint": 1,
"feast": 1,
"lectionary": 3,
"reading": 3,
"random": 0,
"verseoftheday": 0,
"votd": 0,
"setheadings": 1,
"headings": 0,
"setversenumbers": 1,
"versenumbers": 0,
"languages": 0,
"setlanguage": 1,
"setguildlanguage": 1,
"language": 0,
"guildlanguage": 0,
"setguildbrackets": 1,
"guildbrackets": 0,
"setvotdtime": 1,
"clearvotdtime": 0,
"votdtime": 0,
"setannouncements": 1,
"announcements": 0,
"setdailytime": 1,
"cleardailytime": 0,
"dailytime": 0,
"users": 0,
"servers": 0,
"invite": 0,
"creeds": 0,
"apostles": 0,
"nicene": 0,
"chalcedonian": 0,
"athanasian": 0,
}
@ -97,6 +82,7 @@ class CommandHandler:
orig_cmd = proper_command["orig"]
if not is_owner_command(orig_cmd):
if orig_cmd != "search":
if orig_cmd != "lectionary" and orig_cmd != "reading":
if orig_cmd != "servers" and orig_cmd != "users":
required_arguments = command_map[orig_cmd]
@ -145,7 +131,40 @@ class CommandHandler:
"return": embed
}
return command_bridge.run_command(orig_cmd, [bot], raw_language, sender, guild, channel)
return command_bridge.run_command(orig_cmd, [bot], sender, guild, channel)
else:
if args is None:
args = []
if len(args) != 3 and len(args) != 4:
embed = discord.Embed()
embed.color = 16723502
embed.set_footer(text=central.version, icon_url=central.icon)
embed.add_field(name="Error", value=f"Usage: `~{orig_cmd} type id event` " +
f"or `~{orig_cmd} type id event date`.")
return {
"isError": True,
"return": embed
}
else:
if args[0] == "epistle":
if len(args) != 4:
embed = discord.Embed()
embed.color = 16723502
embed.set_footer(text=central.version, icon_url=central.icon)
embed.add_field(name="Error", value="Epistles must have a date argument. " +
f"Usage: `~{orig_cmd} type id event date`.")
return {
"isError": True,
"return": embed
}
return command_bridge.run_command(orig_cmd, args, sender, guild, channel)
else:
if args is None:
args = []