Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cogs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@
import psutil
import math
import openai
import framework.isobot.embedengine
import framework.isobot.currency
from framework.isobot import currency, embedengine
from discord import option, ApplicationContext
from discord.ext import commands
from cogs.levelling import get_level, get_xp
from cogs.afk import get_presence

# Variables
color = discord.Color.random()
currency = framework.isobot.currency.CurrencyAPI("database/currency.json", "logs/currency.log")
currency = currency.CurrencyAPI("database/currency.json", "logs/currency.log")
openai.api_key = os.getenv("chatgpt_API_KEY")
chatgpt_conversation = dict()

Expand Down Expand Up @@ -54,7 +53,7 @@ async def repo(self, ctx: ApplicationContext):
@option(name="footer_icon_url", description="The icon you want to show in the embed's footer (URL ONLY)", type=str, default=None)
async def embedbuilder(self, ctx: ApplicationContext, title: str, description: str, image_url: str = None, thumbnail_url: str = None, color: int = None, footer_text: str = None, footer_icon_url: str = None):
await ctx.respond("Embed Built!", ephemeral=True)
await ctx.channel.send(embed=framework.isobot.embedengine.embed(title, description, image=image_url, thumbnail=thumbnail_url, color=color, footer_text=footer_text, footer_img=footer_icon_url))
await ctx.channel.send(embed=embedengine.embed(title, description, image=image_url, thumbnail=thumbnail_url, color=color, footer_text=footer_text, footer_img=footer_icon_url))

@commands.slash_command(
name='whoami',
Expand Down
2 changes: 2 additions & 0 deletions framework/isobot/colors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Library used for stdout colors."""

class Colors:
"""Contains general stdout colors."""

cyan = '\033[96m'
red = '\033[91m'
green = '\033[92m'
Expand Down
2 changes: 2 additions & 0 deletions framework/isobot/currency.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""The isobot module for managing the currency db"""

import json
import discord
import datetime
Expand Down
6 changes: 3 additions & 3 deletions framework/isobot/embedengine.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""The library used for designing and outputting Discord embeds."""

import discord
from discord import Color

def embed(title: str, desc: str, *, image: str = None, thumbnail: str = None, color:int=None, footer_text: str = None, footer_img: str = None):
"""Designs a Discord embed.
Expand All @@ -10,8 +10,8 @@ def embed(title: str, desc: str, *, image: str = None, thumbnail: str = None, co
- If the color is set as "rand", then it will return the embed with a random color.
- If a color is not set, it will appear as Discord's blurple embed color.
"""
if color == -1: color = Color.random()
elif color == None: color = Color.blurple()
if color == -1: color = discord.Color.random()
elif color == None: color = discord.Color.blurple()
local_embed = discord.Embed(
title=title,
description=desc,
Expand Down
25 changes: 10 additions & 15 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@
import discord
import asyncio
import api.auth
import utils.logger
import utils.ping
from framework import *
from utils import logger, ping
from math import floor
from random import randint
import framework.isobot.currency
import framework.isobot.colors
import framework.isobank.authorize
import framework.isobank.manager
import framework.isobot.embedengine
from framework.isobot import currency, colors, embedengine
from framework.isobank import authorize, manager
from discord import ApplicationContext, option
from discord.ext import commands
from discord.ext.commands import *
Expand Down Expand Up @@ -51,18 +46,18 @@ def save():
os.mkdir('logs')
try:
open('logs/info-log.txt', 'x', encoding="utf-8")
utils.logger.info("Created info log", nolog=True)
logger.info("Created info log", nolog=True)
time.sleep(0.5)
open('logs/error-log.txt', 'x', encoding="utf-8")
utils.logger.info("Created error log", nolog=True)
logger.info("Created error log", nolog=True)
time.sleep(0.5)
open('logs/currency.log', 'x', encoding="utf-8")
utils.logger.info("Created currency log", nolog=True)
except Exception as e: utils.logger.error(f"Failed to make log file: {e}", nolog=True)
logger.info("Created currency log", nolog=True)
except Exception as e: logger.error(f"Failed to make log file: {e}", nolog=True)

#Framework Module Loader
colors = framework.isobot.colors.Colors()
currency = framework.isobot.currency.CurrencyAPI("database/currency.json", "logs/currency.log")
colors = colors.Colors()
currency = currency.CurrencyAPI("database/currency.json", "logs/currency.log")

# Theme Loader
themes = False # True: enables themes; False: disables themes;
Expand Down Expand Up @@ -92,7 +87,7 @@ async def on_ready():
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.playing, name="GitHub"), status=discord.Status.idle)
print(f'[main/Log] {colors.green}Status set to IDLE. Rich presence set.{colors.end}')
print("[main/Flask] Starting pinger service...")
utils.ping.host()
ping.host()
time.sleep(5)

@client.event
Expand Down