diff --git a/.deepsource.toml b/.deepsource.toml deleted file mode 100644 index d80d47b..0000000 --- a/.deepsource.toml +++ /dev/null @@ -1,13 +0,0 @@ -version = 1 - -[[analyzers]] -name = "docker" - -[[analyzers]] -name = "python" - - [analyzers.meta] - runtime_version = "3.x.x" - -[[transformers]] -name = "black" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8f6f777..cfd16b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,6 @@ -# IDEA -/shelf/ -/workspace.xml -/httpRequests/ -/dataSources/ -/dataSources.local.xml +# Editor .idea +.vscode +# General .env diff --git a/Bot/Dockerfile b/Bot/Dockerfile deleted file mode 100644 index d77bbbb..0000000 --- a/Bot/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM alpine:3.18.2 - -# Make a directory for the app -RUN mkdir /app -RUN mkdir /app/lynxie -WORKDIR /app - -# Copy the app files -COPY ./lynxie /app/lynxie -COPY ./poetry.lock /app -COPY ./pyproject.toml /app - -# Install dependencies -RUN apk update -RUN apk --no-cache add python3 py3-pip curl - -# Install poetry -RUN curl -sSL https://install.python-poetry.org | python3 - -RUN /root/.local/bin/poetry install - -# Run the app -CMD ["/root/.local/bin/poetry", "run", "python3", "/app/lynxie/main.py"] diff --git a/Bot/lynxie/assets/e621_blacklist.txt b/Bot/lynxie/assets/e621_blacklist.txt deleted file mode 100644 index a4c36c6..0000000 --- a/Bot/lynxie/assets/e621_blacklist.txt +++ /dev/null @@ -1,39 +0,0 @@ -cub -young -younger_penetrated -teen -teenager -diaper -pregnant -loli - -incest -parent_and_child -father_and_child -mother_and_child -brother_and_sister -sister_and_sister -brother_and_brother -age-difference - -bestiality -feral_and_anthro -human_on_feral -feral_on_human -anthro_on_feral -feral_on_anthro - -gore -blood -vomit - -torture -rape -forced - -scat -watersports -urine -snuff -eating_feces -shota diff --git a/Bot/lynxie/assets/overlays/bandicam.png b/Bot/lynxie/assets/overlays/bandicam.png deleted file mode 100644 index a324911..0000000 Binary files a/Bot/lynxie/assets/overlays/bandicam.png and /dev/null differ diff --git a/Bot/lynxie/assets/overlays/bubble.png b/Bot/lynxie/assets/overlays/bubble.png deleted file mode 100644 index c31319c..0000000 Binary files a/Bot/lynxie/assets/overlays/bubble.png and /dev/null differ diff --git a/Bot/lynxie/assets/overlays/gang.png b/Bot/lynxie/assets/overlays/gang.png deleted file mode 100644 index 530a729..0000000 Binary files a/Bot/lynxie/assets/overlays/gang.png and /dev/null differ diff --git a/Bot/lynxie/assets/overlays/jerm-a.png b/Bot/lynxie/assets/overlays/jerm-a.png deleted file mode 100644 index 9bcd4f6..0000000 Binary files a/Bot/lynxie/assets/overlays/jerm-a.png and /dev/null differ diff --git a/Bot/lynxie/assets/overlays/jerma.png b/Bot/lynxie/assets/overlays/jerma.png deleted file mode 100644 index aa5e17c..0000000 Binary files a/Bot/lynxie/assets/overlays/jerma.png and /dev/null differ diff --git a/Bot/lynxie/assets/overlays/liveleak.png b/Bot/lynxie/assets/overlays/liveleak.png deleted file mode 100644 index 351201c..0000000 Binary files a/Bot/lynxie/assets/overlays/liveleak.png and /dev/null differ diff --git a/Bot/lynxie/commands/__init__.py b/Bot/lynxie/commands/__init__.py deleted file mode 100644 index 18d7047..0000000 --- a/Bot/lynxie/commands/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -from .help import Help -from .ping import Ping -from .hello import Hello -from .music import Music -from .animals import Animals -from .image import Img -from .e621 import E621 - -__all__ = [ - "Help", - "Ping", - "Hello", - "Music", - "Animals", - "Img", - "E621", -] diff --git a/Bot/lynxie/commands/animals.py b/Bot/lynxie/commands/animals.py deleted file mode 100644 index e0120f4..0000000 --- a/Bot/lynxie/commands/animals.py +++ /dev/null @@ -1,49 +0,0 @@ -import requests -from io import BytesIO - -import discord -from discord.ext import commands - -from lynxie.config import TINYFOX_ANIMALS -from lynxie.utils import error_message - - -class Animals(commands.Cog): - def __init__(self, bot): - self.bot = bot - - @commands.command() - async def animal(self, ctx, animal_choice: str = ""): - animal_choice = animal_choice.lower().strip() or None - - if not animal_choice: - error = ( - f"You need to specify an animal! " - f"Try one of these: {', '.join(TINYFOX_ANIMALS)}" - ) - await ctx.reply(embed=error_message(error)) - return - - if animal_choice not in TINYFOX_ANIMALS: - error = ( - f"That animal doesn't exist! " - f"Try one of these: {', '.join(TINYFOX_ANIMALS)}" - ) - await ctx.reply(embed=error_message(error)) - return - - async with ctx.typing(): - request = requests.get( - "https://api.tinyfox.dev/img?animal=" + animal_choice - ) - - with BytesIO(request.content) as response: - response.seek(0) - animal_file = discord.File(response, filename="image.png") - - embed = discord.Embed( - title=animal_choice.capitalize(), - colour=discord.Colour.orange(), - ).set_image(url="attachment://image.png") - - await ctx.reply(embed=embed, file=animal_file, mention_author=False) diff --git a/Bot/lynxie/commands/e621.py b/Bot/lynxie/commands/e621.py deleted file mode 100644 index 234e83a..0000000 --- a/Bot/lynxie/commands/e621.py +++ /dev/null @@ -1,119 +0,0 @@ -import json -from base64 import b64encode -import requests - -import discord -from discord.ext import commands - -from lynxie.config import E621_API_KEY, E621_USERNAME, E621_BLACKLIST -from lynxie.utils import error_message - - -_E621_AUTH = f"{E621_USERNAME}:{E621_API_KEY}".encode("utf-8") -_E621_API_HEADERS = { - "Accept": "application/json", - "Content-Type": "application/json", - "User-Agent": f"Lynxie/1.0 (by {E621_USERNAME} on e621)", - "Authorization": str(b"Basic " + b64encode(_E621_AUTH), "utf-8"), -} - - -class E621(commands.Cog): - def __init__(self, bot): - self.bot = bot - - @commands.command() - async def porb(self, ctx, *tags): - url = "https://e621.net/posts.json/?limit=1&tags=order:random+rating:e+" - caught_tags = [] - - for tag in tags: - tag = tag.lower() - url += tag + "+" - if tag in E621_BLACKLIST: - caught_tags.append(tag) - - for tag in E621_BLACKLIST: - url += f"-{tag}+" - - if caught_tags: - error = ( - "An error occurred while fetching the image! " - f"{', '.join(['`'+tag+'`' for tag in caught_tags])} " - f"is a blacklisted tag!" - ) - await ctx.reply(embed=error_message(error)) - return - - request = requests.get(url, headers=_E621_API_HEADERS) - response = json.loads(request.text) - - if request.status_code == 503: - error = ( - "The bot is currently rate limited! " - "Wait a while before trying again." - ) - await ctx.reply(embed=error_message(error)) - return - if request.status_code != 200: - error = ( - "An error occurred while fetching the image! " - f"(Error code: {str(request.status_code)})" - ) - await ctx.reply(embed=error_message(error)) - return - - if not response["posts"]: - tags_to_display = range(min(len(tags), 20)) - error = ( - "No results found for the given tags! " - f"(Tags: {', '.join(['`'+tags[i]+'`' for i in tags_to_display])})" - ) - await ctx.reply(embed=error_message(error)) - return - - post = response["posts"][0] - general_tags = post["tags"]["general"] - - embed = discord.Embed( - title="E621", - description=post["description"] or "No description provided.", - colour=discord.Colour.orange(), - ) - - embed.add_field( - name="Score", - value=f"⬆️ {post['score']['up']} | ⬇️ {post['score']['down']}", - ) - embed.add_field( - name="Favorites", - value=post["fav_count"], - ) - embed.add_field( - name="Comments", - value=post["comment_count"], - ) - - embed.add_field( - name="Source(s)", - value=", ".join(post["sources"]) or "No source provided.", - inline=False, - ) - embed.add_field( - name="Tags", - value=( - ", ".join( - [ - "`" + general_tags[i] + "`" - for i in range(min(len(general_tags), 20)) - ] - ) - or "No tags provided." - ), - inline=False, - ) - - embed.set_footer(text=f"ID: {post['id']} | Created: {post['created_at']}") - embed.set_image(url=post["file"]["url"]) - - await ctx.reply(embed=embed) diff --git a/Bot/lynxie/commands/hello.py b/Bot/lynxie/commands/hello.py deleted file mode 100644 index 598524e..0000000 --- a/Bot/lynxie/commands/hello.py +++ /dev/null @@ -1,17 +0,0 @@ -import discord -from discord.ext import commands - - -class Hello(commands.Cog): - def __init__(self, bot): - self.bot = bot - - @commands.command() - async def hello(self, ctx): - embed = discord.Embed( - title="Hello!", - description="I'm Lynxie, a multipurpose Discord bot written in Python!", - color=discord.Color.orange(), - ) - - await ctx.reply(embed=embed) diff --git a/Bot/lynxie/commands/help.py b/Bot/lynxie/commands/help.py deleted file mode 100644 index e53bb04..0000000 --- a/Bot/lynxie/commands/help.py +++ /dev/null @@ -1,37 +0,0 @@ -import discord -from discord.ext import commands -from lynxie.config import LYNXIE_PREFIX - - -class Help(commands.Cog): - def __init__(self, bot): - self.bot = bot - self.help_commands = { - "help": "Show this message", - "ping": "Pong!", - "hello": "Say hello to Lynxie!", - "join": "Join the voice channel you're in", - "play ": "Play a song from YouTube, SoundCloud, etc.", - "stop": "Stop the current song and leave the voice channel", - "animal ": "Get a random image of an animal!", - "overlay