Skip to content

Commit

Permalink
Merge pull request #74 from RedCokeDevelopment/dev
Browse files Browse the repository at this point in the history
Upgrade dependencies and fix github workflow
  • Loading branch information
RedTeaDev authored Jan 9, 2023
2 parents 8ed440a + 19c6aeb commit 3b43dfa
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Teapot.py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9.5
- name: Set up Python 3.9.16
uses: actions/setup-python@v2
with:
python-version: 3.9.5
python-version: 3.9.16
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2021 Red Coke Development
Copyright (c) 2020-2023 Red Coke Development

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ A big thanks to all those who contribute to the project ❤
There are two owners for this project. They all contribute massively to the running of this project. Links to their GitHub profiles can be found below:

- [ColaIan](https://github.com/ColaIan) (ColaIan#2974)
- [RedTea](https://github.com/RedTeaDev) (RedTea#0001)
- [RedTea](https://github.com/RedTeaDev) (RedTea#9209)

## 📜 Requirements
These are the requirements for the bot.
Expand Down
6 changes: 3 additions & 3 deletions Teapot.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@
teapot.managers.database.create_table(
"CREATE TABLE IF NOT EXISTS `guild_logs` (`timestamp` TEXT, `guild_id` BIGINT, `channel_id` BIGINT, `message_id` BIGINT, `user_id` BIGINT, `action_type` TINYTEXT, `message` MEDIUMTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci")

print(
f"Connected to database ({teapot.config.db_host()}:{teapot.config.db_port()}) in {round(time.perf_counter() - time_start, 2)}s")

db.execute("INSERT INTO `bot_logs`(timestamp, type, class, message) VALUES(%s, %s, %s, %s)",
(teapot.time(), "BOT_START", __name__, "Initialized bot"))
database.commit()

print(
f"Connected to database ({teapot.config.db_host()}:{teapot.config.db_port()}) in {round(time.perf_counter() - time_start, 2)}s")

intents = discord.Intents.default()
intents.members = True
intents.typing = False
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ urllib3>=1.25.10
websockets>=8.1
yarl>=1.5.1
mysql-connector-python>=8.0.21
alt-profanity-check==1.1.1
alt-profanity-check==1.1.3
protobuf>=3.20.2 # not directly required, pinned by Snyk to avoid a vulnerability

2 changes: 1 addition & 1 deletion teapot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def copyright():
return f"© 2020-{year()} RedCoke Development"


def getPlatform():
def platform():
return platform.system() + " " + platform.release()


Expand Down
8 changes: 4 additions & 4 deletions teapot/cogs/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ async def info(ctx):
"/7fe078b5ea6b43000dfb7964e3e4d21d.png?size=512")
embed.set_thumbnail(url="https://avatars2.githubusercontent.com/u/60006969?s=200&v=4")
embed.add_field(name="Bot User:", value=bot.user)
embed.add_field(name="Guilds:", value=str(len(bot.guilds)))
embed.add_field(name="Members:", value=str(len(set(bot.get_all_members()))))
embed.add_field(name="O.S.:", value=str(teapot.getPlatform()))
embed.add_field(name="Guilds:", value=len(bot.guilds))
embed.add_field(name="Members:", value=len(set(bot.get_all_members())))
embed.add_field(name="O.S.:", value=str(teapot.platform()))
embed.add_field(name="Storage Type:", value=teapot.config.storage_type())
embed.add_field(name="Prefix:", value=", ".join(teapot.config.bot_prefix()))
embed.add_field(name="Github Repo:", value="[Teapot.py](https://github.com/RedCokeDevelopment/Teapot.py)")
Expand Down Expand Up @@ -191,7 +191,7 @@ async def debug(ctx):
embed.add_field(name="Memory",
value=str(round(psutil.virtual_memory()[1] / 1024 / 1024 / 1024)) + "GB / " + str(round(
psutil.virtual_memory()[0] / 1024 / 1024 / 1024)) + "GB", inline=True)
embed.add_field(name="O.S.:", value=str(teapot.getPlatform()), inline=True)
embed.add_field(name="O.S.:", value=str(teapot.platform()), inline=True)
embed.add_field(name="Storage Type:", value=teapot.config.storage_type(), inline=True)
embed.add_field(name="Prefix:", value=", ".join(teapot.config.bot_prefix()), inline=True)
embed.add_field(name="Github Repo:", value="[Teapot.py](https://github.com/RedCokeDevelopment/Teapot.py)",
Expand Down
68 changes: 34 additions & 34 deletions teapot/cogs/neko.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,87 +8,87 @@
from discord.ext import commands

import teapot
import teapot.tools.embed as dmbd
import teapot.tools.embed as embed


def neko_api(x):
req = requests.get(f'https://nekos.life/api/v2/img/{x}')
try:
if req.status_code != 200:
print("Unable to obtain neko image!")
api_json = json.loads(req.text)
url = api_json["url"]
em = embed.newembed().set_image(url=url)
return em
except:
return teapot.messages.error(f"obtaining image ({req.status_code})")


class Neko(commands.Cog):
"""Neko!!! :3"""

def __init__(self, bot):
""" Initialize neko class"""

"""Initialize neko class"""
self.bot = bot

def neko_api(self, ctx, x):
try:
req = requests.get(f'https://nekos.life/api/v2/img/{x}')
if req.status_code != 200:
print("Could not get a neko")
apijson = json.loads(req.text)
url = apijson["url"]
em = dmbd.newembed().set_image(url=url)
return em
except:
return teapot.messages.error(f"obtaining image ({req.status_code})")

@commands.command()
async def neko(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "neko"))
await ctx.send(embed=neko_api("neko"))

@commands.command()
async def waifu(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "waifu"))
await ctx.send(embed=neko_api("waifu"))

@commands.command()
async def avatar(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "avatar"))
await ctx.send(embed=neko_api("avatar"))

@commands.command()
async def wallpaper(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "wallpaper"))
await ctx.send(embed=neko_api("wallpaper"))

@commands.command()
async def tickle(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "tickle"))
await ctx.send(embed=neko_api("tickle"))

@commands.command()
async def poke(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "poke"))
await ctx.send(embed=neko_api("poke"))

@commands.command()
async def kiss(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "kiss"))
await ctx.send(embed=neko_api("kiss"))

@commands.command(aliases=['8ball'])
async def eightball(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "8ball"))
await ctx.send(embed=neko_api("8ball"))

@commands.command()
async def lizard(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "lizard"))
await ctx.send(embed=neko_api("lizard"))

@commands.command()
async def slap(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "slap"))
await ctx.send(embed=neko_api("slap"))

@commands.command()
async def cuddle(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "cuddle"))
await ctx.send(embed=neko_api("cuddle"))

@commands.command()
async def goose(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "goose"))
await ctx.send(embed=neko_api("goose"))

@commands.command()
async def fox_girl(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "fox_girl"))
await ctx.send(embed=neko_api("fox_girl"))

@commands.command()
async def baka(self, ctx):
await ctx.send(embed=self.neko_api(ctx, "baka"))
await ctx.send(embed=neko_api("baka"))

@commands.command()
async def hentai(self, ctx, type=""):
async def hentai(self, ctx, api_type=""):
if ctx.message.channel.nsfw:
api_types = ['femdom', 'classic', 'ngif', 'erofeet', 'erok', 'les',
'hololewd', 'lewdk', 'keta', 'feetg', 'nsfw_neko_gif', 'eroyuri',
Expand All @@ -97,13 +97,13 @@ async def hentai(self, ctx, type=""):
'feet', 'smug', 'kemonomimi', 'solog', 'holo', 'bj', 'woof', 'yuri', 'trap', 'anal',
'blowjob', 'holoero', 'feed', 'gasm', 'hentai', 'futanari', 'ero', 'solo', 'pwankg', 'eron',
'erokemo']
if type in api_types:
if api_type in api_types:
req = requests.get(f'https://nekos.life/api/v2/img/{api_type}')
try:
req = requests.get(f'https://nekos.life/api/v2/img/{type}')
if req.status_code != 200:
print("Unable to obtain image")
apijson = json.loads(req.text)
url = apijson["url"]
api_json = json.loads(req.text)
url = api_json["url"]

message = await ctx.send(embed=teapot.messages.downloading())
async with aiohttp.ClientSession() as session:
Expand Down

0 comments on commit 3b43dfa

Please sign in to comment.