From 510759a005cf641dfc7fce450f990171b4c0d351 Mon Sep 17 00:00:00 2001 From: "DavidCrompton1192@gmail.com" Date: Wed, 15 Mar 2023 23:14:57 -0400 Subject: [PATCH] Cleanup module --- handyhelper/__init__.py | 30 ++++++++++++++++++++++++++++-- handyhelper/__main__.py | 25 ------------------------- 2 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 handyhelper/__main__.py diff --git a/handyhelper/__init__.py b/handyhelper/__init__.py index 330565f..91a17bb 100644 --- a/handyhelper/__init__.py +++ b/handyhelper/__init__.py @@ -1,2 +1,28 @@ -# Handle major modules of package -import * from ./__main__ +import nextcord as nc +from nextcord.ext import commands +from typing import Optional +import os + +bot = commands.Bot() + +@bot.event +async def on_ready(): + print(f'We have logged in as {bot.user}') + +@bot.slash_command(name="summarize", description="Summarize all or part of an article", dm_permission=True) +async def summarize( + interaction: nc.Interaction, + article: str, + part: Optional[str] = nc.SlashOption(required=False) +): + print("Will summarize article.") + +def main(): + # TODO: Import bot token from env + bot.run(os.environ["DISCORD_TOKEN"]) + +if __name__ == "__main__": + print("Handy Helper has Begun!") + main() + + diff --git a/handyhelper/__main__.py b/handyhelper/__main__.py deleted file mode 100644 index e1b6a26..0000000 --- a/handyhelper/__main__.py +++ /dev/null @@ -1,25 +0,0 @@ -import nextcord -from nextcord.ext import commands -import os - -bot = commands.Bot() - -@bot.event -async def on_ready(): - print(f'We have logged in as {bot.user}') - -@bot.slash_command(name="summarize", description="Summarize all or part of an article", dm_permission=True) -async def summarize( - interaction: nextcord.Interaction, - article: str, - part: Optional[str] = SlashOption(required=False) -): - print("Will summarize article.") - -def main(): - # TODO: Import bot token from env - bot.run(os.environ["DISCORD_TOKEN"]) - - -if __name__ == "__main__": - print("Handy Helper has Begun!")