File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ async def insert(
105
105
phrase ,
106
106
punishment ,
107
107
log_channel_id
108
- ) -> None :
108
+ ) -> int :
109
109
r"""
110
110
Insert a new BanPhrase into the database and cache.
111
111
@@ -120,7 +120,8 @@ async def insert(
120
120
log_channel_id: int
121
121
Channel to send log messages to
122
122
123
- :returns: None
123
+ :returns: int
124
+ Phrase ID
124
125
"""
125
126
callback = await internal_insert (
126
127
request = {
@@ -133,6 +134,14 @@ async def insert(
133
134
}
134
135
)
135
136
137
+ results = callback .response .get ("results" )
138
+ if not results :
139
+ return False
140
+
141
+ phrase_id = results ["addbanphrase" ]
142
+ await BanPhrase .fetch (phrase_id ) # add object to cache.
143
+
144
+
136
145
@staticmethod
137
146
async def get (phrase_id : int , fetch = True ):
138
147
"""Get a BanPhrase object.
You can’t perform that action at this time.
0 commit comments