Untitled

mail@pastecode.io avatar
unknown
python
a year ago
17 kB
3
Indexable
Never
from pyrogram import Client, filters, idle, enums
from asyncio.exceptions import TimeoutError
import asyncio
import json
from pyrogram.errors import (
    ApiIdInvalid,
    PhoneNumberInvalid,
    PhoneCodeInvalid,
    PhoneCodeExpired,
    SessionPasswordNeeded,
    PasswordHashInvalid,
)
from pyrogram.errors.exceptions.bad_request_400 import ReactionInvalid
import pyromod.listen
from apscheduler.schedulers.asyncio import AsyncIOScheduler
import random ,requests
import time


API_ID = 3197282
API_HASH = "f132d14a0ed82df532405db9001db797"
TOKEN = "5817751855:AAHZBqu-uy1tRtDZqc7XjlHTRhfd9jw_4nE"
bot = Client("wuu", API_ID, API_HASH, bot_token = TOKEN)

with open("accounts.json") as f:
    receivers = json.load(f)["receiver"]
receiver = Client(f'{list(receivers.keys())[0]}', session_string=receivers[list(receivers.keys())[0]])
is_running = False
is_react = False
async def job3():
  global scheduler3
  with open("accounts.json") as f:
    accounts = json.load(f)
    topics = [44,3,4,5,53]
    nums = random.choice(list(accounts["Accs"].keys()))
    app = Client(name = "WithCodes", session_string = accounts["Accs"][nums])
    try:
      async with app:
        messages = [message async for message in app.get_chat_history("botlogrose")]
        message = random.choice(messages)
        await message.copy("wuuofficial", reply_to_message_id=random.choice(topics))
    except:
      pass
    interval = random.randint(30,90)
    #await bot.send_message("ixelizm", f"Bir sonraki gönderim {interval} dakika sonra")
    scheduler3.shutdown()
    scheduler3 = AsyncIOScheduler()
    scheduler3.add_job(job3, "interval", minutes=interval)
    scheduler3.start()
    
async def job():
  global scheduler
  with open("accounts.json") as f:
    accounts = json.load(f)
    topics = [44,3,4,5,53,1886,1879,1866,1888,1871,1869,1873,1882,1877]
    nums = random.choice(list(accounts["Accs"].keys()))
    app = Client(name = "WithCodes", session_string = accounts["Accs"][nums])
    try:
      async with app:
        messages = [message async for message in app.get_chat_history("botlogwuu")]
        message = random.choice(messages)
        await message.copy("wuuofficial", reply_to_message_id=random.choice(topics))
    except:
      pass
    interval = random.randint(60,240)
    #await bot.send_message("ixelizm", f"Bir sonraki gönderim {interval} dakika sonra")
    scheduler.shutdown()
    scheduler = AsyncIOScheduler()
    scheduler.add_job(job, "interval", minutes=interval)
    scheduler.start()
  
async def job2():
  messages = ["""💥 WUUTRADE MECHANISMS

< Play2Earn 
< Energy 
< Teams 
< Chat Room 
< Tournaments 
< Live Match 
< Public Rooms 
< Private Rooms
< Player v Player 
< Player v AI 
< Boost 
< Subscriptions
< Rewards 
< Wuunft 
< WuuAcademy 
< Wuucourses 
< Private courses 
< Sponsored courses 
< Exchange integrations 
< Tournament Sponsorship 
< Token

👆 These Among Other Inbuilt Features And Benefits 🔥.""",

"""📌 WUUTRADE ECOSYSTEM

Wuutrade Is Part Of The Wuuworlds Ecosystem that offers financial products and features Including Metaverse.""",

"""📌 PLAY2EARN = 

The Wuutrade Foundation Is To Educate And Encourage Users by Providing Earning Capacities And Special Bonuses which is present in each tournament and match, and that makes the ecosystem fair.""",

"""⚡ ENERGY = 

Energy is the user's match and tournament Tool. 1 energy is used for any match play, energy is refilled every 2-hours. Users can purchase, earn and win “Fast Refill” or “Energy Tanks” boosts, which shorten energy refill time or grant an extra Energy as applicable.""",

"""👥 TEAMS =

In Wuutrade Ecosystem, Teams  have a joint score, bonuses and perks based on the overall performance of each member. A Team Can create a Room To Invite Other Team Members, And Each Team Can Have a Maximum Of 10 Members. Statistics And Leaderboard will Be Available On The Platform.""",

"""🏡 CHATROOM = 

WuuTrade is also a social platform where users have access to public open chat rooms and can create private rooms to chat also about Wuutrade And Other Trending Topics.""",

"""🎮 TOURNAMENT =

Tournaments Are Community Challenges where users globally compete with each other for prizes and titles. There Are Several Stages in the tournaments where user challenge another to Advance to the next stage.

Types Of Tournaments

- Whizz Tournament (Daily) 
- Week-end Tournament (Weekly) 
- Wonder Tournament (Monthly) 

🚀 Our Version 1 Will Feature Only Whizz Tournaments. A User can participate in as many active tournaments as possible and each tournament reward.""",

"""🏆 LIVE-MATCH =

The Live Match Runs Live And Last Only 24hrs, The Live Match Will have 2 Entries :-

WUUT on The Web
WUUC on The Mobile App

The rewards will be distributed with the Matches Token and a User can Only Participate Only In one Active Live Match.""",

"""🏠 PUBLIC ROOMS =

Public Room Is an open match where anyone can attend and compete with any other user and can contain 10 participants per match. A User will spend 1 energy to create a public room And the winner is rewarded shortly after the match.""",

"""🏕 PRIVATE ROOMS =

Users Can Create Invitation Based Rooms To compete with each other or the AI. Private rooms are unlike Public rooms hidden from the public and are by invitation only.""",

"""🎮 PLAYER v PLAYER =

A User Can Create or join a PvP Match. This Match is a 1-1 Challenge between Players and the winner get Rewarded. The Winner Receives a free Energy Refill and other free boosts.""",

"""🤖 PLAYER v AI =

WuuTrade features artificial intelligence where a User can compete against AI to improve their skills and also excitement while playing to challenge the AI.""",

"""🚀 BOOSTS =

Boots Are Special Items Used to provide simulation-based perks. Boosts are not only simplifiers in decision making while running a simulation but are also a supplement to decision making. Users will earn boosts while participating in the tournaments or matches.""",

"""💰 SUBSCRIPTIONS =

Subscriptions are introduced to simplify the Usage of the platform, by learning and practicing Without being Limited. $Wuut Can Be Used for Subscriptions Ranging from the Least To the highest Package.
We Have 3 subscription plans available:-
- WUUKIE 
- WUUSTER 
- WUUXPERT 
Each Package Has its different features and bonuses.""",

"""🤝 REWARDS =

WuuDrop is WuuTrade's rewards mechanism.WuuDrop is distributed in a Live Match and a Tournament, contains a WuuNFT. Winners are also categorized into 3 levels based on the total number of Gems they hold upon the competition of a tournament.""",

"""🧙 WUUCOURSES =

Wuuworlds Team prepared Special courses for both amateurs and professionals so as to have a deep knowledge of the financial market ranging from :-
-Technical analysis
- Fundamental Analysis
- Blockchain And Cryptocurrency
More Courses will be added to the academy and all courses will have the WuuTrade's Logo.""",

"""😎 PRIVATE COURSES =

Private courses are well Analyzed by the Team before publishing, they are marked with the course providers logo and might Attract fees to access. They are courses attained from educational institutions and experts.""",

"""😊 SPONSORED COURSES =

These are free courses available in the academy provided by other entities like mentors, exchanges and brokers and they are often explanatory guidelines.""",

"""🏆 Tournaments Sponsorship =

WuuTrade In partnership with other entities who Sponsor and allocate prizes in tournaments will organize special tournaments. Sponsors logo and other promotional materials will be available at the venue of the event.""","""📍TOKEN =

$WUUT is WuuTrade platform’s native token deployed on the Ethereum network as an ERC-20 Standard token. WUUT is a utility token used for in-app purchases, transaction fees, voting, staking and cross-platform interactions within the WuuWorlds ecosystem. Staking rewards, referral rewards, bonuses and other perks are distributed to all users as WUUT. $WUUT will later be available on BNB Chain and Arbitrum."""]
  try:
    await bot.send_message("wuuofficial", random.choice(messages), reply_to_message_id=44)
  except:
    pass
  
scheduler = None
scheduler2 = AsyncIOScheduler()
scheduler2.add_job(job2, "interval", minutes = 90)
scheduler2.start()
scheduler3 = AsyncIOScheduler()
scheduler3.add_job(job3, "interval", minutes = 90)
scheduler3.start()

@bot.on_message(filters.command("react"))
async def commands(_,m):
  global is_react
  if is_react:
    is_react = False
    return await m.reply("Reaksiyon Gönderimi Kapatıldı!")
  is_react = True
  await m.reply("Reaksiyon Gönderimi Açıldı!")

@bot.on_message(filters.command("login") &filters.private)
async def loginFunc(_, m):
  phone= await bot.ask(
        m.from_user.id,
        "__Telefon Numarası:__\n**NOT:** __Numaranın Başında Alan Kodu Olmalıdır Ve Uygun Formatta Yazılmalıdır!__\n**Örneğin:** `+905554443322`",
    )
  phone = phone.text
  await m.reply("Kod Gönderiliyor...")
  client = Client(f"{phone}", API_ID, API_HASH, in_memory = True)
  await client.connect()
  try:
    code = await client.send_code(phone)
  except PhoneNumberInvalid:
    return await m.reply("Telefon Numarası Geçersiz. Lütfen Doğru Formatta Girdiğinizden Emin Olun!")
  try:
    code_msg = await bot.ask(
            m.from_user.id,
            "__Telegram Tarafından Gönderilen Kodu Giriniz__\n**NOT:** __Her Bir Rakamın Arasına 1 Boşluk Bırakınız!__\n**Örneğin:** `1 2 3 4 5`.",
            filters=filters.text,
            timeout=600,
        )
  except TimeoutError:
    await msg.reply(
      "__10 Dakika İçerisinde İşlem Yapılmadığı İçin İptal Ettim, Yeniden Başlamak İstiyorsan /login Komutunu Girmelisin!__",
        )
    return
  codestr = code_msg.text.replace(" ", "")
  try:
    await client.sign_in(phone, code.phone_code_hash, codestr)

  except PhoneCodeExpired:
    await m.reply(
            "Kodun Geçerliliği yitirilmiş, yeniden başlat!",
        )
    return
  except SessionPasswordNeeded:
    try:
      two_step_msg = await bot.ask(
                m.from_user.id,
                "şifreniz:",
                filters=filters.text,
                timeout=300,
            )
    except TimeoutError:
      await m.reply(
                "5 Dakika Süre Doldu!",
            )
      return
    try:
      password = two_step_msg.text
      await client.check_password(password=password)
    except PasswordHashInvalid:
      await two_step_msg.reply(
                "Şifre Yanlış!",
                quote=True,
            )
      return
    string_session = await client.export_session_string()
    try:
      me = await client.get_me()
      await m.reply(
          f"{me.mention} Hesabıyla Oturum Açma İşlemi Başarılı!"
      )
    except KeyError:
        pass
    await client.disconnect()
    with open("accounts.json", "r") as file:
      data = json.load(file)
      data["Accs"].update({phone: string_session})
    with open("accounts.json", "w") as file:
      json.dump(data, file, indent=2)

async def get_client():
  while True:
    try:
      async with app:
        me = await app.get_me()
      return app
    except:
      pass
@bot.on_message(filters.command("writer"))
async def on_func(_, m):
  global scheduler, is_running
  if not is_running:
    interval = int(m.text.split(" ")[1])
    await m.reply("Mesaj Yazma İşlemine Başladım!")
    scheduler = AsyncIOScheduler()
    scheduler.add_job(job, "interval", minutes=interval)
    scheduler.start()
    is_running = True
  else:
    await m.reply("Mesaj Yazma İşlemini Bitirdim!")
    scheduler.shutdown()
    is_running = False


#@bot.on_message(filters.photo)
#async def geet_photos(_,m):
#  emojis = ["😁","🤣","🤠","👍","🥳","🤩"]
#  opt = [True, False]
#  if random.choice(opt):
#    with open("accounts.json") as f:
#      accounts = json.load(f)
#      samples = random.sample(list(accounts["Accs"].keys()), random.randint(10,20))
#      print(len(samples))
#      for num in samples:
#        app = Client(name = "WithCodes", session_string = accounts["Accs"][num])
#        try:
#          async with app:
#            try:
#              emoji = random.randrange(0,len(emojis))
#              print(emoji)
#              await app.send_reaction(m.chat.id, m.id, emojis[emoji])
#              c = random.randint(1,10)
#              print(c, "wait")
#              await asyncio.sleep(c)
#            except ReactionInvalid:
#              continue
#        except:
#          pass
#@bot.on_message(filters.video)
#async def geet_videos(_,m):
#  emojis = ["😁","🤣","🤠","👍","🥳","🤩"]
#  opt = [True, False]
#  if random.choice(opt):
#    with open("accounts.json") as f:
#      accounts = json.load(f)
#      samples = random.sample(list(accounts["Accs"].keys()), random.randint(10,20))
#      print(len(samples))
#      for num in samples:
#        app = Client(name = "WithCodes", session_string = accounts["Accs"][num])
#        try:
#          async with app:
#            try:
#              emoji = random.randrange(0,len(emojis))
#              print(emoji)
#              await app.send_reaction(m.chat.id, m.id, emojis[emoji])
#              c = random.randint(1,10)
#              print(c, "wait")
#              await asyncio.sleep(c)
#            except ReactionInvalid:
#              continue
#        except:
#          pass

@bot.on_message(filters.sticker)
async def geet_stickers(_,m):
  emojis = ["😁","🤣","🤠","👍","🥳","🤩"]
  opt = [True, False]
  
  if random.choice(opt):
    with open("accounts.json") as f:
      accounts = json.load(f)
      samples = random.sample(list(accounts["Accs"].keys()), random.randint(10,20))
      print(len(samples))
      for num in samples:
        app = Client(name = "WithCodes", session_string = accounts["Accs"][num])
        try:
          async with app:
            try:
              emoji = random.randrange(0,len(emojis))
              print(emoji)
              await app.send_reaction(m.chat.id, m.id, emojis[emoji])
              c = random.randint(1,10)
              print(c, "wait")
              await asyncio.sleep(c)
            except ReactionInvalid:
              continue
        except:
          pass
@bot.on_message(filters.animation)
async def geet_gifs(_,m):
  emojis = ["😁","🤣","🤠","👍","🥳","🤩"]
  opt = [True, False]
  if random.choice(opt):
    with open("accounts.json") as f:
      accounts = json.load(f)
      samples = random.sample(list(accounts["Accs"].keys()), random.randint(10,20))
      print(len(samples))
      for num in samples:
        app = Client(name = "WithCodes", session_string = accounts["Accs"][num])
        try:
          async with app:
            try:
              emoji = random.randrange(0,len(emojis))
              print(emoji)
              await app.send_reaction(m.chat.id, m.id, emojis[emoji])
              c = random.randint(1,10)
              print(c, "wait")
              await asyncio.sleep(c)
            except ReactionInvalid:
              continue
        except:
          pass
@receiver.on_message()
async def get_recv(_,m):
  emojis = ["👍", "🥰","🔥", "🙏", "💯", "❤"]
  if m.chat.id in [-1001412392885, -1001916419828] and m.from_user.id in [5969557325, 1310308056, 1049659940, 619121650, 489060157, 5913176331, 6217136705] and is_react:
    with open("accounts.json") as f:
      accounts = json.load(f)
      for num in accounts["Accs"].keys():
        app = Client(name = "WithCodes", session_string = accounts["Accs"][num])
        try:
          async with app:
            try:
              emoji = random.randrange(0,len(emojis))
              print(emojis[emoji])
              await app.send_reaction(m.chat.id, m.id, emojis[emoji])
              c = random.randint(1,10)
              print(c, "wait")
              await asyncio.sleep(c)
            except ReactionInvalid:
              continue
        except:
          print(num, "unauth")
          continue

if __name__ == "__main__":
  bot.start()
  receiver.start()
  print("aktif")
  idle()