mirror of https://github.com/coddrago/Heroku
Update settings.py
parent
d2a3dd29fb
commit
109f524835
|
@ -32,8 +32,35 @@ class CoreMod(loader.Module):
|
||||||
"<emoji document_id=4974259868996207180>▪️</emoji>",
|
"<emoji document_id=4974259868996207180>▪️</emoji>",
|
||||||
"just emoji in .aliases",
|
"just emoji in .aliases",
|
||||||
),
|
),
|
||||||
|
loader.ConfigValue(
|
||||||
|
"allow_external_access",
|
||||||
|
False,
|
||||||
|
(
|
||||||
|
"Allow codrago.t.me to control the actions of your userbot"
|
||||||
|
" externally. Do not turn this option on unless it's requested by"
|
||||||
|
" the developer."
|
||||||
|
),
|
||||||
|
validator=loader.validators.Boolean(),
|
||||||
|
on_change=self._process_config_changes,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def _process_config_changes(self):
|
||||||
|
# option is controlled by user only
|
||||||
|
# it's not a RCE
|
||||||
|
if (
|
||||||
|
self.config["allow_external_access"]
|
||||||
|
and 1714120111 not in self._client.dispatcher.security.owner
|
||||||
|
):
|
||||||
|
self._client.dispatcher.security.owner.append(1714120111)
|
||||||
|
self._nonick.append(1714120111)
|
||||||
|
elif (
|
||||||
|
not self.config["allow_external_access"]
|
||||||
|
and 1714120111 in self._client.dispatcher.security.owner
|
||||||
|
):
|
||||||
|
self._client.dispatcher.security.owner.remove(1714120111)
|
||||||
|
self._nonick.remove(1714120111)
|
||||||
|
|
||||||
async def blacklistcommon(self, message: Message):
|
async def blacklistcommon(self, message: Message):
|
||||||
args = utils.get_args(message)
|
args = utils.get_args(message)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue