Skip to content

Commit

Permalink
Merge pull request #187 from refekt/3.5
Browse files Browse the repository at this point in the history
Version 3.5 Launch
  • Loading branch information
refekt authored Jun 11, 2022
2 parents 0288e9e + 7fa21a5 commit 0ebd90c
Show file tree
Hide file tree
Showing 40 changed files with 5,268 additions and 6,465 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Bug report
name: Bug reports
about: Create a report to help us improve
title: "[BUG] "
labels: bug
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: refekt
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
A clear and concise description of what the issue is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
Expand Down
18 changes: 7 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
*.json
*.key
*.log
*.pyc
*.xml
.gitignore
.idea
/changelog.md
/discord_surveys/
/husk_messages.txt
__pycache__
discord_surveys/__init__.py
discord_surveys/survey.py
resources/key.key
resources/mammals.json
resources/variables.json
survey_chart.jpg
resources/images
resources/images/make_slowking.png
/changelog.md
/husk_messages.txt
/HB Temp Files/
*.key
*.json
resources/*
survey_chart.jpg
101 changes: 101 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import logging
import sys
from time import perf_counter

import discord # noqa # Beta version thing
from discord.app_commands import CommandInvokeError

from objects.Client import HuskerClient

logging.basicConfig(
format="[%(asctime)s] %(levelname)s :: %(name)s :: %(module)s :: func/%(funcName)s :: Ln/%(lineno)d :: %(message)s",
datefmt="%X %x",
level=logging.INFO,
encoding="utf-8",
stream=sys.stdout,
)
logger = logging.getLogger(__name__)

start = perf_counter()

logger.info("Loading helpers")

# Helper Functions
from helpers.constants import * # noqa
from helpers.embed import * # noqa
from helpers.encryption import * # noqa
from helpers.fryer import * # noqa
from helpers.misc import * # noqa
from helpers.mysql import * # noqa
from helpers.slowking import * # noqa

logger.info("Helpers laoded. Loading objects")

# Objects/classes
from objects.Bets import * # noqa
from objects.Exceptions import * # noqa
from objects.Karma import * # noqa
from objects.Paginator import * # noqa
from objects.Prediction import * # noqa
from objects.Recruits import * # noqa
from objects.Schedule import * # noqa
from objects.Thread import * # noqa
from objects.TweepyStreamListener import * # noqa
from objects.Weather import * # noqa
from objects.Winsipedia import * # noqa

# Start the bot
logger.info("Objects loaded. Starting the bot!")

intents = discord.Intents.all()
intents.typing = False
intents.presences = False

client = HuskerClient(
command_prefix="$",
fetch_offline_members=True,
intents=intents,
owner_id=MEMBER_GEE,
)

tree = client.tree


@tree.error
async def on_app_command_error(
interaction: discord.Interaction, error: CommandInvokeError
) -> None:
logger.exception(str(error.original.args[0]), exc_info=True)
embed = buildEmbed(
title="Command Error Received",
fields=[
dict(
name=f"Error Type: {type(error.original)}",
value=str(error.original.args[0]),
),
dict(
name="Input",
value=f"This error originated from '{error.command.qualified_name}'{' with the following data passed: ' + str(interaction.data['options']) if interaction.data.get('options', False) else ''}",
),
],
)
if interaction.response.is_done():
await interaction.followup.send(content="", embed=embed)
else:
await interaction.response.send_message(content="", embed=embed, ephemeral=True)


end = perf_counter()
logger.info(f"The bot initialized in {end - start:,.2f} seconds")

__all__ = ["client"]


# v2.0 loop
async def main() -> None:
async with client:
await client.start(PROD_TOKEN)


if __name__ == "__main__":
asyncio.run(main())
2 changes: 2 additions & 0 deletions __version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_version = "3.5.0.b"
_author = "u/refekt"
Loading

0 comments on commit 0ebd90c

Please sign in to comment.