Exemple #1
0
    async def IRS(self):
        with open(filepath + "/json/taxes.json") as f:
            if os.path.getsize(f"{filepath}/json/taxes.json") == 0:
                with open(filepath + "/taxes.json", "w") as fw:
                    ob = {"0": -1}
                    json.dump(ob, fw)
            f = json.load(f)
            f = dict(f)
            droppers = []
            for x in f:
                if x != "0":
                    amount = f[x]["amount"]
                    t = f[x]["time"]
                    if t < time.time() + payday:
                        sqlt = sqlbullshit.sql("data.db", "user")
                        try:
                            sqlt.add(amount, int(x), "loans")
                            droppers.append(x)
                            user = self.bot.get_user(int(x))
                            name = await self.bot.fetch_user(int(x))
                            name = name.display_name
                            if random.randint(0, 100) == 1:
                                msg = f"Hello {name}, we have been trying to reach you about your car's extended warrenty. Please check in with us by running -carwarranty"
                            else:
                                msg = f"""So, {name}, I hear you haven't paid back your loan of {notation(amount)}. Good for you, I'm in a nice mood.
\nI'm going to start just taking your money, kapish? It's that or your kneecaps.
\nDon't make me send Vinny around again. I hope you remember what happened to your kids last time."""
                            await user.send(msg)
                        except sqlbullshit.SQLerror:
                            user = self.bot.get_user(int(451643725475479552))
                            await user.send(
                                f"A user with the id {x} has caused problems by not existing. pls fix"
                            )
            for x in droppers:
                f.pop(x)
            droppers = list()
            with open(filepath + "/taxes.json", "w") as fw:
                json.dump(f, fw)
Exemple #2
0
from PIL import Image, ImageDraw, ImageFont, ImageOps

import botlib
import costlib
import graph
import imageyoink
import secret_data
import settings
import shop
import sqlbullshit
import utils

null = None
filepath = os.path.abspath(os.path.dirname(__file__))
random.seed(os.urandom(32))
sql = sqlbullshit.sql("data.db", "user")

font = ImageFont.truetype(f"{filepath}/static/font.ttf", size=30)
thiccfont = ImageFont.truetype(f"{filepath}/static/thiccfont.ttf", size=45)

payday = 60 * 60 * 48

img = None


def notation(inp):
    """
    Gets the input and returns {inp} social credits 1% of the time, otherwise ${inp}
    If the input is a whole number, return an int version of it
    Examples:
    2.4: $2.4
Exemple #3
0
import os
import random
import sys
import time

import discord
import ujson as json
from discord.ext import commands
from disputils import BotEmbedPaginator

import sqlbullshit
import utils

filepath = os.path.dirname(os.path.realpath(__file__))

sql = sqlbullshit.sql(f"{filepath}/data.db", "user")


class User:
    def __init__(self, uid: int):
        self.uid = uid
        i = sql.get(self.uid, "inv")
        if i == None:
            self.inv = {}
            sql.set(json.dumps(self.inv), self.uid, "inv")
        else:
            self.inv = json.loads(i)

    def inventory(self):
        return self.inv
Exemple #4
0
    psutilinstalled = True
except ModuleNotFoundError:
    psutilinstalled = False
import requests
from discord.ext import commands

import botlib
import bottomlib
import secret_data
import settings
import sqlbullshit
import utils

filepath = os.path.abspath(os.path.dirname(__file__))

sql = sqlbullshit.sql(filepath + "/data.db", "user")
openai.api_key = secret_data.openaikey

starttime = time.time()

reddit = praw.Reddit(
    client_id=secret_data.reddit_client_id,
    client_secret=secret_data.reddit_client_secret,
    user_agent=secret_data.reddit_user_agent,
)


class Misc(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
Exemple #5
0
def updatedb(added: str):
    sql = sqlbullshit.sql(f"{filepath}/data.db", "user")
    collums = sql.collums()
    if added not in collums:
        sql.addcollum(added, "TEXT")