Use a group chat for logging
This commit is contained in:
parent
025fb615fc
commit
7ba241e1ad
8
install
8
install
@ -5,8 +5,16 @@ mkconfig(){
|
|||||||
echo "Please get your credentials from https://my.telegram.org."
|
echo "Please get your credentials from https://my.telegram.org."
|
||||||
read -p "App API ID (api_id): " api_id
|
read -p "App API ID (api_id): " api_id
|
||||||
read -p "App API hash (api_hash): " api_hash
|
read -p "App API hash (api_hash): " api_hash
|
||||||
|
read -p "Do you wish to use a log chat? (y/n): " logrpl
|
||||||
|
if [ "$logrpl" = "y" ]
|
||||||
|
then
|
||||||
|
read -p "Log chat ID (logchat): " logchat
|
||||||
|
else
|
||||||
|
logchat="'me'"
|
||||||
|
fi
|
||||||
echo "api_id = $api_id" >> config.py
|
echo "api_id = $api_id" >> config.py
|
||||||
echo "api_hash = '$api_hash'" >> config.py
|
echo "api_hash = '$api_hash'" >> config.py
|
||||||
|
echo "logchat = $logchat" >> config.py
|
||||||
}
|
}
|
||||||
|
|
||||||
# Preliminary sanity checks
|
# Preliminary sanity checks
|
||||||
|
4
ubot.py
4
ubot.py
@ -83,7 +83,7 @@ async def edit(event):
|
|||||||
await msgs.delete()
|
await msgs.delete()
|
||||||
|
|
||||||
rpl = "Purge complete! Purged " + str(count) + " messages."
|
rpl = "Purge complete! Purged " + str(count) + " messages."
|
||||||
await client.send_message('me', rpl)
|
await client.send_message(logchat, rpl)
|
||||||
|
|
||||||
if msg.startswith('.sh'):
|
if msg.startswith('.sh'):
|
||||||
if event.is_channel and not event.is_group:
|
if event.is_channel and not event.is_group:
|
||||||
@ -91,7 +91,7 @@ async def edit(event):
|
|||||||
rpl = f'Someone attempted to execute a command on a channel.\n'
|
rpl = f'Someone attempted to execute a command on a channel.\n'
|
||||||
rpl += f'Message: `{msg}`\n'
|
rpl += f'Message: `{msg}`\n'
|
||||||
rpl += f'Execution aborted.\n'
|
rpl += f'Execution aborted.\n'
|
||||||
await client.send_message('me', rpl)
|
await client.send_message(logchat, rpl)
|
||||||
return
|
return
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
Loading…
x
Reference in New Issue
Block a user