Skip to content

Commit 1546ba6

Browse files
committed
Update extensions functools.partial to enum.member
Modified as per FutureWarning
1 parent d42680f commit 1546ba6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

bot/exts/utils/extensions.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import functools
21
import typing as t
3-
from enum import Enum
2+
from enum import Enum, member
43

54
from discord import Colour, Embed
65
from discord.ext import commands
@@ -23,10 +22,9 @@
2322
class Action(Enum):
2423
"""Represents an action to perform on an extension."""
2524

26-
# Need to be partial otherwise they are considered to be function definitions.
27-
LOAD = functools.partial(Bot.load_extension)
28-
UNLOAD = functools.partial(Bot.unload_extension)
29-
RELOAD = functools.partial(Bot.reload_extension)
25+
LOAD = member(Bot.load_extension)
26+
UNLOAD = member(Bot.unload_extension)
27+
RELOAD = member(Bot.reload_extension)
3028

3129

3230
class Extensions(commands.Cog):

0 commit comments

Comments
 (0)