소스 검색

FUCK

pull/1/head
Rocketsoup 4 년 전
부모
커밋
588b79fa09
1개의 변경된 파일8개의 추가작업 그리고 8개의 파일을 삭제
  1. 8
    8
      cogs/base.py

+ 8
- 8
cogs/base.py 파일 보기

@@ -7,8 +7,8 @@ class BaseCog(commands.Cog):
7 7
 	def __init__(self, bot):
8 8
 		self.bot = bot
9 9
 
10
-	@staticmethod
11
-	def save_setting(guild: Guild, name: str, value):
10
+	@classmethod
11
+	def save_setting(cls, guild: Guild, name: str, value):
12 12
 		"""
13 13
 		Saves one value to a guild's persisted state. The given value must
14 14
 		be a JSON-encodable type.
@@ -22,8 +22,8 @@ class BaseCog(commands.Cog):
22 22
 			state[name] = value
23 23
 		Storage.save_guild_state(guild)
24 24
 
25
-	@staticmethod
26
-	async def warn(guild: Guild, message: str) -> bool:
25
+	@classmethod
26
+	async def warn(cls, guild: Guild, message: str) -> bool:
27 27
 		"""
28 28
 		Sends a warning message to the configured warning channel for the
29 29
 		given guild. If no warning channel is configured no action is taken.
@@ -33,15 +33,15 @@ class BaseCog(commands.Cog):
33 33
 		state: dict = Storage.state_for_guild(guild)
34 34
 		channel_id = state.get(StateKey.WARNING_CHANNEL_ID)
35 35
 		if channel_id is None:
36
-			guild_trace(guild, 'No warning channel set! No warning issued.')
36
+			cls.guild_trace(guild, 'No warning channel set! No warning issued.')
37 37
 			return False
38 38
 		channel: TextChannel = guild.get_channel(channel_id)
39 39
 		if channel is None:
40
-			guild_trace(guild, 'Configured warning channel no longer exists!')
40
+			cls.guild_trace(guild, 'Configured warning channel no longer exists!')
41 41
 			return False
42 42
 		message: Message = await channel.send(message)
43 43
 		return message is not None
44 44
 
45
-	@staticmethod
46
-	def guild_trace(guild: Guild, message: str) -> None:
45
+	@classmethod
46
+	def guild_trace(cls, guild: Guild, message: str) -> None:
47 47
 		print(f'[guild {guild.id}|{guild.name}] {message}')

Loading…
취소
저장