AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

This commit is contained in:
nin0dev 2024-10-04 08:01:42 -04:00
parent 5d4538cd50
commit be5c916a69
Signed by: nin0
GPG key ID: 3FA8F96ABAE04214
6 changed files with 325 additions and 279 deletions

338
.gitignore vendored
View file

@ -1,170 +1,170 @@
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/
*.py[cod] *.py[cod]
*$py.class *$py.class
# C extensions # C extensions
*.so *.so
# Distribution / packaging # Distribution / packaging
.Python .Python
build/ build/
develop-eggs/ develop-eggs/
dist/ dist/
downloads/ downloads/
eggs/ eggs/
.eggs/ .eggs/
lib/ lib/
lib64/ lib64/
parts/ parts/
sdist/ sdist/
var/ var/
wheels/ wheels/
share/python-wheels/ share/python-wheels/
*.egg-info/ *.egg-info/
.installed.cfg .installed.cfg
*.egg *.egg
MANIFEST MANIFEST
# PyInstaller # PyInstaller
# Usually these files are written by a python script from a template # Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it. # before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest *.manifest
*.spec *.spec
# Installer logs # Installer logs
pip-log.txt pip-log.txt
pip-delete-this-directory.txt pip-delete-this-directory.txt
# Unit test / coverage reports # Unit test / coverage reports
htmlcov/ htmlcov/
.tox/ .tox/
.nox/ .nox/
.coverage .coverage
.coverage.* .coverage.*
.cache .cache
nosetests.xml nosetests.xml
coverage.xml coverage.xml
*.cover *.cover
*.py,cover *.py,cover
.hypothesis/ .hypothesis/
.pytest_cache/ .pytest_cache/
cover/ cover/
# Translations # Translations
*.mo *.mo
*.pot *.pot
# Django stuff: # Django stuff:
*.log *.log
local_settings.py local_settings.py
db.sqlite3 db.sqlite3
db.sqlite3-journal db.sqlite3-journal
# Flask stuff: # Flask stuff:
instance/ instance/
.webassets-cache .webassets-cache
# Scrapy stuff: # Scrapy stuff:
.scrapy .scrapy
# Sphinx documentation # Sphinx documentation
docs/_build/ docs/_build/
# PyBuilder # PyBuilder
.pybuilder/ .pybuilder/
target/ target/
# Jupyter Notebook # Jupyter Notebook
.ipynb_checkpoints .ipynb_checkpoints
# IPython # IPython
profile_default/ profile_default/
ipython_config.py ipython_config.py
# pyenv # pyenv
# For a library or package, you might want to ignore these files since the code is # For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in: # intended to run in multiple environments; otherwise, check them in:
# .python-version # .python-version
# pipenv # pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies # However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not # having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies. # install all needed dependencies.
#Pipfile.lock #Pipfile.lock
# poetry # poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more # This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries. # commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock #poetry.lock
# pdm # pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock #pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control. # in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml .pdm.toml
.pdm-python .pdm-python
.pdm-build/ .pdm-build/
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/ __pypackages__/
# Celery stuff # Celery stuff
celerybeat-schedule celerybeat-schedule
celerybeat.pid celerybeat.pid
# SageMath parsed files # SageMath parsed files
*.sage.py *.sage.py
# Environments # Environments
.env .env
.venv .venv
env/ env/
venv/ venv/
ENV/ ENV/
env.bak/ env.bak/
venv.bak/ venv.bak/
# Spyder project settings # Spyder project settings
.spyderproject .spyderproject
.spyproject .spyproject
# Rope project settings # Rope project settings
.ropeproject .ropeproject
# mkdocs documentation # mkdocs documentation
/site /site
# mypy # mypy
.mypy_cache/ .mypy_cache/
.dmypy.json .dmypy.json
dmypy.json dmypy.json
# Pyre type checker # Pyre type checker
.pyre/ .pyre/
# pytype static type analyzer # pytype static type analyzer
.pytype/ .pytype/
# Cython debug symbols # Cython debug symbols
cython_debug/ cython_debug/
# PyCharm # PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear # and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder. # option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/ #.idea/
.env .env
bin/ bin/
include/ include/
lib/ lib/
lib64/ lib64/
lib64 lib64
pyvenv.cfg pyvenv.cfg
constants.py constants.py

View file

@ -1,47 +1,58 @@
import discord import asyncio
from discord import app_commands import discord
from discord.ext import commands from discord import app_commands
import os from discord.ext import commands
import util import os
import util
class DerangedCommands(commands.Cog): import constants
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
class DerangedCommands(commands.Cog):
@app_commands.command(name="get-token", description="Get my token :3") def __init__(self, bot: commands.Bot) -> None:
@app_commands.allowed_installs(guilds=False, users=True) self.bot = bot
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def token(self, interaction: discord.Interaction) -> None: @app_commands.command(name="get-token", description="Get my token :3")
embed = discord.Embed() @app_commands.allowed_installs(guilds=False, users=True)
embed.title = "My token" @app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
embed.description = os.getenv("TOKEN") if util.is_owner(interaction.user.id) else "[object Object]" async def token(self, interaction: discord.Interaction) -> None:
embed.color = 0x00EAFF embed = discord.Embed()
await interaction.response.send_message(embed=embed, ephemeral=True) embed.title = "My token"
embed.description = constants.TOKEN if util.is_owner(interaction.user.id) else "[object Object]"
@app_commands.command(name="sync", description="This will sync slash commands") embed.color = 0x00EAFF
@app_commands.allowed_installs(guilds=False, users=True) await interaction.response.send_message(embed=embed)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def sync(self, interaction: discord.Interaction, ephemeral: bool) -> None: @app_commands.command(name="sync", description="This will sync slash commands")
if not util.is_owner(interaction.user.id): @app_commands.allowed_installs(guilds=False, users=True)
await interaction.response.send_message(embed=util.fuckoff_embed) @app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
return async def sync(self, interaction: discord.Interaction, ephemeral: bool) -> None:
await self.bot.tree.sync() if not util.is_owner(interaction.user.id):
embed = discord.Embed() await interaction.response.send_message(embed=util.fuckoff_embed)
embed.description = ":white_check_mark: Synced slash commands" return
embed.color = util.success await self.bot.tree.sync()
await interaction.response.send_message(embed=embed, ephemeral=ephemeral) embed = discord.Embed()
embed.description = ":white_check_mark: Synced slash commands"
@app_commands.command(name="say", description="veev arc") embed.color = util.success
@app_commands.allowed_installs(guilds=False, users=True) await interaction.response.send_message(embed=embed, ephemeral=ephemeral)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def say(self, interaction: discord.Interaction, content: str) -> None: @app_commands.command(name="say", description="veev arc")
await interaction.response.send_message(content=content) @app_commands.allowed_installs(guilds=False, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
@app_commands.command(name="java-yap", description="Uwu") async def say(self, interaction: discord.Interaction, content: str) -> None:
@app_commands.allowed_installs(guilds=False, users=True) await interaction.response.send_message(content=content)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def javaer(self, interaction: discord.Interaction) -> None: @app_commands.command(name="java-yap", description="Uwu")
await interaction.response.send_message(content=f"https://files.catbox.moe/yeirho.mp4") @app_commands.allowed_installs(guilds=False, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def setup(bot: commands.Bot) -> None: async def javaer(self, interaction: discord.Interaction) -> None:
await interaction.response.send_message(content=f"https://files.catbox.moe/yeirho.mp4")
@app_commands.command(name="cook", description="Cooking show magic :meowlien:")
@app_commands.allowed_installs(guilds=False, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def cook(self, interaction: discord.Interaction, victim: discord.User) -> None:
await interaction.response.send_message(content=f"Cooking {victim.mention} 👨‍🍳")
await asyncio.sleep(4);
await interaction.followup.send(content=f"Cooked {victim.mention}")
async def setup(bot: commands.Bot) -> None:
await bot.add_cog(DerangedCommands(bot)) await bot.add_cog(DerangedCommands(bot))

58
cogs/tags.py Normal file
View file

@ -0,0 +1,58 @@
import discord
from discord import app_commands
from discord.ext import commands
import os
import util
import constants
class Tags(commands.Cog):
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
@app_commands.command(name="tag-forwarding", description="Show a thing about forwarding")
@app_commands.allowed_installs(guilds=False, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def forward(self, interaction: discord.Interaction, target: discord.User = None) -> None:
await interaction.response.send_message(content=f"Hey {target.mention}, take a look at this!" if target else "",
embed=discord.Embed(
title="Forwarding",
description="If you do not have forwarding natively, without messing with Experiments, enabling it won't do anything. The experiment is server side locked.",
color=0x00AEFF
))
@app_commands.command(name="tag-dev", description="Show a thing about Vencord plugin dev")
@app_commands.allowed_installs(guilds=False, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def dev(self, interaction: discord.Interaction, target: discord.User = None) -> None:
await interaction.response.send_message(content=f"Hey {target.mention}, take a look at this!" if target else "",
embed=discord.Embed(
title="Plugin development",
description="Want to get started with plugin development? Some things are there to help you!\n\n**Documentation**\n- https://docs.vencord.dev\n- Just look on the Vencord repo for code\n\n**Channels**\n<#1032770730703716362>, but read <#1032770730703716362> first.",
color=0x00AEFF
))
@app_commands.command(name="tag-dev", description="Show a thing about Vencord plugin dev")
@app_commands.allowed_installs(guilds=False, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def dev(self, interaction: discord.Interaction, target: discord.User = None) -> None:
await interaction.response.send_message(content=f"Hey {target.mention}, take a look at this!" if target else "",
embed=discord.Embed(
title="Plugin development",
description="Want to get started with plugin development? Some things are there to help you!\n\n**Documentation**\n- https://docs.vencord.dev\n- Just look on the Vencord repo for code\n\n**Channels**\n<#1032770730703716362>, but read <#1032770730703716362> first.",
color=0x00AEFF
))
@app_commands.command(name="tag-cant-read", description="You can't read")
@app_commands.allowed_installs(guilds=False, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def dev2(self, interaction: discord.Interaction, target: discord.User = None) -> None:
await interaction.response.send_message(content=f"Hey {target.mention}, take a look at this!" if target else "",
embed=discord.Embed(
title="Wrong channel!",
description="Currently, you are in modmail. Your question is a support question, not a question only a staff member could answer.\n*Because you couldn't read the huge WARNING on the modmail channel, you have been banned from opening tickets. Go to <#1026515880080842772>.*",
color=0xFF8989
))
async def setup(bot: commands.Bot) -> None:
await bot.add_cog(Tags(bot))

View file

@ -1,24 +0,0 @@
import discord
from discord import app_commands
from discord.ext import commands
import os
import util
class Victimization(commands.Cog):
def __init__(self, bot: commands.Bot) -> None:
self.bot = bot
@app_commands.command(name="cook", description="Cooking show magic :meowlien:")
@app_commands.allowed_installs(guilds=False, users=True)
@app_commands.allowed_contexts(guilds=True, dms=True, private_channels=True)
async def cook(self, interaction: discord.Interaction, victim: discord.User) -> None:
embed = discord.Embed()
embed.title = "My token"
embed.description = os.getenv("TOKEN") if util.is_owner(interaction.user.id) else "[object Object]"
embed.color = 0x00EAFF
await interaction.response.send_message(embed=embed, ephemeral=True)
async def setup(bot: commands.Bot) -> None:
await bot.add_cog(Victimization(bot))

67
main.py
View file

@ -1,34 +1,35 @@
import discord import discord
import os import os
from discord import app_commands from discord import app_commands
from discord.ext import commands from discord.ext import commands
from cogs.deranged_commands import DerangedCommands from cogs.deranged_commands import DerangedCommands
from cogs.victimization import Victimization from dotenv import load_dotenv
from dotenv import load_dotenv #import selfcord
import selfcord from cogs.tags import Tags
import constants import constants
load_dotenv() load_dotenv()
client = commands.Bot(intents=discord.Intents.all(), command_prefix=".") client = commands.Bot(intents=discord.Intents.all(), command_prefix=".")
user = selfcord.Client() #user = selfcord.Client()
@client.event @client.event
async def on_message(message): async def on_message(message):
if message.author.id != 886685857560539176: if message.author.id != 886685857560539176:
return return
if message.content.startswith('.sync'): if message.content.startswith('.sync'):
await client.tree.sync() await client.tree.sync()
await message.channel.send('Synced commands') await message.channel.send('Synced commands')
@client.event @client.event
async def on_ready(): async def on_ready():
print("Logged in as bot") print("Logged in as bot")
await user.login(constants.USER_TOKEN) #await user.login(constants.USER_TOKEN)
print("Logged in as user") #print("Logged in as user")
await client.add_cog(DerangedCommands(client)) await client.add_cog(DerangedCommands(client))
print("Loaded all cogs") await client.add_cog(Tags(client))
print("Loaded all cogs")
client.run(constants.TOKEN) client.run(constants.TOKEN)

14
util.py
View file

@ -1,7 +1,7 @@
from discord import Embed from discord import Embed
def is_owner(id: int): def is_owner(id: int):
return True if id == 886685857560539176 else False return True if id == 886685857560539176 else False
success = 0x77b255 success = 0x77b255
error = 0xdd2e44 error = 0xdd2e44
fuckoff_embed = Embed(title="No permissions", description="You can't use this.", color=error) fuckoff_embed = Embed(title="You are an idiot", description="You can't use this.", color=error)