aboutsummaryrefslogtreecommitdiffstats
path: root/bot/seasons
diff options
context:
space:
mode:
Diffstat (limited to 'bot/seasons')
-rw-r--r--bot/seasons/evergreen/snakes/snakes_cog.py24
-rw-r--r--bot/seasons/evergreen/snakes/utils.py16
-rw-r--r--bot/seasons/halloween/monstersurvey.py25
-rw-r--r--bot/seasons/valentines/be_my_valentine.py5
4 files changed, 13 insertions, 57 deletions
diff --git a/bot/seasons/evergreen/snakes/snakes_cog.py b/bot/seasons/evergreen/snakes/snakes_cog.py
index 1d138aff..38878706 100644
--- a/bot/seasons/evergreen/snakes/snakes_cog.py
+++ b/bot/seasons/evergreen/snakes/snakes_cog.py
@@ -303,9 +303,6 @@ class Snakes(Cog):
Builds a dict that the .get() method can use.
Created by Ava and eivl.
-
- :param name: The name of the snake to get information for - omit for a random snake
- :return: A dict containing information on a snake
"""
snake_info = {}
@@ -403,11 +400,7 @@ class Snakes(Cog):
return snake_info
async def _get_snake_name(self) -> Dict[str, str]:
- """
- Gets a random snake name.
-
- :return: A random snake name, as a string.
- """
+ """Gets a random snake name."""
return random.choice(self.snake_names)
async def _validate_answer(self, ctx: Context, message: Message, answer: str, options: list):
@@ -631,14 +624,10 @@ class Snakes(Cog):
@snakes_group.command(name='get')
@bot_has_permissions(manage_messages=True)
@locked()
- async def get_command(self, ctx: Context, *, name: Snake = None):
+ async def get_command(self, ctx: Context, *, name: Snake = None) -> None:
"""
Fetches information about a snake from Wikipedia.
- :param ctx: Context object passed from discord.py
- :param name: Optional, the name of the snake to get information
- for - omit for a random snake
-
Created by Ava and eivl.
"""
with ctx.typing():
@@ -1034,10 +1023,8 @@ class Snakes(Cog):
"""
How would I talk if I were a snake?
- :param ctx: context
- :param message: If this is passed, it will snakify the message.
- If not, it will snakify a random message from
- the users history.
+ If `message` is passed, the bot will snakify the message.
+ Otherwise, a random message from the user's history is snakified.
Written by Momo and kel.
Modified by lemon.
@@ -1077,8 +1064,7 @@ class Snakes(Cog):
"""
Gets a YouTube video about snakes.
- :param ctx: Context object passed from discord.py
- :param search: Optional, a name of a snake. Used to search for videos with that name
+ If `search` is given, a snake with that name will be searched on Youtube.
Written by Andrew and Prithaj.
"""
diff --git a/bot/seasons/evergreen/snakes/utils.py b/bot/seasons/evergreen/snakes/utils.py
index 5d3b0dee..e8d2ee44 100644
--- a/bot/seasons/evergreen/snakes/utils.py
+++ b/bot/seasons/evergreen/snakes/utils.py
@@ -285,20 +285,8 @@ def create_snek_frame(
"""
Creates a single random snek frame using Perlin noise.
- :param perlin_factory: the perlin noise factory used. Required.
- :param perlin_lookup_vertical_shift: the Perlin noise shift in the Y-dimension for this frame
- :param image_dimensions: the size of the output image.
- :param image_margins: the margins to respect inside of the image.
- :param snake_length: the length of the snake, in segments.
- :param snake_color: the color of the snake.
- :param bg_color: the background color.
- :param segment_length_range: the range of the segment length. Values will be generated inside
- this range, including the bounds.
- :param snake_width: the width of the snek, in pixels.
- :param text: the text to display with the snek. Set to None for no text.
- :param text_position: the position of the text.
- :param text_color: the color of the text.
- :return: a PIL image, representing a single frame.
+ `perlin_lookup_vertical_shift` represents the Perlin noise shift in the Y-dimension for this frame.
+ If `text` is given, display the given text with the snek.
"""
start_x = random.randint(image_margins[X], image_dimensions[X] - image_margins[X])
start_y = random.randint(image_margins[Y], image_dimensions[Y] - image_margins[Y])
diff --git a/bot/seasons/halloween/monstersurvey.py b/bot/seasons/halloween/monstersurvey.py
index 4e967cca..173ce8eb 100644
--- a/bot/seasons/halloween/monstersurvey.py
+++ b/bot/seasons/halloween/monstersurvey.py
@@ -36,15 +36,11 @@ class MonsterSurvey(Cog):
with open(self.registry_location, 'w') as jason:
json.dump(self.voter_registry, jason, indent=2)
- def cast_vote(self, id: int, monster: str):
+ def cast_vote(self, id: int, monster: str) -> None:
"""
Cast a user's vote for the specified monster.
If the user has already voted, their existing vote is removed.
-
- :param id: The id of the person voting
- :param monster: the string key of the json that represents a monster
- :return: None
"""
vr = self.voter_registry
for m in vr.keys():
@@ -147,14 +143,8 @@ class MonsterSurvey(Cog):
@monster_group.command(
name='show'
)
- async def monster_show(self, ctx: Context, name=None):
- """
- Shows the named monster. If one is not named, it sends the default voting embed instead.
-
- :param ctx:
- :param name:
- :return:
- """
+ async def monster_show(self, ctx: Context, name=None) -> None:
+ """Shows the named monster. If one is not named, it sends the default voting embed instead."""
if name is None:
await ctx.invoke(self.monster_leaderboard)
return
@@ -184,13 +174,8 @@ class MonsterSurvey(Cog):
name='leaderboard',
aliases=('lb',)
)
- async def monster_leaderboard(self, ctx: Context):
- """
- Shows the current standings.
-
- :param ctx:
- :return:
- """
+ async def monster_leaderboard(self, ctx: Context) -> None:
+ """Shows the current standings."""
async with ctx.typing():
vr = self.voter_registry
top = sorted(vr, key=lambda k: len(vr[k]['votes']), reverse=True)
diff --git a/bot/seasons/valentines/be_my_valentine.py b/bot/seasons/valentines/be_my_valentine.py
index ac140896..c4acf17a 100644
--- a/bot/seasons/valentines/be_my_valentine.py
+++ b/bot/seasons/valentines/be_my_valentine.py
@@ -184,14 +184,11 @@ class BeMyValentine(commands.Cog):
return valentine, title
@staticmethod
- def random_user(author, members):
+ def random_user(author: discord.Member, members: discord.Member):
"""
Picks a random member from the list provided in `members`.
The invoking author is ignored.
-
- :param author: member who invoked the command
- :param members: list of discord.Member objects
"""
if author in members:
members.remove(author)