Merge pull request #105 from NikolajDanger/fixing

Fixing
This commit is contained in:
Nikolaj Gade
2023-03-30 13:40:54 +02:00
committed by GitHub
6 changed files with 26 additions and 16 deletions

View File

@ -92,7 +92,7 @@ class MiscCog(commands.Cog):
@cog_ext.cog_slash(**params["wolf"]) @cog_ext.cog_slash(**params["wolf"])
async def wolf(self, ctx: SlashContext, query): async def wolf(self, ctx: SlashContext, query):
"""Perform a search on Wolfram Alpha.""" """Perform a search on Wolfram Alpha."""
await self.nerd_shit.wolfSearch(ctx, query) await self.nerd_shit.wolf_search(ctx, query)
def setup(bot): def setup(bot):

View File

@ -108,7 +108,7 @@ class ConnectFour(BoardGame):
await self.bot.defer(ctx) await self.bot.defer(ctx)
channel = str(ctx.channel_id) channel = str(ctx.channel_id)
opponent_info = await self._test_opponent(ctx, opponent) opponent, opponent_info = await self._test_opponent(ctx, opponent)
if not opponent_info: if not opponent_info:
return return
@ -119,7 +119,7 @@ class ConnectFour(BoardGame):
players = [ctx.author.id, opponent] players = [ctx.author.id, opponent]
random.shuffle(players) random.shuffle(players)
self.draw.draw_image(channel, board, players, [0, [0,0], ""], players) self.draw.draw_image(channel, board, players, [0, [0,0], ""])
opponent_name = self.get_name(f"#{opponent}") opponent_name = self.get_name(f"#{opponent}")
turn_name = self.get_name(f"#{players[0]}") turn_name = self.get_name(f"#{players[0]}")
@ -252,7 +252,11 @@ class ConnectFour(BoardGame):
if placed_piece: if placed_piece:
channel = str(ctx.channel) channel = str(ctx.channel)
self.draw.draw_image( self.draw.draw_image(
channel, board, winner, win_coordinates, win_direction, players) channel,
board,
players,
[winner, win_coordinates, win_direction]
)
boards_path = "gwendolyn/resources/games/connect_four_boards/" boards_path = "gwendolyn/resources/games/connect_four_boards/"

View File

@ -187,7 +187,7 @@ class BoardGame(GameBase):
self.bot.log("They tried to play against themself") self.bot.log("They tried to play against themself")
return False return False
return difficulty, difficulty_text return opponent, (difficulty, difficulty_text)
class BaseDrawer(): class BaseDrawer():
"""Class for drawing games.""" """Class for drawing games."""

View File

@ -1,13 +1,13 @@
import random # Used in movieFunc import random # Used in movie_func
import datetime # Used in helloFunc import datetime # Used in hello_func
import urllib # Used in imageFunc import urllib # Used in image_func
import ast import ast
import imdb # Used in movieFunc import imdb # Used in movie_func
import discord # Used in movieFunc import discord # Used in movie_func
import lxml # Used in imageFunc import lxml # Used in image_func
import fandom # Used in findWikiPage import fandom # Used in find_wiki_page
import d20 # Used in rollDice import d20 # Used in roll_dice
from .plex import Plex from .plex import Plex
from .nerd_shit import NerdShit from .nerd_shit import NerdShit
@ -93,7 +93,10 @@ class Other():
cam = random.choice(cams) cam = random.choice(cams)
self.bot.log("Chose cam type "+cam) self.bot.log("Chose cam type "+cam)
if cam == "one": if cam == "one":
search = f"img_{''.join([random.randint(0,9) for _ in range(4)])}"
search = "img_" + ''.join(
[str(random.randint(0,9)) for _ in range(4)]
)
elif cam == "two": elif cam == "two":
year = str(random.randint(2012,2016)) year = str(random.randint(2012,2016))
month = str(random.randint(1,12)).zfill(2) month = str(random.randint(1,12)).zfill(2)
@ -102,7 +105,9 @@ class Other():
elif cam == "three": elif cam == "three":
search = f"IMAG_{str(random.randint(1,500)).zfill(4)}" search = f"IMAG_{str(random.randint(1,500)).zfill(4)}"
elif cam == "four": elif cam == "four":
search = f"DSC_{''.join([random.randint(0,9) for _ in range(4)])}" search = "DSC_" + ''.join(
[str(random.randint(0,9)) for _ in range(4)]
)
self.bot.log("Searching for "+search) self.bot.log("Searching for "+search)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 KiB

After

Width:  |  Height:  |  Size: 638 KiB

View File

@ -8,6 +8,7 @@ IMDbPY==2021.4.18
lxml==4.8.0 lxml==4.8.0
Pillow==9.1.0 Pillow==9.1.0
pymongo==4.1.1 pymongo==4.1.1
pymongo[srv]
requests==2.27.1 requests==2.27.1
wolframalpha==5.0.0 wolframalpha==5.0.0
xmltodict==0.13.0 xmltodict==0.13.0