Skip to content

Commit

Permalink
Merge pull request #220 from The-4th-Hokage/deepsource-fix-6035f5bd
Browse files Browse the repository at this point in the history
Change methods not using its bound instance to staticmethods
  • Loading branch information
Dhruvacube authored Oct 17, 2021
2 parents f2133ce + 0c521ee commit ac27357
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions minato_namikaze/bot_files/cogs/fun/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def __init__(self, bot):
def display_emoji(self) -> discord.PartialEmoji:
return discord.PartialEmoji(name="\N{NUMBER SIGN}\U000020e3")

def search_words(self, data: str) -> bool:
@staticmethod
def search_words(data: str) -> bool:
count = 0
try:
for char in data:
Expand Down Expand Up @@ -304,7 +305,8 @@ async def decode_braille(self, ctx: commands.Context, *, message: str) -> None:

await ctx.send(message[:2000])

def rot_encode(self, n: int, text: str) -> str:
@staticmethod
def rot_encode(n: int, text: str) -> str:
"""
https://stackoverflow.com/questions/47580337/short-rot-n-decode-function-in-python
"""
Expand Down
3 changes: 2 additions & 1 deletion minato_namikaze/bot_files/cogs/info/mysupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def __init__(self, bot):
def display_emoji(self) -> discord.PartialEmoji:
return discord.PartialEmoji(name="\N{SQUARED SOS}")

def format_commit(self, commit):
@staticmethod
def format_commit(commit):
short, _, _ = commit.message.partition("\n")
short_sha2 = commit.hex[0:6]
commit_tz = datetime.timezone(
Expand Down
3 changes: 2 additions & 1 deletion minato_namikaze/bot_files/cogs/info/snipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ async def on_message_edit(before, after):
def display_emoji(self) -> discord.PartialEmoji:
return discord.PartialEmoji(name="\N{DIRECT HIT}")

def sanitise(self, string):
@staticmethod
def sanitise(string):
if len(string) > 1024:
string = string[0:1021] + "..."
string = re.sub(invitere2, "[INVITE REDACTED]", string)
Expand Down
3 changes: 2 additions & 1 deletion minato_namikaze/bot_files/cogs/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ async def cog_check(self, ctx: commands.Context):

return True

def songembed(self, song):
@staticmethod
def songembed(song):
e = Embed()
e.set_thumbnail(url=song.thumbnail)
e.set_image(url=song.thumbnail)
Expand Down
3 changes: 2 additions & 1 deletion minato_namikaze/bot_files/lib/classes/games/typeracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class TypeRacer:
'night', 'real', 'life', 'few', 'north'
)

def _tr_img(self, text: str, font: str):
@staticmethod
def _tr_img(text: str, font: str):
text = "\n".join(textwrap.wrap(text, width=25))
height = ceil(len(text) / 25) * 70
image = Image.new("RGBA", (640, height), 0)
Expand Down

0 comments on commit ac27357

Please sign in to comment.