diff --git a/Gwendolyn.py b/Gwendolyn.py index 4bd4d90..dfb43f0 100644 --- a/Gwendolyn.py +++ b/Gwendolyn.py @@ -10,7 +10,7 @@ import random #import math import os -from funcs import * +from funcs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, emojiToNumber, fiarReactionTest, deleteGame, stopServer, checkBalance, giveMoney, addMoney, triviaCountPoints, triviaStart, triviaAnswer, blackjackShuffle, blackjackStart, blackjackPlayerDrawHand, blackjackContinue, blackjackFinish, blackjackHit, blackjackStand, blackjackDouble, blackjackSplit, parseFourInARow, fourInARowAI, spellFunc, monsterFunc, nameGen, tavernGen, movieFunc, roll_dice, parseChar, parseRoll, critRoll, parseDestiny commandPrefix = "!" @@ -303,22 +303,22 @@ async def parseCommands(message,content): # Sends information about a random movie with the movieFunc function from # funcs/other/movie.py elif content.startswith("movie"): - #try: - async with message.channel.typing(): - title, plot, cover, cast = movieFunc() - if title == "error": - await message.channel.send("An error occurred. Try again (error code "+plot+")") - else: - try: - embed = discord.Embed(title=title, description=plot, color=0x24ec19) - embed.set_thumbnail(url=cover) - embed.add_field(name="Cast", value=cast,inline = True) - await message.channel.send(embed = embed) - except: - logThis("Error embedding (error code 805)") - #except: - # logThis("Something fucked up (error code 800)",str(message.channel)) - # await message.channel.send("Something fucked up (error code 800)") + try: + async with message.channel.typing(): + title, plot, cover, cast = movieFunc() + if title == "error": + await message.channel.send("An error occurred. Try again (error code "+plot+")") + else: + try: + embed = discord.Embed(title=title, description=plot, color=0x24ec19) + embed.set_thumbnail(url=cover) + embed.add_field(name="Cast", value=cast,inline = True) + await message.channel.send(embed = embed) + except: + logThis("Error embedding (error code 805)") + except: + logThis("Something fucked up (error code 800)",str(message.channel)) + await message.channel.send("Something fucked up (error code 800)") # Generates a random name with the nameGen function from funcs/other/generators.py elif content.startswith("name"): diff --git a/funcs/__init__.py b/funcs/__init__.py index d8a53c7..a4ce122 100644 --- a/funcs/__init__.py +++ b/funcs/__init__.py @@ -1,13 +1,16 @@ -__all__ = ["helloFunc", "cap", "imageFunc", "logThis", "findWikiPage", "makeFiles", "emojiToNumber", "fiarReactionTest", "deleteGame", "stopServer", "checkBalance", "giveMoney", "addMoney","triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "parseFourInARow", "fourInARowAI", "spellFunc", "monsterFunc", "nameGen", "tavernGen", "movieFunc", "roll_dice", "parseChar", "parseRoll", "critRoll", "parseDestiny"] +__doc__ = "A collection of all Gwendolyn functions" + +__all__ = ["helloFunc", "cap", "imageFunc", "logThis", "findWikiPage", "makeFiles", "emojiToNumber", "fiarReactionTest", "deleteGame", "stopServer", "checkBalance", "giveMoney", "addMoney", "triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "parseFourInARow", "fourInARowAI", "spellFunc", "monsterFunc", "nameGen", "tavernGen", "movieFunc", "roll_dice", "parseChar", "parseRoll", "critRoll", "parseDestiny"] from .miscFuncs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, replaceMultiple, emojiToNumber, fiarReactionTest, deleteGame, stopServer -from .swfuncs import * +from .games import checkBalance, giveMoney, addMoney, triviaCountPoints, triviaStart, triviaAnswer, blackjackShuffle, blackjackStart, blackjackPlayerDrawHand, blackjackContinue, blackjackFinish, blackjackHit, blackjackStand, blackjackDouble, blackjackSplit, parseFourInARow, fourInARowAI -from .lookup import * +from .lookup import spellFunc, monsterFunc -from .other import * +from .other import nameGen, tavernGen, movieFunc -from .games import * +from .roll import roll_dice + +from .swfuncs import parseChar, parseRoll, parseDestiny, critRoll -from .roll import * diff --git a/funcs/games/__init__.py b/funcs/games/__init__.py index ab5e931..0f55700 100644 --- a/funcs/games/__init__.py +++ b/funcs/games/__init__.py @@ -1,3 +1,5 @@ +__doc__ = "Functions for games Gwendolyn can play" + __all__ = ["checkBalance", "giveMoney", "addMoney","triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "parseFourInARow", "fourInARowAI"] from .money import checkBalance, giveMoney, addMoney diff --git a/funcs/lookup/__init__.py b/funcs/lookup/__init__.py index a4f6b5a..c114fe9 100644 --- a/funcs/lookup/__init__.py +++ b/funcs/lookup/__init__.py @@ -1,3 +1,5 @@ +__doc__ = "Gwendolyn functions for looking things up" + __all__ = ["spellFunc", "monsterFunc"] from .lookupFuncs import spellFunc, monsterFunc \ No newline at end of file diff --git a/funcs/other/__init__.py b/funcs/other/__init__.py index 9d2c2a8..00874ea 100644 --- a/funcs/other/__init__.py +++ b/funcs/other/__init__.py @@ -1,3 +1,5 @@ +__doc__ = "Misc. functions for Gwendolyn" + __all__ = ["nameGen", "tavernGen", "movieFunc"] from .generators import nameGen, tavernGen diff --git a/funcs/roll/__init__.py b/funcs/roll/__init__.py index 835ae34..3215601 100644 --- a/funcs/roll/__init__.py +++ b/funcs/roll/__init__.py @@ -1,3 +1,5 @@ +__doc__ = "I stole this" + __all__ = ["roll_dice"] from .dice import roll_dice \ No newline at end of file diff --git a/funcs/swfuncs/__init__.py b/funcs/swfuncs/__init__.py index bfbc7c3..3a6b439 100644 --- a/funcs/swfuncs/__init__.py +++ b/funcs/swfuncs/__init__.py @@ -1,3 +1,5 @@ +__doc__ = "Functions related to the Star Wars TTRPG" + __all__ = ["parseChar", "parseRoll", "critRoll", "parseDestiny"] from .swchar import parseChar