Move all daily-related commands to ~daily + an argument. Allow for processing of dates.
This commit is contained in:
parent
81f5683010
commit
ac99ec580f
226
.idea/workspace.xml
generated
226
.idea/workspace.xml
generated
@ -2,7 +2,12 @@
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<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>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
@ -14,15 +19,16 @@
|
||||
<session id="-578934931">
|
||||
<usages-collector id="statistics.lifecycle.project">
|
||||
<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.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.3" value="1" />
|
||||
<entry key="project.open.time.39" value="1" />
|
||||
<entry key="project.open.time.6" value="1" />
|
||||
<entry key="project.opened" value="8" />
|
||||
<entry key="project.opened" value="9" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
<usages-collector id="statistics.file.extensions.edit">
|
||||
@ -30,22 +36,22 @@
|
||||
<entry key="Python Console" value="378" />
|
||||
<entry key="dummy" value="14" />
|
||||
<entry key="ini" value="84" />
|
||||
<entry key="json" value="670" />
|
||||
<entry key="json" value="761" />
|
||||
<entry key="md" value="1237" />
|
||||
<entry key="py" value="9977" />
|
||||
<entry key="py" value="10556" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
<usages-collector id="statistics.file.types.edit">
|
||||
<counts>
|
||||
<entry key="JSON" value="670" />
|
||||
<entry key="JSON" value="761" />
|
||||
<entry key="Markdown" value="1237" />
|
||||
<entry key="PLAIN_TEXT" value="98" />
|
||||
<entry key="Python" value="10355" />
|
||||
<entry key="Python" value="10934" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
<usages-collector id="statistics.file.extensions.open">
|
||||
<counts>
|
||||
<entry key="gitignore" value="1" />
|
||||
<entry key="gitignore" value="2" />
|
||||
<entry key="ini" value="7" />
|
||||
<entry key="json" value="2" />
|
||||
<entry key="md" value="3" />
|
||||
@ -57,7 +63,7 @@
|
||||
<counts>
|
||||
<entry key="JSON" value="2" />
|
||||
<entry key="Markdown" value="3" />
|
||||
<entry key="PLAIN_TEXT" value="9" />
|
||||
<entry key="PLAIN_TEXT" value="10" />
|
||||
<entry key="Python" value="19" />
|
||||
</counts>
|
||||
</usages-collector>
|
||||
@ -69,7 +75,7 @@
|
||||
<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" />
|
||||
<caret line="4" column="210" selection-start-line="4" selection-start-column="210" selection-end-line="4" selection-end-column="210" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@ -77,22 +83,22 @@
|
||||
<file pinned="false" current-in-tab="false">
|
||||
<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" />
|
||||
<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="1535106011980" expanded="true" signature="1084:1085" ph="..." />
|
||||
<marker date="1535285741389" expanded="true" signature="1084:1085" ph="..." />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<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="68">
|
||||
<caret line="10" column="38" selection-start-line="10" selection-start-column="38" selection-end-line="10" selection-end-column="38" />
|
||||
<first_editor relative-caret-position="345">
|
||||
<caret line="15" column="22" selection-start-line="15" selection-start-column="22" selection-end-line="15" selection-end-column="22" />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
</state>
|
||||
@ -100,19 +106,28 @@
|
||||
</entry>
|
||||
</file>
|
||||
<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">
|
||||
<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 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>
|
||||
</file>
|
||||
<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">
|
||||
<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" />
|
||||
<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>
|
||||
@ -132,8 +147,8 @@
|
||||
<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="161">
|
||||
<caret line="7" column="6" lean-forward="true" selection-start-line="7" selection-start-column="6" selection-end-line="7" selection-end-column="6" />
|
||||
<state relative-caret-position="23">
|
||||
<caret line="1" column="8" selection-start-line="1" selection-start-column="8" selection-end-line="1" selection-end-column="67" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
@ -141,8 +156,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="60">
|
||||
<caret line="32" column="6" selection-start-line="32" selection-start-column="6" selection-end-line="32" selection-end-column="6" />
|
||||
<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>
|
||||
@ -153,8 +168,8 @@
|
||||
<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="106">
|
||||
<caret line="77" column="97" selection-start-line="77" selection-start-column="97" selection-end-line="77" selection-end-column="97" />
|
||||
<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>
|
||||
@ -162,18 +177,6 @@
|
||||
</provider>
|
||||
</entry>
|
||||
</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>
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
@ -192,6 +195,7 @@
|
||||
<find>votd</find>
|
||||
<find>random</find>
|
||||
<find><+</find>
|
||||
<find>configVersion</find>
|
||||
</findStrings>
|
||||
<replaceStrings>
|
||||
<replace />
|
||||
@ -215,12 +219,12 @@
|
||||
<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" />
|
||||
<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>
|
||||
</option>
|
||||
</component>
|
||||
@ -238,7 +242,6 @@
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
@ -281,6 +284,7 @@
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
@ -406,13 +410,13 @@
|
||||
<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.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="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 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="Python Console" order="10" weight="0.32890365" />
|
||||
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
|
||||
@ -447,13 +451,6 @@
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<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">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="138">
|
||||
@ -505,58 +502,20 @@
|
||||
</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>
|
||||
<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="345">
|
||||
<caret line="15" column="22" selection-start-line="15" selection-start-column="22" selection-end-line="15" selection-end-column="22" />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
</state>
|
||||
</provider>
|
||||
</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">
|
||||
<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="-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 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>
|
||||
@ -569,18 +528,63 @@
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/config.ini">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="161">
|
||||
<caret line="7" column="6" lean-forward="true" selection-start-line="7" selection-start-column="6" selection-end-line="7" selection-end-column="6" />
|
||||
<state relative-caret-position="23">
|
||||
<caret line="1" column="8" selection-start-line="1" selection-start-column="8" selection-end-line="1" selection-end-column="67" />
|
||||
</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="68">
|
||||
<caret line="10" column="38" selection-start-line="10" selection-start-column="38" selection-end-line="10" selection-end-column="38" />
|
||||
</first_editor>
|
||||
<second_editor />
|
||||
<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>
|
||||
<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>
|
||||
</provider>
|
||||
</entry>
|
||||
|
10
src/bot.py
10
src/bot.py
@ -32,9 +32,6 @@ dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||
config = configparser.ConfigParser()
|
||||
config.read(dir_path + "/config.ini")
|
||||
|
||||
configVersion = configparser.ConfigParser()
|
||||
configVersion.read(dir_path + "/config.example.ini")
|
||||
|
||||
|
||||
class OrthoBot(discord.AutoShardedClient):
|
||||
def __init__(self, *args, loop=None, **kwargs):
|
||||
@ -83,6 +80,8 @@ class OrthoBot(discord.AutoShardedClient):
|
||||
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
|
||||
@ -250,11 +249,8 @@ class OrthoBot(discord.AutoShardedClient):
|
||||
central.log_message(res["level"], shard, identifier, source, config["OrthoBot"]["commandPrefix"]
|
||||
+ command + " " + clean_args)
|
||||
else:
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
if "return" in res:
|
||||
await channel.send(embed=res["return"])
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
if int(config["OrthoBot"]["shards"]) > 1:
|
||||
|
@ -128,29 +128,8 @@ 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 = 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")
|
||||
elif command == "daily":
|
||||
return_embed = embed_builders.create_daily_embed(args[0])
|
||||
|
||||
return {
|
||||
"level": "info",
|
||||
|
@ -2,6 +2,7 @@ from datetime import date, timedelta
|
||||
import random
|
||||
import textwrap
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
from goarch_api.daily import Daily
|
||||
@ -40,16 +41,21 @@ def create_daily_embed(day="today"):
|
||||
|
||||
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"
|
||||
if day == "today":
|
||||
daily = Daily()
|
||||
elif day in dates:
|
||||
date_formatted = f"{dates[day].month}/{dates[day].day}/{dates[day].year}"
|
||||
daily = Daily(date_formatted)
|
||||
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"
|
||||
date_formatted = f"{dates[day].month}/{dates[day].day}/{dates[day].year}"
|
||||
daily = Daily(date_formatted)
|
||||
|
||||
daily.get_data()
|
||||
|
||||
@ -66,12 +72,7 @@ def create_daily_embed(day="today"):
|
||||
|
||||
if index == 0:
|
||||
if daily.lectionary_title == saint.title:
|
||||
embed.description = ""
|
||||
|
||||
if daily.fasting:
|
||||
embed.description = daily.fasting
|
||||
else:
|
||||
embed.description = "No Fasting"
|
||||
embed.description = daily.fasting if daily.fasting else "No Fasting"
|
||||
|
||||
if 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.set_footer(icon_url=central.icon,
|
||||
text=f"{central.version} | Greek Orthodox Archdiocese of America")
|
||||
embed.set_footer(icon_url=central.icon, text=f"{central.version} | Greek Orthodox Archdiocese of America")
|
||||
|
||||
return embed
|
||||
|
||||
@ -135,12 +135,14 @@ def create_saint_embed(_id):
|
||||
|
||||
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"
|
||||
type_strings = {
|
||||
"E": "Epistle Reading",
|
||||
"G": "Gospel Reading",
|
||||
"MG": "Matins Gospel Reading"
|
||||
}
|
||||
|
||||
if reading.type in type_strings:
|
||||
_type = type_strings[reading.type]
|
||||
else:
|
||||
_type = reading.type
|
||||
|
||||
@ -155,8 +157,7 @@ def create_saint_embed(_id):
|
||||
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")
|
||||
embed.set_footer(icon_url=central.icon, text=f"{central.version} | Greek Orthodox Archdiocese of America")
|
||||
|
||||
return embed
|
||||
|
||||
@ -176,13 +177,11 @@ def create_lectionary_embed(_type, _id, event, _date=None):
|
||||
|
||||
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)
|
||||
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")
|
||||
embed.set_footer(icon_url=central.icon, text=f"{central.version} | Greek Orthodox Archdiocese of America")
|
||||
|
||||
return embed
|
||||
|
@ -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 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)",
|
||||
"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",
|
||||
|
||||
|
@ -31,9 +31,7 @@ import central # noqa: E402
|
||||
command_map = {
|
||||
"orthobot": 0,
|
||||
# "search": 1,
|
||||
"yesterday": 0,
|
||||
"today": 0,
|
||||
"tomorrow": 0,
|
||||
"daily": 1,
|
||||
"saint": 1,
|
||||
"feast": 1,
|
||||
"lectionary": 3,
|
||||
|
Loading…
Reference in New Issue
Block a user