Move all daily-related commands to ~daily + an argument. Allow for processing of dates.

This commit is contained in:
Elliott Pardee 2018-08-26 08:19:43 -04:00
parent 81f5683010
commit ac99ec580f
6 changed files with 149 additions and 173 deletions

226
.idea/workspace.xml generated
View File

@ -2,7 +2,12 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="b1c872ee-962e-4a94-aa78-0eb1f70757c1" name="Default Changelist" comment=""> <list default="true" id="b1c872ee-962e-4a94-aa78-0eb1f70757c1" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/command_logic/command_bridge.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/handlers/command_logic/command_bridge.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/handlers/command_logic/embed_builders.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/handlers/command_logic/embed_builders.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/handlers/command_logic/strings.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/handlers/command_logic/strings.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/handlers/commands.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/handlers/commands.py" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -14,15 +19,16 @@
<session id="-578934931"> <session id="-578934931">
<usages-collector id="statistics.lifecycle.project"> <usages-collector id="statistics.lifecycle.project">
<counts> <counts>
<entry key="project.closed" value="6" /> <entry key="project.closed" value="7" />
<entry key="project.open.time.18" value="1" /> <entry key="project.open.time.18" value="1" />
<entry key="project.open.time.2" value="2" /> <entry key="project.open.time.2" value="2" />
<entry key="project.open.time.24" value="1" /> <entry key="project.open.time.24" value="1" />
<entry key="project.open.time.25" value="1" /> <entry key="project.open.time.25" value="1" />
<entry key="project.open.time.29" value="1" /> <entry key="project.open.time.29" value="1" />
<entry key="project.open.time.3" value="1" />
<entry key="project.open.time.39" value="1" /> <entry key="project.open.time.39" value="1" />
<entry key="project.open.time.6" value="1" /> <entry key="project.open.time.6" value="1" />
<entry key="project.opened" value="8" /> <entry key="project.opened" value="9" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.file.extensions.edit"> <usages-collector id="statistics.file.extensions.edit">
@ -30,22 +36,22 @@
<entry key="Python Console" value="378" /> <entry key="Python Console" value="378" />
<entry key="dummy" value="14" /> <entry key="dummy" value="14" />
<entry key="ini" value="84" /> <entry key="ini" value="84" />
<entry key="json" value="670" /> <entry key="json" value="761" />
<entry key="md" value="1237" /> <entry key="md" value="1237" />
<entry key="py" value="9977" /> <entry key="py" value="10556" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.file.types.edit"> <usages-collector id="statistics.file.types.edit">
<counts> <counts>
<entry key="JSON" value="670" /> <entry key="JSON" value="761" />
<entry key="Markdown" value="1237" /> <entry key="Markdown" value="1237" />
<entry key="PLAIN_TEXT" value="98" /> <entry key="PLAIN_TEXT" value="98" />
<entry key="Python" value="10355" /> <entry key="Python" value="10934" />
</counts> </counts>
</usages-collector> </usages-collector>
<usages-collector id="statistics.file.extensions.open"> <usages-collector id="statistics.file.extensions.open">
<counts> <counts>
<entry key="gitignore" value="1" /> <entry key="gitignore" value="2" />
<entry key="ini" value="7" /> <entry key="ini" value="7" />
<entry key="json" value="2" /> <entry key="json" value="2" />
<entry key="md" value="3" /> <entry key="md" value="3" />
@ -57,7 +63,7 @@
<counts> <counts>
<entry key="JSON" value="2" /> <entry key="JSON" value="2" />
<entry key="Markdown" value="3" /> <entry key="Markdown" value="3" />
<entry key="PLAIN_TEXT" value="9" /> <entry key="PLAIN_TEXT" value="10" />
<entry key="Python" value="19" /> <entry key="Python" value="19" />
</counts> </counts>
</usages-collector> </usages-collector>
@ -69,7 +75,7 @@
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/strings.json"> <entry file="file://$PROJECT_DIR$/src/handlers/command_logic/strings.json">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="92"> <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" /> <caret line="4" column="210" selection-start-line="4" selection-start-column="210" selection-end-line="4" selection-end-column="210" />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -77,22 +83,22 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/command_bridge.py"> <entry file="file://$PROJECT_DIR$/src/handlers/command_logic/command_bridge.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-377"> <state relative-caret-position="138">
<caret line="48" column="30" lean-forward="true" selection-start-line="48" selection-start-column="30" selection-end-line="48" selection-end-column="30" /> <caret line="136" column="9" selection-start-line="136" selection-start-column="9" selection-end-line="136" selection-end-column="9" />
<folding> <folding>
<element signature="e#748#759#0" expanded="true" /> <element signature="e#748#759#0" expanded="true" />
<marker date="1535106011980" expanded="true" signature="1084:1085" ph="..." /> <marker date="1535285741389" expanded="true" signature="1084:1085" ph="..." />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/README.md"> <entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]"> <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="FIRST"> <state split_layout="FIRST">
<first_editor relative-caret-position="68"> <first_editor relative-caret-position="345">
<caret line="10" column="38" selection-start-line="10" selection-start-column="38" selection-end-line="10" selection-end-column="38" /> <caret line="15" column="22" selection-start-line="15" selection-start-column="22" selection-end-line="15" selection-end-column="22" />
</first_editor> </first_editor>
<second_editor /> <second_editor />
</state> </state>
@ -100,19 +106,28 @@
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/settings/misc.py"> <entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-216"> <state relative-caret-position="2599">
<caret line="22" column="24" lean-forward="true" selection-start-line="22" selection-start-column="24" selection-end-line="22" selection-end-column="24" /> <caret line="113" column="14" selection-start-line="113" selection-start-column="14" selection-end-line="113" selection-end-column="14" />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/settings/misc.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="405">
<caret line="22" column="24" 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="true">
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/embed_builders.py"> <entry file="file://$PROJECT_DIR$/src/handlers/command_logic/embed_builders.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1481"> <state relative-caret-position="66">
<caret line="49" column="22" lean-forward="true" selection-start-line="49" selection-start-column="22" selection-end-line="49" selection-end-column="22" /> <caret line="52" column="57" selection-start-line="52" selection-start-column="57" selection-end-line="52" selection-end-column="57" />
<folding> <folding>
<element signature="e#0#36#0" expanded="true" /> <element signature="e#0#36#0" expanded="true" />
</folding> </folding>
@ -132,8 +147,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/config.ini"> <entry file="file://$PROJECT_DIR$/src/config.ini">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="161"> <state relative-caret-position="23">
<caret line="7" column="6" lean-forward="true" selection-start-line="7" selection-start-column="6" selection-end-line="7" selection-end-column="6" /> <caret line="1" column="8" selection-start-line="1" selection-start-column="8" selection-end-line="1" selection-end-column="67" />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -141,8 +156,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/handlers/commands.py"> <entry file="file://$PROJECT_DIR$/src/handlers/commands.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60"> <state relative-caret-position="207">
<caret line="32" column="6" selection-start-line="32" selection-start-column="6" selection-end-line="32" selection-end-column="6" /> <caret line="98" column="30" selection-start-line="98" selection-start-column="30" selection-end-line="98" selection-end-column="30" />
<folding> <folding>
<element signature="e#748#757#0" expanded="true" /> <element signature="e#748#757#0" expanded="true" />
</folding> </folding>
@ -153,8 +168,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/bot.py"> <entry file="file://$PROJECT_DIR$/src/bot.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="106"> <state relative-caret-position="-4632">
<caret line="77" column="97" selection-start-line="77" selection-start-column="97" selection-end-line="77" selection-end-column="97" /> <caret line="32" column="37" lean-forward="true" selection-start-line="32" selection-start-column="37" selection-end-line="32" selection-end-column="37" />
<folding> <folding>
<element signature="e#748#762#0" expanded="true" /> <element signature="e#748#762#0" expanded="true" />
</folding> </folding>
@ -162,18 +177,6 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<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="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" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf> </leaf>
</component> </component>
<component name="FileTemplateManagerImpl"> <component name="FileTemplateManagerImpl">
@ -192,6 +195,7 @@
<find>votd</find> <find>votd</find>
<find>random</find> <find>random</find>
<find>&lt;+</find> <find>&lt;+</find>
<find>configVersion</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
<replace /> <replace />
@ -215,12 +219,12 @@
<option value="$PROJECT_DIR$/src/handlers/commandlogic/embed_builders.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.example.ini" />
<option value="$PROJECT_DIR$/src/config.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" />
<option value="$PROJECT_DIR$/README.md" /> <option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/src/bot.py" />
<option value="$PROJECT_DIR$/src/handlers/commands.py" />
<option value="$PROJECT_DIR$/src/handlers/command_logic/strings.json" />
<option value="$PROJECT_DIR$/src/handlers/command_logic/command_bridge.py" />
<option value="$PROJECT_DIR$/src/handlers/command_logic/embed_builders.py" />
</list> </list>
</option> </option>
</component> </component>
@ -238,7 +242,6 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
@ -281,6 +284,7 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -406,13 +410,13 @@
<window_info id="Favorites" order="2" 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="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" /> <window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" weight="0.32890365" /> <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="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" /> <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="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" weight="0.3294702" /> <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="Version Control" order="7" />
<window_info active="true" anchor="bottom" id="Terminal" order="8" visible="true" weight="0.3305648" /> <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="Event Log" order="9" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="10" weight="0.32890365" /> <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="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
@ -447,13 +451,6 @@
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/databases/versiondb" /> <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="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$/venv/lib/python3.6/site-packages/goarch_api/daily.py"> <entry file="file://$PROJECT_DIR$/venv/lib/python3.6/site-packages/goarch_api/daily.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="138"> <state relative-caret-position="138">
@ -505,58 +502,20 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/bot.py"> <entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state relative-caret-position="106"> <state split_layout="FIRST">
<caret line="77" column="97" selection-start-line="77" selection-start-column="97" selection-end-line="77" selection-end-column="97" /> <first_editor relative-caret-position="345">
<folding> <caret line="15" column="22" selection-start-line="15" selection-start-column="22" selection-end-line="15" selection-end-column="22" />
<element signature="e#748#762#0" expanded="true" /> </first_editor>
</folding> <second_editor />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/handlers/command_logic/strings.json"> <entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="92"> <state relative-caret-position="2599">
<caret line="4" column="105" selection-start-line="4" selection-start-column="105" selection-end-line="4" selection-end-column="105" /> <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$/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="-377">
<caret line="48" column="30" lean-forward="true" selection-start-line="48" selection-start-column="30" selection-end-line="48" selection-end-column="30" />
<folding>
<element signature="e#748#759#0" expanded="true" />
<marker date="1535106011980" expanded="true" signature="1084:1085" ph="..." />
</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> </state>
</provider> </provider>
</entry> </entry>
@ -569,18 +528,63 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/config.ini"> <entry file="file://$PROJECT_DIR$/src/config.ini">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="161"> <state relative-caret-position="23">
<caret line="7" column="6" lean-forward="true" selection-start-line="7" selection-start-column="6" selection-end-line="7" selection-end-column="6" /> <caret line="1" column="8" selection-start-line="1" selection-start-column="8" selection-end-line="1" selection-end-column="67" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/README.md"> <entry file="file://$PROJECT_DIR$/src/handlers/command_logic/settings/misc.py">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]"> <provider selected="true" editor-type-id="text-editor">
<state split_layout="FIRST"> <state relative-caret-position="405">
<first_editor relative-caret-position="68"> <caret line="22" column="24" selection-start-line="22" selection-start-column="24" selection-end-line="22" selection-end-column="24" />
<caret line="10" column="38" selection-start-line="10" selection-start-column="38" selection-end-line="10" selection-end-column="38" /> </state>
</first_editor> </provider>
<second_editor /> </entry>
<entry file="file://$PROJECT_DIR$/src/bot.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-4632">
<caret line="32" column="37" lean-forward="true" selection-start-line="32" selection-start-column="37" selection-end-line="32" selection-end-column="37" />
<folding>
<element signature="e#748#762#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/handlers/commands.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="207">
<caret line="98" column="30" selection-start-line="98" selection-start-column="30" selection-end-line="98" selection-end-column="30" />
<folding>
<element signature="e#748#757#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="210" selection-start-line="4" selection-start-column="210" selection-end-line="4" selection-end-column="210" />
</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="138">
<caret line="136" column="9" selection-start-line="136" selection-start-column="9" selection-end-line="136" selection-end-column="9" />
<folding>
<element signature="e#748#759#0" expanded="true" />
<marker date="1535285741389" expanded="true" signature="1084:1085" ph="..." />
</folding>
</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="66">
<caret line="52" column="57" selection-start-line="52" selection-start-column="57" selection-end-line="52" selection-end-column="57" />
<folding>
<element signature="e#0#36#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>

View File

@ -32,9 +32,6 @@ dir_path = os.path.dirname(os.path.realpath(__file__))
config = configparser.ConfigParser() config = configparser.ConfigParser()
config.read(dir_path + "/config.ini") config.read(dir_path + "/config.ini")
configVersion = configparser.ConfigParser()
configVersion.read(dir_path + "/config.example.ini")
class OrthoBot(discord.AutoShardedClient): class OrthoBot(discord.AutoShardedClient):
def __init__(self, *args, loop=None, **kwargs): def __init__(self, *args, loop=None, **kwargs):
@ -83,6 +80,8 @@ class OrthoBot(discord.AutoShardedClient):
await asyncio.sleep(60) await asyncio.sleep(60)
async def on_message(self, raw): async def on_message(self, raw):
await self.wait_until_ready()
sender = raw.author sender = raw.author
identifier = sender.name + "#" + sender.discriminator identifier = sender.name + "#" + sender.discriminator
channel = raw.channel channel = raw.channel
@ -250,11 +249,8 @@ class OrthoBot(discord.AutoShardedClient):
central.log_message(res["level"], shard, identifier, source, config["OrthoBot"]["commandPrefix"] central.log_message(res["level"], shard, identifier, source, config["OrthoBot"]["commandPrefix"]
+ command + " " + clean_args) + command + " " + clean_args)
else: else:
# noinspection PyBroadException if "return" in res:
try:
await channel.send(embed=res["return"]) await channel.send(embed=res["return"])
except Exception:
pass
if int(config["OrthoBot"]["shards"]) > 1: if int(config["OrthoBot"]["shards"]) > 1:

View File

@ -128,29 +128,8 @@ def run_command(command, args, user, guild, channel):
"level": "info", "level": "info",
"message": pages[0] "message": pages[0]
} }
elif command == "yesterday": elif command == "daily":
return_embed = embed_builders.create_daily_embed("yesterday") return_embed = embed_builders.create_daily_embed(args[0])
return {
"level": "info",
"message": return_embed
}
elif command == "today":
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 { return {
"level": "info", "level": "info",

View File

@ -2,6 +2,7 @@ from datetime import date, timedelta
import random import random
import textwrap import textwrap
import os import os
import re
import sys import sys
from goarch_api.daily import Daily from goarch_api.daily import Daily
@ -40,13 +41,18 @@ def create_daily_embed(day="today"):
saints_to_display = 3 saints_to_display = 3
try:
if day == "today": if day == "today":
daily = Daily() daily = Daily()
else: elif day in dates:
date_formatted = f"{dates[day].month}/{dates[day].day}/{dates[day].year}" date_formatted = f"{dates[day].month}/{dates[day].day}/{dates[day].year}"
daily = Daily(date_formatted) daily = Daily(date_formatted)
except Exception: else:
date_format = re.compile("[0-9]*\/[0-9]*\/[0-9]*")
if date_format.match(day):
day = day[1:] if day.startswith("0") else day
daily = Daily(day)
else:
day = "random" day = "random"
date_formatted = f"{dates[day].month}/{dates[day].day}/{dates[day].year}" date_formatted = f"{dates[day].month}/{dates[day].day}/{dates[day].year}"
daily = Daily(date_formatted) daily = Daily(date_formatted)
@ -66,12 +72,7 @@ def create_daily_embed(day="today"):
if index == 0: if index == 0:
if daily.lectionary_title == saint.title: if daily.lectionary_title == saint.title:
embed.description = "" embed.description = daily.fasting if daily.fasting else "No Fasting"
if daily.fasting:
embed.description = daily.fasting
else:
embed.description = "No Fasting"
if daily.tone: if daily.tone:
embed.description += f" / {daily.tone}" embed.description += f" / {daily.tone}"
@ -107,8 +108,7 @@ def create_daily_embed(day="today"):
embed.add_field(name=title, value=reading.translation.short_title, inline=True) embed.add_field(name=title, value=reading.translation.short_title, inline=True)
embed.set_footer(icon_url=central.icon, embed.set_footer(icon_url=central.icon, text=f"{central.version} | Greek Orthodox Archdiocese of America")
text=f"{central.version} | Greek Orthodox Archdiocese of America")
return embed return embed
@ -135,12 +135,14 @@ def create_saint_embed(_id):
for reading in saint.lectionary: for reading in saint.lectionary:
# this is not a Reading object, it is a LectionaryReading object # this is not a Reading object, it is a LectionaryReading object
if reading.type == "E": type_strings = {
_type = "Epistle Reading" "E": "Epistle Reading",
elif reading.type == "G": "G": "Gospel Reading",
_type = "Gospel Reading" "MG": "Matins Gospel Reading"
elif reading.type == "MG": }
_type = "Matins Gospel Reading"
if reading.type in type_strings:
_type = type_strings[reading.type]
else: else:
_type = reading.type _type = reading.type
@ -155,8 +157,7 @@ def create_saint_embed(_id):
name = "For more about this saint/feast" name = "For more about this saint/feast"
embed.add_field(name=f"{name}:", value=saint.public_url, inline=False) embed.add_field(name=f"{name}:", value=saint.public_url, inline=False)
embed.set_footer(icon_url=central.icon, embed.set_footer(icon_url=central.icon, text=f"{central.version} | Greek Orthodox Archdiocese of America")
text=f"{central.version} | Greek Orthodox Archdiocese of America")
return embed return embed
@ -176,13 +177,11 @@ def create_lectionary_embed(_type, _id, event, _date=None):
for translation in lectionary.translations: for translation in lectionary.translations:
reading_excerpt = textwrap.shorten(translation.body, width=600, placeholder="...") reading_excerpt = textwrap.shorten(translation.body, width=600, placeholder="...")
embed.add_field(name=translation.short_title, embed.add_field(name=translation.short_title, value=reading_excerpt, inline=False)
value=reading_excerpt, inline=False)
name = "For more about this lectionary/reading" name = "For more about this lectionary/reading"
embed.add_field(name=f"{name}:", value=lectionary.public_url, inline=False) embed.add_field(name=f"{name}:", value=lectionary.public_url, inline=False)
embed.set_footer(icon_url=central.icon, embed.set_footer(icon_url=central.icon, text=f"{central.version} | Greek Orthodox Archdiocese of America")
text=f"{central.version} | Greek Orthodox Archdiocese of America")
return embed return embed

View File

@ -2,7 +2,7 @@
"orthobot": "OrthoBot v<orthobotversion> by Elliott Pardee (vypr)", "orthobot": "OrthoBot v<orthobotversion> by Elliott Pardee (vypr)",
"code": "Code: <repositoryLink>", "code": "Code: <repositoryLink>",
"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", "commandlist": "* `+search query` - search for saints/icons\n* `+random` - get a random daily reading\n* `+daily yesterday/today/tomorrow/random/date` - get the readings and saints for the argument you give\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)", "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", "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",

View File

@ -31,9 +31,7 @@ import central # noqa: E402
command_map = { command_map = {
"orthobot": 0, "orthobot": 0,
# "search": 1, # "search": 1,
"yesterday": 0, "daily": 1,
"today": 0,
"tomorrow": 0,
"saint": 1, "saint": 1,
"feast": 1, "feast": 1,
"lectionary": 3, "lectionary": 3,