mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2026-01-28 01:06:18 +01:00
updated whois calls to use query
This commit is contained in:
@@ -24,9 +24,9 @@ class WhoisPlugin(Plugin):
|
||||
|
||||
async def execute(self, function_name, **kwargs) -> Dict:
|
||||
try:
|
||||
whois_result = whois.whois(kwargs['domain'])
|
||||
return whois_result
|
||||
except whois.parser.PywhoisError as e:
|
||||
return {'result': 'No such domain found'}
|
||||
whois_result = whois.query(kwargs['domain'])
|
||||
if whois_result is None:
|
||||
return {'result': 'No such domain found'}
|
||||
return whois_result.__dict__
|
||||
except Exception as e:
|
||||
return {'error': 'An unexpected error occurred: ' + str(e)}
|
||||
|
||||
Reference in New Issue
Block a user