Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
fix: i don't remember
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskDuck committed Apr 18, 2024
1 parent c726f54 commit 2666076
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
1 change: 1 addition & 0 deletions _orangcbot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
intents=Intents.all(),
command_prefix="oc/",
help_command=commands.DefaultHelpCommand(),
case_insensitive=True,
)
bot.load_extension("onami")
bot.load_extension("extensions.fun")
Expand Down
39 changes: 36 additions & 3 deletions _orangcbot/extensions/fun.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
import nextcord
import aiohttp

import dotenv
dotenv.load_dotenv()

# import os

_psl = PSL()
from typing import Optional
from random import choice

_bonk_ans = ["Ouch!", "It hurts!", "Ohh noooo", "Pleaseeeeeee don't hurt me..."]
# _randommer_api_key = os.getenv("RANDOMMER_API_KEY")
# def has_randommer_api_key():
# async def predicate(ctx: comamnds.Context):
# return _randommer_api_key != None
# return commands.check(predicate)


class View(nextcord.ui.View):
# async def _request_randommer(*, params, path):
# async with aiohttp.ClientSession() as session:
# async with session.get(f"https://randommer.io/api/{path}", params=params, headers={"X-Api-Key": _randommer_api_key}) as response:
# return await response.json()

class BonkView(nextcord.ui.View):
def __init__(self, ctx):
super().__init__()
self._ctx = ctx
Expand All @@ -26,14 +40,32 @@ async def _bonk(
if interaction.user.id == self._ctx.author.id:
await self.message.edit(content=choice(_bonk_ans))

# class RandomView(nextcord.ui.View):
# def __init__(self, ctx, randomwhat: str):
# super().__init__()
# self._ctx: commands.Context = _ctx
# self._random = randomwhat
# self.message: Optional[nextcord.Message] = None
#
# def update_msg(self, msg: nextcord.Message):
# self.message = msg

@nextcord.ui.button("Generate a new one?", style=nextcord.ButtonStyle.green)
async def _generator(
self, button: nextcord.ui.Button, interaction: nextcord.Interaction
):
...




class Fun(commands.Cog):
def __init__(self, bot):
self._bot = bot

@commands.command()
async def bonk(self, ctx):
k = View(ctx)
k = BonkView(ctx)
msg = await ctx.send(content="Good.", view=k)
k.update_msg(msg)

Expand Down Expand Up @@ -68,5 +100,6 @@ async def ubdict(self, ctx: commands.Context, *, word: str):




def setup(bot):
bot.add_cog(Fun(bot))

0 comments on commit 2666076

Please sign in to comment.