Skip to content
Open

Idk #23

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions Modules/Catdog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
from ubot import ldr

CAT_URL = 'http://api.thecatapi.com/v1/images/search'
DOG_URL = 'http://api.thedogapi.com/v1/images/search'
SHIBE_URL = 'http://shibe.online/api/shibes'
BIRD_URL = 'http://shibe.online/api/birds'
CAT_API_KEY = 'e5a56813-be40-481c-9c8a-a6585c37c1fe'
DOG_API_KEY = '105555df-5c50-40fe-bd59-d15a17ce1c2e'
CAT_HEADERS = {"x-api-key": CAT_API_KEY}
DOG_HEADERS = {"x-api-key": DOG_API_KEY}
IMGPARAM = {"mime_types": "jpg,png"}
GIFPARAM = {"mime_types": "gif"}
MIMGPARAM = {"mime_types": "jpg,png", "limit": 6}


async def neko_atsume(params):
async with ldr.aioclient.get(CAT_URL, params=params, headers=CAT_HEADERS) as response:
if response.status == 200:
neko = await response.json()
else:
neko = response.status

return neko


async def inu_atsume(params):
async with ldr.aioclient.get(DOG_URL, params=params, headers=DOG_HEADERS) as response:
if response.status == 200:
inu = await response.json()
else:
inu = response.status

return inu


async def shibe_inu_atsume():
async with ldr.aioclient.get(SHIBE_URL, params=None, headers=None) as response:
if response.status == 200:
shibe_inu = await response.json()
else:
shibe_inu = response.status

return shibe_inu


async def tori_atsume():
async with ldr.aioclient.get(BIRD_URL, params=None, headers=None) as response:
if response.status == 200:
tori = await response.json()
else:
tori = response.status

return tori


@ldr.add("shibe", help="Fetches an image of a shibe.")
async def shibe(event):
shibe_inu = await shibe_inu_atsume()

if isinstance(shibe_inu, int):
await event.reply(f"There was an error finding the shibes! :( -> {shibe_inu}")
return

await event.reply(file=shibe_inu[0])


@ldr.add("bird", help="Fetches an image of a bird.")
async def bird(event):
tori = await tori_atsume()

if isinstance(tori, int):
await event.reply(f"There was an error finding the birdies! :( -> {tori}")
return

await event.reply(file=tori[0])


@ldr.add_list(["cat", "pussy"], pattern_extra="(gif|)(f|)", help="Fetches an image of a cat.")
async def cat(event):
neko = await neko_atsume(GIFPARAM if event.other_args[0] else IMGPARAM)

if isinstance(neko, int):
await event.reply(f"There was an error finding the cats! :( -> {neko}")
return

await event.reply(file=neko[0]["url"], force_document=bool(event.other_args[1]))


@ldr.add_list(["dog", "bitch"], pattern_extra="(gif|)(f|)", help="Fetches an image of a dog.")
async def dog(event):
inu = await inu_atsume(GIFPARAM if event.other_args[0] else IMGPARAM)

if isinstance(inu, int):
await event.reply(f"There was an error finding the dogs! :( -> {inu}")
return

await event.reply(file=inu[0]["url"], force_document=bool(event.other_args[1]))


@ldr.add_inline_photo("cat", default="cat")
async def cat_inline(_):
return [neko["url"] for neko in await neko_atsume(MIMGPARAM)]


@ldr.add_inline_photo("dog", default="dog")
async def dog_inline(_):
return [inu["url"] for inu in await inu_atsume(MIMGPARAM)]
107 changes: 107 additions & 0 deletions Modules/CinderellaProBot/modules/Catdog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
from ubot import ldr

CAT_URL = 'http://api.thecatapi.com/v1/images/search'
DOG_URL = 'http://api.thedogapi.com/v1/images/search'
SHIBE_URL = 'http://shibe.online/api/shibes'
BIRD_URL = 'http://shibe.online/api/birds'
CAT_API_KEY = 'e5a56813-be40-481c-9c8a-a6585c37c1fe'
DOG_API_KEY = '105555df-5c50-40fe-bd59-d15a17ce1c2e'
CAT_HEADERS = {"x-api-key": CAT_API_KEY}
DOG_HEADERS = {"x-api-key": DOG_API_KEY}
IMGPARAM = {"mime_types": "jpg,png"}
GIFPARAM = {"mime_types": "gif"}
MIMGPARAM = {"mime_types": "jpg,png", "limit": 6}


async def neko_atsume(params):
async with ldr.aioclient.get(CAT_URL, params=params, headers=CAT_HEADERS) as response:
if response.status == 200:
neko = await response.json()
else:
neko = response.status

return neko


async def inu_atsume(params):
async with ldr.aioclient.get(DOG_URL, params=params, headers=DOG_HEADERS) as response:
if response.status == 200:
inu = await response.json()
else:
inu = response.status

return inu


async def shibe_inu_atsume():
async with ldr.aioclient.get(SHIBE_URL, params=None, headers=None) as response:
if response.status == 200:
shibe_inu = await response.json()
else:
shibe_inu = response.status

return shibe_inu


async def tori_atsume():
async with ldr.aioclient.get(BIRD_URL, params=None, headers=None) as response:
if response.status == 200:
tori = await response.json()
else:
tori = response.status

return tori


@ldr.add("shibe", help="Fetches an image of a shibe.")
async def shibe(event):
shibe_inu = await shibe_inu_atsume()

if isinstance(shibe_inu, int):
await event.reply(f"There was an error finding the shibes! :( -> {shibe_inu}")
return

await event.reply(file=shibe_inu[0])


@ldr.add("bird", help="Fetches an image of a bird.")
async def bird(event):
tori = await tori_atsume()

if isinstance(tori, int):
await event.reply(f"There was an error finding the birdies! :( -> {tori}")
return

await event.reply(file=tori[0])


@ldr.add_list(["cat", "pussy"], pattern_extra="(gif|)(f|)", help="Fetches an image of a cat.")
async def cat(event):
neko = await neko_atsume(GIFPARAM if event.other_args[0] else IMGPARAM)

if isinstance(neko, int):
await event.reply(f"There was an error finding the cats! :( -> {neko}")
return

await event.reply(file=neko[0]["url"], force_document=bool(event.other_args[1]))


@ldr.add_list(["dog", "bitch"], pattern_extra="(gif|)(f|)", help="Fetches an image of a dog.")
async def dog(event):
inu = await inu_atsume(GIFPARAM if event.other_args[0] else IMGPARAM)

if isinstance(inu, int):
await event.reply(f"There was an error finding the dogs! :( -> {inu}")
return

await event.reply(file=inu[0]["url"], force_document=bool(event.other_args[1]))


@ldr.add_inline_photo("cat", default="cat")
async def cat_inline(_):
return [neko["url"] for neko in await neko_atsume(MIMGPARAM)]


@ldr.add_inline_photo("dog", default="dog")
async def dog_inline(_):
return [inu["url"] for inu in await inu_atsume(MIMGPARAM)]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### @CinderellaProBot // http://www.telegram.dog/CinderellaProBot
> with HunterxHunter theme.
### @KenKaneki_Help_Bot // http://www.telegram.dog/KenKaneki_Help_Bot
> Made With Love.

[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.png?v=103)](https://github.com/ellerbrock/open-source-badges/)
[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](http://perso.crans.org/besson/LICENSE.html)
Expand All @@ -17,7 +17,7 @@ Modular Telegram bot for managing your groups with a extras features with Hunter
</p>

### Click Below Image to Deploy
[![Deploy](https://telegra.ph/file/511ad504656e712b88235.jpg)](https://heroku.com/deploy?template=https://github.com/Sur-vivor/CinderellaProBot.git)
[![Deploy](https://telegra.ph/file/9807388a596a3a2e6fe49.jpg)](https://heroku.com/deploy?template=https://github.com/nikhil34823482/CinderellaProBot.git)

### Configuration

Expand Down
16 changes: 8 additions & 8 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"GBAN_LOGS": {
"description": "Gban log channel, include the hyphen too: ex: -123456",
"required": false,
"value": ""
"value": "1130863968"
},
"ENV": {
"description": "Setting this to ANYTHING will enable environment variables.",
Expand All @@ -49,16 +49,16 @@
},
"OWNER_ID": {
"description": "Your user ID as an integer.",
"value": "1118936839"
"value": "1130863968"
},
"OWNER_NAME": {
"description": "Your Name",
"value": "✰Sᴀͥʀᴀͣᴛͫʜ™️✰"
"value": "✰NIKHIL✰"
},
"DEV_USERS": {
"description": "ID of users who are Dev (can use /py etc.)",
"required": false,
"value": "1118936839"
"value": "1130863968"
},
"CASH_API_KEY": {
"description": "Required for currency converter",
Expand Down Expand Up @@ -145,8 +145,8 @@
"cinderella"

],
"name": "Cinderella",
"repository": "https://github.com/Sur-vivor/CiderellaProBot",
"success_url": "https://telegram.dog/CinderellaProBot",
"logo": "https://telegra.ph/file/511ad504656e712b88235.jpg"
"name": "Kaneki Help Bot",
"repository": "https://github.com/nikhil34823482/CiderellaProBot",
"success_url": "https://telegram.dog/KenKaneki_Help_Bot",
"logo": "https://telegra.ph/file/9807388a596a3a2e6fe49.jpg"
}
8 changes: 4 additions & 4 deletions cinderella/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def vercheck() -> str:


SOURCE_STRING = """
⚡I'm built in python3, using the python-telegram-bot library, and am fully opensource - you can find what makes me tick [here](https://github.com/Sur-vivor/CinderellaProBot)
⚡You Can Clone Me [Here](https://heroku.com/deploy?template=https://github.com/Sur-vivor/CinderellaProBot.git)
⚡I'm built in python3, using the python-telegram-bot library, and am fully opensource - you can find what makes me tick [here](https://github.com/nikhil34823482/CinderellaProBot)
⚡You Can Clone Me [Here](https://heroku.com/deploy?template=https://github.com/nikhil34823482/CinderellaProBot.git)
"""


Expand Down Expand Up @@ -179,7 +179,7 @@ def send_start(bot, update):
first_name = update.effective_user.first_name
text = PM_START_TEXT

keyboard = [[InlineKeyboardButton(text="🤝Help",callback_data="help_back"),InlineKeyboardButton(text="🛡Creator🛡",url="https://t.me/Surv_ivor")]]
keyboard = [[InlineKeyboardButton(text="🤝Help",callback_data="help_back"),InlineKeyboardButton(text="🔥 Join Army 🔥",url="https://t.me/meow_Army")]]
keyboard += [[InlineKeyboardButton(text="🌐Connect Group", callback_data="main_connect"),InlineKeyboardButton(text="⚜️Add Me⚜️",url="t.me/{}?startgroup=true".format(bot.username))]]

update.effective_message.reply_photo(img, PM_START_TEXT.format(escape_markdown(first_name), escape_markdown(bot.first_name), OWNER_NAME, OWNER_ID),
Expand Down Expand Up @@ -281,7 +281,7 @@ def get_help(bot: Bot, update: Update):
update.effective_message.reply_text("Contact me in PM to get the list of possible commands.",
reply_markup=InlineKeyboardMarkup(
[[InlineKeyboardButton(text="⚜️Help",url="t.me/{}?start=help".format(bot.username))],
[InlineKeyboardButton(text="🛡Contact Creator",url="https://t.me/Surv_ivor")]]))
[InlineKeyboardButton(text="🔥 Join Army 🔥",url="https://t.me/Meow_Army")]]))
return

elif len(args) >= 2 and any(args[1].lower() == x for x in HELPABLE):
Expand Down