-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This update of Kumiko sets the foundation for v0.8.x. Kumiko now uses Discord.py instead of Pycord due to the direction that Pycord v2 is headed as of now. For more information, please check out the changelog. - Noelle
- Loading branch information
Showing
78 changed files
with
2,879 additions
and
3,188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ jobs: | |
uses: Gr1N/setup-poetry@v8 | ||
- name: Cache Poetry | ||
id: cache-poetry | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].1 | ||
with: | ||
path: ~/.cache/pypoetry/virtualenvs | ||
key: ${{ runner.os }}-poetry-v3-${{ hashFiles('**/poetry.lock') }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ jobs: | |
password: ${{ secrets.GHCR_PACKAGE_TOKEN }} | ||
|
||
- name: Cache Docker layers | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].1 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-debian-ghcr-${{ github.sha }} | ||
|
@@ -108,7 +108,7 @@ jobs: | |
password: ${{ secrets.DOCKER_TOKEN }} | ||
|
||
- name: Cache Docker layers | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].1 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-debian-hub-${{ github.sha }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Lint | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
pull_request: | ||
branches: | ||
- dev | ||
|
||
env: | ||
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres | ||
|
||
jobs: | ||
Analyze: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
postgres: | ||
image: postgres:15 | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DB: postgres | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.11 | ||
id: setup-python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Set up Poetry | ||
uses: Gr1N/setup-poetry@v8 | ||
|
||
- name: Cache Poetry | ||
id: cache-poetry | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.cache/pypoetry/virtualenvs | ||
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Poetry Dependencies | ||
if: steps.cache-poetry.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install --with dev | ||
- name: Generate Prisma Client | ||
run: | | ||
poetry run prisma db push | ||
- name: Run Pyright | ||
run: | | ||
poetry run pyright Bot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ jobs: | |
uses: Gr1N/setup-poetry@v8 | ||
- name: Cache Poetry | ||
id: cache-poetry | ||
uses: actions/[email protected].0 | ||
uses: actions/[email protected].1 | ||
with: | ||
path: ~/.cache/pypoetry/virtualenvs | ||
key: ${{ runner.os }}-poetry-v2-${{ hashFiles('**/poetry.lock') }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,4 +79,5 @@ image-testspy | |
.vagrant | ||
migrations | ||
.env-old | ||
database.db | ||
database.db | ||
json-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.11.2 | ||
3.11.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import aiohttp | ||
import discord | ||
import orjson | ||
from discord import app_commands | ||
from discord.ext import commands | ||
from Libs.utils import Embed | ||
|
||
|
||
class Actions(commands.Cog): | ||
"""Hug, pet, or kiss someone on Discord!""" | ||
|
||
def __init__(self, bot: commands.Bot) -> None: | ||
self.bot = bot | ||
|
||
@commands.hybrid_command(name="hug") | ||
@app_commands.describe(user="The user to hug") | ||
async def hug(self, ctx: commands.Context, user: discord.Member) -> None: | ||
"""Hug someone on Discord!""" | ||
async with aiohttp.ClientSession() as session: | ||
async with session.get("https://nekos.life/api/v2/img/hug") as r: | ||
data = await r.json(loads=orjson.loads) | ||
embed = Embed(title=f"{ctx.author.name} hugs {user.name}!") | ||
embed.set_image(url=data["url"]) | ||
await ctx.send(embed=embed) | ||
|
||
@commands.hybrid_command(name="pat") | ||
@app_commands.describe(user="The user to pat") | ||
async def pat(self, ctx: commands.Context, user: discord.Member) -> None: | ||
"""Give someone a headpat!""" | ||
async with aiohttp.ClientSession() as session: | ||
async with session.get("https://nekos.life/api/v2/img/pat") as r: | ||
data = await r.json(loads=orjson.loads) | ||
embed = Embed(title=f"{ctx.author.name} pats {user.name}!") | ||
embed.set_image(url=data["url"]) | ||
await ctx.send(embed=embed) | ||
|
||
@commands.hybrid_command(name="kiss") | ||
@app_commands.describe(user="The user to kiss") | ||
async def kiss(self, ctx: commands.Context, user: discord.Member) -> None: | ||
"""Give someone a kiss!""" | ||
async with aiohttp.ClientSession() as session: | ||
async with session.get("https://nekos.life/api/v2/img/kiss") as r: | ||
data = await r.json(loads=orjson.loads) | ||
embed = Embed(title=f"{ctx.author.name} kisses {user.name}!") | ||
embed.set_image(url=data["url"]) | ||
await ctx.send(embed=embed) | ||
|
||
@commands.hybrid_command(name="cuddle") | ||
@app_commands.describe(user="The user to cuddle") | ||
async def cuddle(self, ctx: commands.Context, user: discord.Member) -> None: | ||
"""Cuddle someone on Discord!""" | ||
async with aiohttp.ClientSession() as session: | ||
async with session.get("https://nekos.life/api/v2/img/cuddle") as r: | ||
data = await r.json(loads=orjson.loads) | ||
embed = Embed(title=f"{ctx.author.name} cuddles {user.name}!") | ||
embed.set_image(url=data["url"]) | ||
await ctx.send(embed=embed) | ||
|
||
@commands.hybrid_command(name="slap") | ||
@app_commands.describe(user="The user to slap") | ||
async def slap(self, ctx: commands.Context, user: discord.Member) -> None: | ||
"""Slaps someone on Discord!""" | ||
async with aiohttp.ClientSession() as session: | ||
async with session.get("https://nekos.life/api/v2/img/slap") as r: | ||
data = await r.json(loads=orjson.loads) | ||
embed = Embed(title=f"{ctx.author.name} slaps {user.name}!") | ||
embed.set_image(url=data["url"]) | ||
await ctx.send(embed=embed) | ||
|
||
@commands.hybrid_command(name="tickle") | ||
@app_commands.describe(user="The user to tickle") | ||
async def tickles(self, ctx: commands.Context, user: discord.Member) -> None: | ||
"""Tickle someone on Discord!""" | ||
async with aiohttp.ClientSession() as session: | ||
async with session.get("https://nekos.life/api/v2/img/tickle") as r: | ||
data = await r.json(loads=orjson.loads) | ||
embed = Embed(title=f"{ctx.author.name} tickles {user.name}!") | ||
embed.set_image(url=data["url"]) | ||
await ctx.send(embed=embed) | ||
|
||
@commands.hybrid_command(name="poke") | ||
@app_commands.describe(user="The user to poke") | ||
async def poke(self, ctx: commands.Context, user: discord.Member) -> None: | ||
"""Poke someone on Discord!""" | ||
async with aiohttp.ClientSession() as session: | ||
async with session.get("https://nekos.life/api/v2/img/poke") as r: | ||
data = await r.json(loads=orjson.loads) | ||
embed = Embed(title=f"{ctx.author.name} pokes {user.name}!") | ||
embed.set_image(url=data["url"]) | ||
await ctx.send(embed=embed) | ||
|
||
|
||
async def setup(bot: commands.Bot) -> None: | ||
await bot.add_cog(Actions(bot)) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.