Disable private msging with skynet

pull/2/head
Guillermo Rodriguez 2022-12-24 12:11:57 -03:00
parent ce5d847565
commit e2257b4fb5
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
1 changed files with 8 additions and 0 deletions

View File

@ -82,6 +82,10 @@ async def run_skynet_telegram(
@bot.message_handler(commands=['txt2img']) @bot.message_handler(commands=['txt2img'])
async def send_txt2img(message): async def send_txt2img(message):
chat = message.chat
if chat.type != 'group' and chat.id != GROUP_ID:
return
prompt = ' '.join(message.text.split(' ')[1:]) prompt = ' '.join(message.text.split(' ')[1:])
if len(prompt) == 0: if len(prompt) == 0:
@ -122,6 +126,10 @@ async def run_skynet_telegram(
@bot.message_handler(commands=['redo']) @bot.message_handler(commands=['redo'])
async def redo_txt2img(message): async def redo_txt2img(message):
chat = message.chat
if chat.type != 'group' and chat.id != GROUP_ID:
return
resp = await _rpc_call(message.from_user.id, 'redo') resp = await _rpc_call(message.from_user.id, 'redo')
resp_txt = '' resp_txt = ''