Add greeting message

This commit is contained in:
Roberto Anic Banic 2017-10-17 01:37:27 +02:00
parent 54508cb161
commit d8573ddd5d
2 changed files with 28 additions and 24 deletions

37
.idea/workspace.xml generated
View File

@ -4,7 +4,6 @@
<list default="true" id="1e5142f4-a76d-4228-bce7-29ca2474f218" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/bot.py" afterPath="$PROJECT_DIR$/bot.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/bot_config.py" afterPath="$PROJECT_DIR$/bot_config.py" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
@ -30,13 +29,13 @@
</provider>
</entry>
</file>
<file leaf-file-name="bot.py" pinned="false" current-in-tab="false">
<file leaf-file-name="bot.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/bot.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="33" column="8" lean-forward="true" selection-start-line="33" selection-start-column="8" selection-end-line="33" selection-end-column="8" />
<state relative-caret-position="475">
<caret line="178" column="19" lean-forward="false" selection-start-line="178" selection-start-column="19" selection-end-line="178" selection-end-column="19" />
<folding>
<element signature="e#0#11#0" expanded="true" />
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
@ -54,7 +53,7 @@
</provider>
</entry>
</file>
<file leaf-file-name="bot_config.py" pinned="false" current-in-tab="true">
<file leaf-file-name="bot_config.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/bot_config.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476">
@ -111,8 +110,8 @@
<option value="$PROJECT_DIR$/api/config.py" />
<option value="$PROJECT_DIR$/api/response.py" />
<option value="$PROJECT_DIR$/api/request.py" />
<option value="$PROJECT_DIR$/bot.py" />
<option value="$PROJECT_DIR$/bot_config.py" />
<option value="$PROJECT_DIR$/bot.py" />
</list>
</option>
</component>
@ -238,10 +237,10 @@
<layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="true" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32979852" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32979852" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32979852" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.22905621" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.22905621" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
@ -382,13 +381,11 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/bot.py">
<entry file="file://$PROJECT_DIR$/bot_config.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="33" column="8" lean-forward="true" selection-start-line="33" selection-start-column="8" selection-end-line="33" selection-end-column="8" />
<folding>
<element signature="e#0#11#0" expanded="true" />
</folding>
<state relative-caret-position="476">
<caret line="28" column="53" lean-forward="false" selection-start-line="28" selection-start-column="53" selection-end-line="28" selection-end-column="53" />
<folding />
</state>
</provider>
</entry>
@ -402,11 +399,13 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/bot_config.py">
<entry file="file://$PROJECT_DIR$/bot.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476">
<caret line="28" column="53" lean-forward="false" selection-start-line="28" selection-start-column="53" selection-end-line="28" selection-end-column="53" />
<folding />
<state relative-caret-position="475">
<caret line="178" column="19" lean-forward="false" selection-start-line="178" selection-start-column="19" selection-end-line="178" selection-end-column="19" />
<folding>
<element signature="e#0#9#0" expanded="true" />
</folding>
</state>
</provider>
</entry>

15
bot.py
View File

@ -1,4 +1,3 @@
import json
import re
import sys
@ -19,10 +18,6 @@ rpcs3Bot = Bot(command_prefix="!")
pattern = '[A-z]{4}\\d{5}'
@rpcs3Bot.event
async def on_ready():
await rpcs3Bot.send_message(discord.Object(id=channel_id), boot_up_message)
@rpcs3Bot.event
async def on_message(message: Message):
"""
@ -178,5 +173,15 @@ async def get_code(code: str) -> object:
return "```" + result.results[0].to_string() + "```"
return None
async def greet():
"""
Greets on boot!
"""
await rpcs3Bot.wait_until_ready()
await rpcs3Bot.send_message(discord.Object(id=channel_id), boot_up_message)
print(sys.argv[1])
rpcs3Bot.run(sys.argv[1])
greet()