Nandha Bot's Channel
1.47K subscribers
101 photos
50 videos
15 files
171 links
🗣️ Discussion Group - @NandhaSupport
📢 Network Channel - @NandhaNetwork
🛒 Market Shop - @NandhaMarket

Owner: @Nandha

ℹ️ GitHub Account:
https://github.com/nandhaxd

ℹ️ GitHub Organization: https://github.com/Nandhabots
Download Telegram
Nandha Bot's Channel
Photo
This feature swapped to /gojo /ask commands
import aiohttp


class Gemini:
def __init__(self, api_key: str):
self.api_key = api_key

async def ask(self, prompt: str, file: dict = {}) -> dict:
async with aiohttp.ClientSession() as session:
payload = {}
payload["contents"] = []
if file:
file_uri = file["file"]["uri"]
payload["contents"].append(
{
"role": "user",
"parts": [
{
"fileData": {
"fileUri": file_uri,
"mimeType": "image/jpeg"
}
},
{
"text": prompt
}
]
}
)
else:
payload["contents"].append(
{
"role": "user",
"parts": [
{
"text": prompt
}
]
}
)
payload["generationConfig"] = {
"temperature": 0.9,
"topK": 40,
"topP": 0.95,
"maxOutputTokens": 1024,
"responseMimeType": "text/plain"
}
async with session.post(f"https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-8b-exp-0924:generateContent?key={self.api_key}", headers={"Content-Type": "application/json"}, json=payload) as response:
try:
results = await response.json()
return results
except Exception as e:
return {"error": str(e)}

async def upload_image(self, path: str) -> dict:
with open(path, "rb") as file:
async with aiohttp.ClientSession() as session:
payload = {"file": file}
async with session.post(f"https://generativelanguage.googleapis.com/upload/v1beta/files?key={self.api_key}", data=payload) as response:
try:
return await response.json()
except Exception as e:
return {"error": str(e)}
os.remove(path)


⚔️ Get your API key:
https://aistudio.google.com/app/apikey


👨‍💻 For Example:
Use @GojoAssistantBot /gemini or /google cmd replaced old model with official api


#gojoai #gemini #gojoassistant

@NandhaBots
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
☀️ ☀️ "victory of light over darkness, good over evil, and knowledge over ignorance" — Happy Diwali 🎆 🎆.
Please open Telegram to view this post
VIEW IN TELEGRAM
👍2
Celebrate Diwali with Joy!
Happy Diwali! 🪔 Checkout This Link:-
https://kishoredxd.vercel.app/
👍3
This media is not supported in your browser
VIEW IN TELEGRAM
who won ? ☠️ In by quantity we're small but by quality we're ...
This media is not supported in your browser
VIEW IN TELEGRAM
Now anime search available in our boy @gojoAssistantBot 🌟

Example:
/anime silent voice
Please open Telegram to view this post
VIEW IN TELEGRAM
1👍1
Forwarded from BotNews
Bot API 7.11

Bots can now participate in revenue sharing from Telegram Ads ⭐️ – unlocking a new way to help support their development.
Introduced Paid Broadcasts ⭐️ – allowing bots to broadcast up to 1000 messages per second.

Bots can now send and receive chat-specific hashtags that only show posts and stories from a specific chat when tapped.
Added a new inline button to let users copy text in one tap.
Bots can now add media to existing text messages.

And more, see the full changelog for details:

https://core.telegram.org/bots/api-changelog#october-31-2024

⚠️ Warning: Starting December 1, 2024 messages with video posted in big communities can be delayed by the server until the respective video is reencoded. Read more here.
Please open Telegram to view this post
VIEW IN TELEGRAM
1
Please open Telegram to view this post
VIEW IN TELEGRAM
Nandha Bot's Channel
🤔 That's a real W.
import requests
import json

token = ""
message_id = ...
chat_id = ...

url = f"https://api.telegram.org/bot{token}/editMessageMedia"

payload = {
"chat_id": chat_id,
"message_id": message_id,
"media": json.dumps({
"type": "photo",
"media": "" # file id or url
})
}

response = requests.post(url, data=payload)
print(response.json())
Satoru Gojo ("⁧;⁧(⁧"⁧
Message
It is little frustrating but we have shifted gojo to another AI. 👍
Please open Telegram to view this post
VIEW IN TELEGRAM
—> Stalk Instagram profile using @gojoAssistantBot

Command:
/iguser darlingonelife
3
Added support for download Facebook video. plus morse encode & deocde

Example:
/fbdl video link
/morse: reply to text
/morsed: reply to morse text
1👍1
Added /pinterest and /pinvideo for pinterest search image & video plus downloads. #gojoAssistantBot

Example:
/pinvideo gojo edits
/pinterest gojo profile


pinterest video command updated
👍1
async def get_trendings(country: str):
base_url = "https://getdaytrends.com"
url = base_url + f'/{country}'
headers = {"user-agent": get_ua()}

# func for extract data from table
def get_result(data):
tags = data.table.find_all('tr')
results = []
for tr in tags:
src = tr.td
title = src.get_text()
link = base_url + src.a.get('href')
results.append({'title': title, 'url': link})
return results

async with aiohttp.ClientSession() as session:
try:
async with session.get(url, headers=headers) as response:
if response.status != 200:
return {'error': response.reason}
content = await response.text()
soup = BeautifulSoup(content, 'html.parser')
tables = soup.select("div[class^='inset']")
return {
'now_hashtags': get_result(tables[0]),
'today_hashtags': get_result(tables[1]),
'top_hashtags': get_result(tables[2])
}

except Exception as e:
return {'error': str(e)}

Scrapper for get top tweets tags that are trending now, today, and top in a country #NandhaBots
👍1
+ Added custom welcome message module for #gojoAssistant for more detailed info use /help welcome

Moreover if custom welcome haven't set the default welcome will come instead.
👍1