Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
EllieJaybee committed Sep 11, 2024
1 parent 9b682ba commit 645a285
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 41 deletions.
4 changes: 3 additions & 1 deletion bot/plugins/context/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class NoSauceError(IndexError):


@plugin.include
@crescent.message_command(name="Find Sauce", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.message_command(
name="Find Sauce", default_member_permissions=hikari.Permissions.VIEW_CHANNEL
)
async def sauce(ctx: crescent.Context, message: hikari.Message):
await ctx.defer(ephemeral=True)
sauceclient = SauceNao(api_key=plugin.model.secret.SAUCE_TOKEN, results_limit=1)
Expand Down
102 changes: 85 additions & 17 deletions bot/plugins/main/anime.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ async def action(


@plugin.include
@crescent.command(name="bite", description="Bite someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="bite",
description="Bite someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class BiteCommand:
target = crescent.option(hikari.User, "Who do you want to bite?")

Expand All @@ -38,7 +42,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="boop", description="Boop someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="boop",
description="Boop someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class BoopCommand:
target = crescent.option(hikari.User, "Who do you want to boop?")

Expand All @@ -47,7 +55,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="bully", description="Bully someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="bully",
description="Bully someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class BullyCommand:
target = crescent.option(hikari.User, "Who do you want to bully?")

Expand All @@ -56,7 +68,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="cuddle", description="Cuddle someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="cuddle",
description="Cuddle someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class CuddleCommand:
target = crescent.option(hikari.User, "Who do you want to cuddle?")

Expand All @@ -65,7 +81,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="greet", description="Greet someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="greet",
description="Greet someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class WaveCommand:
target = crescent.option(hikari.User, "Who do you want to greet?")

Expand All @@ -74,7 +94,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="handhold", description="Hold someone's hand!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="handhold",
description="Hold someone's hand!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class HoldCommand:
target = crescent.option(hikari.User, "Who do you want to hold?")

Expand All @@ -83,7 +107,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="hug", description="Hug someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="hug",
description="Hug someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class HugCommand:
target = crescent.option(hikari.User, "Who do you want to hug?")

Expand All @@ -92,7 +120,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="highfive", description="Highfive someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="highfive",
description="Highfive someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class FiveCommand:
target = crescent.option(hikari.User, "Who do you want to highfive?")

Expand All @@ -101,7 +133,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="kill", description="Kill someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="kill",
description="Kill someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class KillCommand:
target = crescent.option(hikari.User, "Who do you want to kill?")

Expand All @@ -110,7 +146,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="kiss", description="Kiss someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="kiss",
description="Kiss someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class KissCommand:
target = crescent.option(hikari.User, "Who do you want to kiss?")

Expand All @@ -119,7 +159,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="lick", description="Lick someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="lick",
description="Lick someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class LickCommand:
target = crescent.option(hikari.User, "Who do you want to lick?")

Expand All @@ -128,7 +172,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="pat", description="Pat someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="pat",
description="Pat someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class PatCommand:
target = crescent.option(hikari.User, "Who do you want to pat?")

Expand All @@ -137,7 +185,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="poke", description="Poke someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="poke",
description="Poke someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class PokeCommand:
target = crescent.option(hikari.User, "Who do you want to poke?")

Expand All @@ -146,7 +198,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="punch", description="Punch someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="punch",
description="Punch someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class PunchCommand:
target = crescent.option(hikari.User, "Who do you want to punch?")

Expand All @@ -155,7 +211,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="slap", description="Slap someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="slap",
description="Slap someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class SlapCommand:
target = crescent.option(hikari.User, "Who do you want to slap?")

Expand All @@ -164,7 +224,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="stare", description="Stare at someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="stare",
description="Stare at someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class StareCommand:
target = crescent.option(hikari.User, "Who do you want to stare at?")

Expand All @@ -173,7 +237,11 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="tickle", description="Tickle someone!", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="tickle",
description="Tickle someone!",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class TickleCommand:
target = crescent.option(hikari.User, "Who do you want to tickle?")

Expand Down
2 changes: 1 addition & 1 deletion bot/plugins/main/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def startup(event: hikari.GuildAvailableEvent):
for channel_id in guild.get_channels():
channel = guild.get_channel(channel_id)
logger.debug(f"L Connected to #{channel.name}({channel.id})")
logger.debug('-')
logger.debug("-")


@plugin.include
Expand Down
42 changes: 36 additions & 6 deletions bot/plugins/main/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,28 @@ async def _search(ctx: crescent.Context, query: str) -> hikari.Message | None:


@plugin.include
@crescent.command(name="search", description="Fetches the first google search result", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="search",
description="Fetches the first google search result",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class Search:
query = crescent.option(str, "Query to be searched")

async def callback(self, ctx: crescent.Context):
await ctx.defer()
await _search(ctx, self.query)


@plugin.include
@crescent.command(name="answer", description="Answers your burning questions, powered by google", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="answer",
description="Answers your burning questions, powered by google",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class Answer:
query = crescent.option(str, "Your question")

async def callback(self, ctx: crescent.Context):
await ctx.defer()
soup = await request(params={"q": self.query})
Expand All @@ -60,9 +70,14 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="calculate", description="Calculates stuff humanly, powered by google", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="calculate",
description="Calculates stuff humanly, powered by google",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class Calculate:
query = crescent.option(str, "Your math question")

async def callback(self, ctx: crescent.Context):
await ctx.defer()
soup = await request(params={"q": self.query})
Expand All @@ -77,9 +92,14 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="define", description="Defines a word or phrase queried, powered by google", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="define",
description="Defines a word or phrase queried, powered by google",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class Define:
query = crescent.option(str, "Phrase to be defined")

async def callback(self, ctx: crescent.Context):
await ctx.defer()
soup = await request(params={"q": f"define {self.query}"})
Expand All @@ -104,9 +124,14 @@ async def callback(self, ctx: crescent.Context):


@plugin.include
@crescent.command(name="weather", description="Gives a weather forecast for query, powered by google", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="weather",
description="Gives a weather forecast for query, powered by google",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class Weather:
query = crescent.option(str, "Location/time query")

async def callback(self, ctx: crescent.Context):
await ctx.defer()
soup = await request(params={"q": f"weather {self.query}"})
Expand Down Expand Up @@ -177,9 +202,14 @@ async def get_hires_link(response: dict | bs) -> str | None:


@plugin.include
@crescent.command(name="image", description="Fetches the first (lowres) image of the query on google", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="image",
description="Fetches the first (lowres) image of the query on google",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class Image:
query = crescent.option(str, "Image to search for")

async def callback(self, ctx: crescent.Context):
await ctx.defer()
soup = await request(
Expand Down
19 changes: 16 additions & 3 deletions bot/plugins/main/rng.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@


@plugin.include
@crescent.command(description="Pick a random member", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
description="Pick a random member",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
async def pickmember(ctx: crescent.Context):
membersview = plugin.app.cache.get_members_view_for_guild(ctx.guild_id)
await ctx.respond(
Expand All @@ -18,18 +21,28 @@ async def pickmember(ctx: crescent.Context):


@plugin.include
@crescent.command(name="rng", description="Generates a random number in a range", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="rng",
description="Generates a random number in a range",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class RNG:
min = crescent.option(int, "Lowest number")
max = crescent.option(int, "Highest number")

async def callback(self, ctx: crescent.Context):
await ctx.respond(random.randint(self.min, self.max))


@plugin.include
@crescent.command(name="pick", description="Pick randomly from a list of choices", default_member_permissions=hikari.Permissions.VIEW_CHANNEL)
@crescent.command(
name="pick",
description="Pick randomly from a list of choices",
default_member_permissions=hikari.Permissions.VIEW_CHANNEL,
)
class Pick:
choices = crescent.option(str, "Choices separated by commas")

async def callback(self, ctx: crescent.Context):
choice_list = self.choices.split(",")
await ctx.respond(
Expand Down
Loading

0 comments on commit 645a285

Please sign in to comment.