Пример #1
0
 def detect_post(self):
     hook = Webhook(self.hook)
     embed = Embed(description='New post detected.',
                   color=0x5CDBF0,
                   timestamp='now')
     embed.set_author(name='Instagram Monitor')
     embed.add_field(
         name='User',
         value=f"[{self.user}](https://www.instagram.com/{self.user})",
         inline=False)
     embed.add_field(name='Link',
                     value=f"https://www.instagram.com/p/{self.post_url}/",
                     inline=False)
     embed.set_thumbnail(self.profile_pic_link)
     if self.post_caption:
         embed.add_field(name='Caption',
                         value=self.post_caption,
                         inline=False)
     else:
         embed.add_field(name='Caption',
                         value="\u274C No caption",
                         inline=False)
     if len(self.post_image) == 1:
         embed.set_image(self.post_image[0])
         hook.send(embed=embed)
     else:
         embed.set_image(self.post_image[0])
         hook.send(embed=embed)
         for i in range(1, len(self.post_image)):
             embed = Embed(description=f"{i+1}/{len(self.post_image)}",
                           color=0x5CDBF0,
                           timestamp='now')
             embed.set_image(self.post_image[i])
             hook.send(embed=embed)
Пример #2
0
def sendHooks(value, type, link):
    stock = (value / 25)
    amount = math.floor(stock)
    if amount != 0:
        hook = Webhook(
            'https://discordapp.com/api/webhooks/704560730749272064/jFr8w0aP5gxOZL0ImAJb53F94xWAxfezRk3cyD3Y9E0msBPSFwQSv_PpqR-g4XV3pupx'
        )

        embed = Embed(
            #description='Oculus proxies restocked ' + str(numpacks) + " packs of " + type,
            color=0x5CDBF0,
            timestamp='now'  # sets the timestamp to current time
        )

        image1 = 'https://pbs.twimg.com/profile_images/1000760087546392576/UJBqUta8.jpg'
        image2 = 'https://pbs.twimg.com/profile_images/1000760087546392576/UJBqUta8.jpg'

        embed.set_author(name='Oculus Proxies Restock\n-->CLICK ME<--',
                         icon_url=image1,
                         url=link)
        embed.add_field(name='Type', value=type)
        embed.add_field(name='Amount\n(sold in 25x)', value=str(amount))
        embed.set_footer(text='Made by @thecanoechief', icon_url=image1)

        embed.set_thumbnail(image1)
        embed.set_image(image2)

        hook.send("@everyone", embed=embed)
        print("Restock found for " + type + "\nWebhook executed")
        time.sleep(0.5)
Пример #3
0
def restrict(fro, chan, message):
	# Get parameters
	for i in message:
		i = i.lower()
	target = message[0]
	reason = ' '.join(message[1:])

	# Make sure the user exists
	targetUserID = userUtils.getIDSafe(target)
	username = chat.fixUsernameForBancho(fro)
	userID = userUtils.getID(fro)
	if not targetUserID:
		return "{}: user not found".format(target)

	if targetUserID < 1002 and userID > 1002:
		log.enjuu("{} attempted to restrict immortal user {}.".format(username, targetUserID), discord="cm")
		return "Nice try."
		
	if not reason:
			reason = "not avialable"

	# Put this user in restricted mode
	userUtils.restrict(targetUserID)

	# Send restricted mode packet to this user if he's online
	targetToken = glob.tokens.getTokenFromUsername(userUtils.safeUsername(target), safe=True)
	if targetToken is not None:
		targetToken.setRestricted()

	log.rap(userID, "has restricted {} ({}) for: {}".format(target, targetUserID, reason), True)
	
	hook = Webhook(glob.conf.config["discord"]["webhook"])

	embed = Embed(
		description='',
		color=0x1e0f3,
		timestamp='now'  # sets the timestamp to current time
    )

	avatar = "https://a.enjuu.click/"

	embed.set_author(name='Restriction', icon_url="https://a.enjuu.click/{}".format(targetUserID))
	embed.add_field(name='Username', value="{}".format(target))
	embed.add_field(name='Reason', value="{}".format(reason))
	embed.set_footer(text="Restricted by {}".format(username))

	embed.set_thumbnail("https://a.enjuu.click/{}".format(targetUserID))

	hook.send(embed=embed)
	
	return "{} has been restricted for {}".format(target, reason)
Пример #4
0
def post_message(product_link, product_image, product_name, product_price,
                 instock_list):
    hook = Webhook(hook_url)
    embed = Embed(description='', color=0x5CDBF0, timestamp='now')
    embed.set_title(title=product_name, url=product_link)
    embed.add_field(name='Price', value=product_price)
    embed.add_field(name='Stock', value='\n'.join(instock_list))
    embed.set_thumbnail(url=product_image)
    embed.set_footer(
        text='Ssense Monitor by zyx',
        icon_url=
        'https://pbs.twimg.com/profile_images/1118878674642714624/lNXTIWNT_400x400.jpg'
    )
    hook.send(embed=embed)
 def send_hook(url_, name_, price_, _avail):
     embed = Embed(
         description="A restock has Occurred",
         timestamp='now'
     )
     url = url_
     image1 = "https://i.imgur.com/pUhfYFF.png"
     embed.set_author(name="Stock Alert!", icon_url="https://i.imgur.com/YCOZANm.png")
     embed.add_field(name="Amazon" + " Has Restocked", value=name_)
     embed.add_field(name="Price", value=price_)
     embed.add_field(name="Availability", value=_avail)
     embed.set_footer(text="SET TO YOUR LINK!", icon_url=image1)
     embed.set_thumbnail(image1)
     embed.set_image("https://bgr.com/wp-content/uploads/2020/09/amazon-logo-sign.jpg?quality=70&strip=all&w=640&h=500&crop=1")
     hook.send(embed=embed)
Пример #6
0
def post_discord(purl, title, price, image, available_sizes):
    hook = Webhook(webhook_url)
    embed = Embed(description='', color=0x5CDBF0, timestamp='now')
    embed.set_author(name='Custom Shopify Monitor', icon_url='')
    embed.set_title(title=title, url=purl)
    embed.set_footer(
        text='@zyx898',
        icon_url=
        'https://pbs.twimg.com/profile_images/1201960848073383937/XzQhFIiM_400x400.jpg'
    )
    embed.add_field(name='Link', value=purl, inline=True)
    embed.add_field(name='Stock',
                    value=" | ".join(available_sizes),
                    inline=False)
    embed.set_thumbnail(image)
    hook.send(embed=embed)
Пример #7
0
 def detect_bio(self):
     hook = Webhook(self.hook)
     embed = Embed(description='New bio detected.',
                   color=0x5CDBF0,
                   timestamp='now')
     embed.set_title('Instagram Monitor')
     embed.add_field(
         name='User',
         value=f"[{self.user}](https://www.instagram.com/{self.user})",
         inline=False)
     if self.bio:
         embed.add_field(name='Bio', value=self.bio, inline=False)
     else:
         embed.add_field(name='Bio', value="\u274C Empty Bio", inline=False)
     embed.set_thumbnail(self.profile_pic_link)
     hook.send(embed=embed)
Пример #8
0
def main():
    # Send message to Discord

    icon = "https://cdn4.iconfinder.com/data/icons/logos-and-brands/512/253_Phabricator_logo-128.png"

    if PHIDTYPE == "TASK":
        embed = Embed(
            title=f"{Conduit.fullname()}",
            url=f"{Conduit.url()}",
            color=0x6E5CB6,
            timestamp="now",
        )
        embed.set_author(name=f"{Conduit.user()}")
        embed.add_field(name="Status", value=f"{Conduit.task_status()}")
        embed.add_field(name="Priority", value=f"{Conduit.task_priority()}")

    if PHIDTYPE == "CMIT":
        embed = Embed(
            title=f"{Conduit.repo_fullname()}",
            description=f"{Conduit.fullname()}",
            url=f"{Conduit.url()}",
            color=0x6E5CB6,
            timestamp="now",
        )
        embed.set_author(name=f"{Conduit.repo_author()}")
        embed.add_field(name="Status", value=f"{Conduit.status()}")

    if PHIDTYPE == "DREV":
        embed = Embed(
            title=f"{Conduit.fullname()}",
            url=f"{Conduit.url()}",
            color=0x6E5CB6,
            timestamp="now",
        )
        embed.set_author(name=f"{Conduit.user()}")
        embed.add_field(name="Status", value=f"{Conduit.status()}")

    embed.set_footer(text=f"{Conduit.typename()}")
    embed.set_thumbnail(icon)

    if DISCORD_ENABLE:
        hook.send(embed=embed)

    # Save to json for website
    activity = embed.to_dict()
    activitySave(activity)
    activityClean()
Пример #9
0
async def on_message(message):
    if message.author == client.user:
        return
    if int(message.channel.id) != 782648561031446550:
        return

    #if message.channel.id == "782648561031446550"
    #calculation function with course
    if message.content.startswith('$help'):
        print(message.author.id)
        await message.channel.send("Hi")

    if message.content.startswith('$calc'):
        usertxt = message.content.split(" ")

        try:
            if usertxt[1] == "c":
                await message.channel.send(create_course())
            else:
                price = float(usertxt[1])
                await message.channel.send(create_price(price))
        except:
            await message.channel.send(
                'Неправильно задана команда или параметр!')

    if message.content.startswith('$atc'):
        try:
            usertxt = message.content.split(" ")
            link = usertxt[1]
            product_info = create_atc(link)
            embed = Embed(
                description='Your **ATC** is created! :smiley:',
                color=0x5CDBF0,
                timestamp='now')  # sets the timestamp to current time
            image1 = product_info[1]
            embed.set_author(name=product_info[0])
            embed.add_field(name='ATC', value=product_info[2])
            print(product_info[2])
            embed.add_field(name='ATC', value=product_info[3])
            embed.add_field(name='ATC', value=product_info[4])
            embed.set_footer(text='Suck AIO v1.0')
            embed.set_thumbnail(image1)
            hook.send(embed=embed)
        except:
            await message.channel.send(
                "Неправильно задана команда или параметр!")
Пример #10
0
    def tune_embed_message(self):
        embed = Embed(
            description='不定期更新! :poop:',
            color=0x1e0f3,
            timestamp='now'  # sets the timestamp to current time
        )

        image0 = 'https://i.imgur.com/rdm3W9t.png'
        image1 = 'https://tw.beanfun.com/maplestory/image/Board/category/72.gif'

        embed.set_author(name='近期活動公告', icon_url=image0)
        for ele in self.anno_dict.keys():
            embed.add_field(name=ele, value=self.anno_dict[ele])
        #embed.set_footer(text='Here is my footer text', icon_url=image1)

        embed.set_thumbnail(image1)
        embed.set_image(self.bottom_image)
        return embed
Пример #11
0
def embed_from_listing(listing):
    """ Create a dhooks embed from a listing. Expects the listings to already be serialized. """

    listing_type = listing['type']
    listing_type = f"{listing_type[0].upper()}{listing_type[1:]}"
    title_text = f"{listing_type} reported in /r/DallasStars"

    # the resultant embed itself
    result = Embed(title=title_text,
                   color=embed_color,
                   url=listing['permalink'],
                   timestamp=listing['timestamp'])

    # author
    result.set_author(name=f"/u/{listing['author']['name']}",
                      url=f"https://reddit.com/u/{listing['author']['name']}",
                      icon_url=listing['author']['icon_img'])

    # content field
    content_field = build_content_field(listing)
    result.add_field(**content_field)

    # mod reports field
    if len(listing['mod_reports']) > 0:
        result.add_field(**(
            build_reports_field(listing['mod_reports'], name="Mod Reports")))

    # user reports field
    if len(listing['user_reports']) > 0:
        result.add_field(**(
            build_reports_field(listing['user_reports'], name="User Reports")))

    # author field
    result.add_field(
        **(build_author_field(listing['author'], listing_type=listing_type)))

    # footer
    result.set_footer(text=footer_text, icon_url=footer_icon)

    # thumbnail - reddit icon
    result.set_thumbnail(reddit_icon)

    return result
Пример #12
0
def SendHook(name, price, productUrl, image, proid, status):
    client = Webhook(
        "https://discordapp.com/api/webhooks/565625299753107471/0pe8umQLMBUXs96J8y2u7SwhkKD2r4HLunl1LCWQ06e1K8wisS2BDoFm18I9RYsl-YfR"
    )
    global embed1
    embed1 = Embed()
    #embed1.color = None
    embed1.set_title(title=name, url=productUrl)
    embed1.set_thumbnail(image)
    embed1.add_field(name="Status", value=str(status), inline=True)
    embed1.add_field(name="Product URL", value=productUrl, inline=False)
    embed1.add_field(name="PID", value=proid, inline=True)
    embed1.add_field(name="Price", value=price)
    embed1.set_footer(
        text=f"jdrez • {str(datetime.datetime.now())}",
        icon_url=
        "https://cdn.discordapp.com/attachments/553047247466790924/565625485799850141/favicon-192x192.png"
    )
    client.send(embeds=[embed1])
Пример #13
0
def SendHook(name, price, productUrl, image, proid, status):
    client = Webhook(
        "https://discordapp.com/api/webhooks/565627801072435232/-PqcddPV0FG3mGucvU__zpTSPlcdC12MQ9kq_3X0QJW5DwwFKT6htY9-qtq_QEtYwz0t"
    )
    global embed1
    embed1 = Embed()
    #embed1.color = None
    embed1.set_title(title=name, url=productUrl)
    embed1.set_thumbnail(image)
    embed1.add_field(name="Status", value=str(status), inline=True)
    embed1.add_field(name="Product URL", value=productUrl, inline=False)
    embed1.add_field(name="PID", value=proid, inline=True)
    embed1.add_field(name="Price", value=price)
    embed1.set_footer(
        text=f"jdrez • {str(datetime.datetime.now())}",
        icon_url=
        "https://cdn.discordapp.com/attachments/553047247466790924/565627921344102431/porter.jpg"
    )
    client.send(embeds=[embed1])
Пример #14
0
def send_product(webhook, store, product_info):

    # Sends ATC links for variants as a Discord message.

    hook = Webhook(webhook)
    embed = Embed(color=0x5CDBF0,
                  title=product_info["title"],
                  url=f"https://{store}/products/{product_info['handle']}",
                  timestamp="now")
    embed.set_author(name=store)
    if "image" in product_info:
        embed.set_thumbnail(product_info["image"])
    for variant in product_info["variants"]:
        if variant["available"]:
            embed.add_field(
                name=f"{variant['title']} - ${variant['price']}",
                value=f"[ATC](https://{store}/cart/{variant['id']}:1)",
                inline=False)
    hook.send(embed=embed)
Пример #15
0
 def detect_private(self):
     hook = Webhook(self.hook)
     if self.private:
         desc = "Profile changed to private."
     elif not self.private:
         desc = "Profile changed to public."
     else:
         self.log.error("Privacy was never set.")
     embed = Embed(description="Privacy change detected.",
                   color=0x5CDBF0,
                   timestamp='now')
     embed.set_author(name='Instagram Monitor')
     embed.add_field(
         name='User',
         value=f"[{self.user}](https://www.instagram.com/{self.user})",
         inline=False)
     embed.add_field(name='Status', value=desc, inline=False)
     embed.set_thumbnail(self.profile_pic_link)
     hook.send(embed=embed)
Пример #16
0
def webhook(discordWebhook, instagramUrl, newValue, changeType,
            instagramUsername):
    try:
        hook = Webhook(discordWebhook)
        embed = Embed(
            description=f"{changeType} Change - @{instagramUsername}",
            color=0XFFA574,
            timestamp='now',
        )
        embed.add_field(name='Profile Link', value=instagramUrl, inline=True)
        embed.add_field(name='New Update', value=newValue, inline=False)
        embed.set_author(name='Instagran Monitor')
        embed.set_footer(text='@suprattle')
        try:
            embed.set_thumbnail(instagramProfileImage)
            hook.send(embed=embed)
        except:
            hook.send(embed=embed)
    except:
        pass
Пример #17
0
def post_to_discord(product_pid):
    f****d = False
    while not f****d:
        proxy_picked = proxyhandler.proxy()
        try:
            productz, _product_styles, _item_url, url, price = products.get_info(product_pid, proxy_picked)
            price = int(price) / 100
            for x in productz:
                product = x.split('@')
                name = product[0]
                image = product[1]
                stock = product[2]
                eve_qt = 'http://remote.eve-backend.net/api/quick_task?link=' + url
                parsed_uri = urlparse(url)
                result = '{uri.netloc}'.format(uri=parsed_uri)
                with open('webhook.json') as json_file:
                    json_dump = json.load(json_file)
                    for site_name in json_dump:
                        if site_name in result:
                            webhookz = json_dump[site_name]['webhook']
                            embed = Embed()
                            for webhook in webhookz:
                                print(name, image, price)
                                client = Webhook(webhook)
                                embed.description = f'[{name}]({url})'
                                embed.add_field(name='Stock',value=stock)
                                embed.add_field(name='Price',value=f'${price}')
                                embed.add_field(name='Notification Type', value=f'New')
                                embed.add_field(name='Quick Tasks', value=f'[EVE]({eve_qt})',inline='false')
                                embed.set_thumbnail(image)
                                embed.set_footer(text=f'Supreme Monitor by @TaquitoSlayer')
                                client.send(embeds=[embed])
                                embed.fields.clear()
                                f****d = True
        except Exception as e:
            logging.info(f'{url.upper()} SOMETHING WRONG - SLEEPING FOR {delay} SECONDS')
            logging.info(f'{e}')
            time.sleep(float(delay))
            pass
Пример #18
0
def send_discord(product, webhooks_url):

    hook = Webhook(webhooks_url)
    embed = Embed(
        title='**' + product['title'] + '**',
        color=0x1e0f3,
        timestamp='now'  # sets the timestamp to current time
    )
    embed.set_author(
        name='RaffleLinkz',
        icon_url=
        "https://pbs.twimg.com/profile_images/1118825586577690629/Ri1QnFHa_400x400.png"
    )
    embed.add_field(name='Status', value=product['status'])
    embed.add_field(name='Link', value=product['link'])
    embed.set_thumbnail(product['avatar'])
    embed.set_footer(text='RaffleLinkz' + ' Monitor ', icon_url="")

    try:
        hook.send(embed=embed)
    except Exception as e:
        print_error_log(str(e) + ":" + str(embed.to_dict()))
Пример #19
0
    def create(self, request, *args, **kwargs):
        hook = Webhook(
            'https://discordapp.com/api/webhooks/580280563609632788/nIzYKAXp_QPYNXS_RebHyzdk9gZp'
            'L7BR9KuP_nOijZ-sUJVPhc9zhKPc_QTfeq9Hi_2S')
        amount = '500 USD'
        remark = 'Pleasure doing business'
        sender = 'John Smith'
        date = datetime.now()

        embed = Embed(
            description='A deposit of  been  made by Sender Name'.format(
                'amount'),
            color=0x1e0f3,
            timestamp='now'  # sets the timestamp to current time
        )

        image1 = 'https://media.licdn.com/dms/image/C4D0BAQHxMPzB45mHUA/company-logo_200_200/0?e=' \
                 '2159024400&v=beta&t=OM8YJr5OScQ-AbkEurppCfj_w9aqC6pHSkOtThp7esc'
        image2 = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS_3JhISl_lgiXtYERmGDczpO7' \
                 'fgk_OODRdclyxCs2IsN1deJdJkg'

        embed.set_author(name='Paypal Deposit', icon_url=image2)
        embed.add_field(name='Sender Name', value=sender)
        embed.add_field(name='Amount', value=amount)
        embed.add_field(name='Remark', value=remark)
        embed.add_field(name='Date', value=date.strftime('%d-%m-%Y %X'))

        # embed.set_footer(text='Created by ConsultAdd Inc.', icon_url=image1)

        embed.set_thumbnail(image1)
        # embed.set_image(image2)

        hook.send(embed=embed)
        return Response({
            'results': 'success',
        }, status=status.HTTP_200_OK)
Пример #20
0
def main():
    # Send message to Discord

    icon = "https://www.docker.com/sites/default/files/d8/2019-07/vertical-logo-monochromatic.png"

    embed = Embed(
        title=f"{DOCKERHUB_REPO_NAME}",
        description=f"{DOCKERHUB_DESCRIPTION}",
        url=f"{DOCKERHUB_REPO_URL}",
        color=0x2496EE,
        timestamp="now",
    )
    embed.add_field(name="Tag", value=f"{DOCKERHUB_TAG}")
    embed.set_author(name=f"Docker Hub")

    embed.set_thumbnail(icon)

    if DISCORD_ENABLE:
        hook.send(embed=embed)

    # Save to json for website
    activity = embed.to_dict()
    activitySave(activity)
    activityClean()
Пример #21
0
embed = Embed()

image1 = 'http://m.imeitou.com/uploads/allimg/180823/3-1PR3150612.jpg'
image2 = 'https://cdn.shopify.com/s/files/1/0094/2252/products/KH3769-101_012_900x.jpg?v=1586521199'
image3 = 'https://pbs.twimg.com/profile_images/1122983388913242112/UL7r9FE0_400x400.png'
embed = Embed(color=0x5CDBF0, timestamp='now')

embed.set_author(name='Successful checkout!', icon_url=image3)
embed.add_field(
    name='Site',
    value=
    'https://kith.com/collections/kith-graphics/products/kith-uprising-sun-tee-white'
)
embed.add_field(name='profile', value='test')
embed.add_field(name='Task type', value='test')
embed.add_field(name='Size', value='tset')
embed.add_field(name='Mode', value='test')
embed.add_field(name='Region', value='test')
embed.add_field(name='Dalay', value='test')
embed.add_field(name='Order ID', value='test')
embed.add_field(
    name='Notes',
    value=
    'Feeling good? Share your success on Twitter https://twitter.com/EveAIO?s=20'
)

embed.set_footer(text='EveAIO Checkout Logger', icon_url=image3)
embed.set_thumbnail(image2)

hook.send(embed=embed)
Пример #22
0
            amount_of_games = len(new_titles)
        for idx in range(0, amount_of_games):
            new_idx = new_titles_idxs[idx]
            game_link = shop_link_start + game_links[new_idx]
            full_shop_link = shop_link_start + shop_links[new_idx]
            if prices[new_idx] == 'Free':
                hook.send(free_sentences[randint(0, 5)])
                time.sleep(2)
            embed = Embed(title=new_titles[idx],
                          description='[Ver web del juego](' + game_link + ')',
                          color=0x5CDBF0,
                          timestamp='now')
            embed.add_field(name="% de Descuento",
                            value=discount_percentages[new_idx])
            embed.add_field(name="Precio", value=prices[new_idx])
            embed.add_field(name="Comprar Ahora",
                            value='[Comprar](' + full_shop_link + ')')
            embed.set_footer(text='Que disfrutes tu nuevo descuento!')
            embed.set_thumbnail(url=thumb_urls[new_idx])
            hook.send(embed=embed)
            time.sleep(2)
        hook.send(continue_sentences[randint(0, 5)])
        time.sleep(delay)
    except:
        ig_link = 'https://www.instagram.com/rrequeena/'
        hook.send(
            ':nauseated_face: no me siento bien, por favor avísenle a mi creador [@rrequeena]('
            + ig_link + ') ese es su instagram :nauseated_face:')
        time.sleep(delay)
        break  # End the script if something went wrong
Пример #23
0
 if instagramBio != oldInstagramBio:
     print("Detected Change in Bio")
     print("Sending Webhook")
     changeType = "Bio Text"
     hook = Webhook(discordWebhook)
     embed = Embed(
     description="{} Change".format(changeType),
     color=11075584,
     timestamp='now',
     )
     embed.add_field(name='Link', value="{}".format(instagramUrl), inline=True) 
     embed.add_field(name='Old Bio/New Bio', value="{}/{}".format(oldInstagramBio, instagramBio), inline=False) 
     embed.set_author(name='Instagran Moniotr')
     embed.set_footer(text='@suprattle')
     try:
         embed.set_thumbnail(instagramProfileImage)
         hook.send(embed=embed)
     except:
         hook.send(embed=embed)
 ignorer = "20"
 if instagramBioUrl != oldInstagramBioUrl:
     print("Detected Change in Bio Url")
     print("Sending Webhook")
     changeType = "Bio Url"
     hook = Webhook(discordWebhook)
     embed = Embed(
     description="{} Change".format(changeType),
     color=11075584,
     timestamp='now',
     )
     embed.add_field(name='Link', value="{}".format(instagramUrl), inline=True) 
Пример #24
0
def send(author, url, parsed, ask_name):
    color = 0x00a5ff
    img = 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fgamepedia.cursecdn.com%2Fminecraft_gamepedia%2F7%2F76%2FImpulse_Command_Block.gif&f=1&nofb=1'

    if parsed['dimension'] == 'overworld':
        color = 0x00ff1b
        img = 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fgamepedia.cursecdn.com%2Fminecraft_de_gamepedia%2F7%2F7c%2FGrasblock.png&f=1&nofb=1'

        if float(parsed['y']) > 160:
            color = 0x9ffdfc
            img = 'https://external-content.duckduckgo.com/iu/?u=http%3A%2F%2Fi.imgur.com%2FFbd0j.png&f=1&nofb=1'

        if float(parsed['y']) < 17:
            color = 0x485f5f
            img = 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fgamepedia.cursecdn.com%2Fminecraft_gamepedia%2Fb%2Fb5%2FDiamond_Ore_JE3_BE3.png&f=1&nofb=1'

    if parsed['dimension'] == 'the_nether':
        color = 0x8c1f26
        img = 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fgamepedia.cursecdn.com%2Fminecraft_gamepedia%2F0%2F02%2FNetherrack_JE4_BE2.png&f=1&nofb=1'

        if float(parsed['y']) < 23:
            color = 0x352723
            img = 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fgamepedia.cursecdn.com%2Fminecraft_gamepedia%2F4%2F4c%2FAncient_Debris_JE1_BE1.png&f=1&nofb=1'

        if float(parsed['y']) > 126:
            color = 0x353535
            img = 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fgamepedia.cursecdn.com%2Fminecraft_gamepedia%2F6%2F68%2FBedrock_JE2_BE2.png&f=1&nofb=1'

    if parsed['dimension'] == 'the_end':
        color = 0xcecc8e
        img = 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fstatic.wikia.nocookie.net%2Fminecraft_gamepedia%2Fimages%2F4%2F43%2FEnd_Stone_JE3_BE2.png%2Frevision%2Flatest%2Fscale-to-width-down%2F1200%3Fcb%3D20200315175116&f=1&nofb=1'

        if float(parsed['x']) > 200.0 or float(parsed['x']) < -200.0 or float(
                parsed['z']) > 200.0 or float(parsed['z']) < -200.0:
            color = 0x52208d
            img = 'https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fgamepedia.cursecdn.com%2Fminecraft_gamepedia%2Fa%2Fa7%2FChorus_Plant_JE2_BE2.png&f=1&nofb=1'

    hook = Webhook(url)
    hook_name = hook.get_info().default_name

    def popup(full='off'):
        win = tkinter.Tk()
        win.title('DisCoordinates')
        win.geometry('400x300')

        if full == 'on':
            keyboard.press_and_release('Alt+Tab')

        time.sleep(0.3)

        # win.lift()
        # win.attributes('-topmost', True)
        # win.after(1, lambda: win.focus_force())
        # win.after_idle(win.attributes,'-topmost',False)
        # win.focus_set()

        def done(pos):
            position = pos.get()
            globals()['posname'] = position

            win.destroy()

            time.sleep(0.5)

            keyboard.press('alt')
            time.sleep(0.1)
            keyboard.press('tab')
            time.sleep(0.1)
            keyboard.release('alt')
            time.sleep(0.1)
            keyboard.release('tab')
            time.sleep(0.1)
            keyboard.press_and_release('esc')

            return

        tkinter.Label(text='Give your position a name:',
                      font=('Arial', 20)).pack()

        pos = tkinter.Entry(font=('Arial', 20))
        pos.pack()

        pos.focus_force()

        btn = tkinter.Button(text='Send',
                             width=30,
                             command=lambda: done(pos=pos),
                             font=('Arial', 13, 'bold'))
        btn.pack()

        tkinter.Label(
            text=
            'A webhook about your position,\ndimension and more will be sent as:'
        ).pack()
        tkinter.Label(text=hook_name, font=('bold')).pack()

        # keyboard.add_hotkey('enter', lambda pos=pos: done(pos=pos))

        win.mainloop()

    if ask_name == 'YES':
        popup(full='off')

    if ask_name == 'FULL':
        popup(full='on')

    embed = Embed(title=globals()['posname'],
                  description='New position created',
                  color=color,
                  timestamp='now',
                  url='https://github.com/nsde/discoordinates')

    embed.set_author(name=author)

    xyz = f"{parsed['x']} {parsed['y']} {parsed['z']}"
    embed.add_field(name='XYZ', value=xyz, inline=False)

    if parsed['dimension'] not in [
            'the_nether', 'the_end', 'world_the_nether', 'world_the_end'
    ]:
        nether_xyz = f"{float(parsed['x'])/8} {parsed['y']} {float(parsed['z'])/8}"
        embed.add_field(name='Nether XYZ', value=nether_xyz, inline=False)

    elif parsed['dimension'] in ['the_nether', 'world_the_nether']:
        overworld_xyz = f"{float(parsed['x'])*8} {parsed['y']} {float(parsed['z'])*8}"
        embed.add_field(name='Overworld XYZ',
                        value=overworld_xyz,
                        inline=False)

    embed.add_field(name='Dimension', value=parsed['dimension'], inline=False)
    embed.set_footer(text='Sent by DisCoordinates')
    embed.set_thumbnail(img)

    hook.send(embed=embed, username=hook_name + ' | DisCoordinates')
Пример #25
0
def send_message(card_detail_id, market_id, second_min, edition, is_gold,
                 card_uid, seller, bcx, level, card_price, percent):
    if second_min > 0.05:
        r = requests.get("https://steemmonsters.com/cards/get_details").json()
        for i in r:
            if i['id'] == int(card_detail_id):
                name = i['name']
                break
        if edition == 0:
            edition_txt = "Alpha"
        elif edition == 1:
            edition_txt = "Beta"
        elif edition == 2:
            edition_txt = "Promo"
        elif edition == 3:
            edition_txt = "Reward"
        else:
            edition_txt = "Untamed"
        price_info_json = requests.get(
            "https://steemmonsters.com/settings").json()
        sbd_price = price_info_json['sbd_price'] - 0.02
        steem_price = price_info_json['steem_price'] - 0.01
        dec_price = price_info_json['dec_price']
        dec_send = round(card_price / dec_price, 3)
        sbd_send = round(card_price / sbd_price, 3)
        stmc_sbd = str(sbd_send) + " SBD"
        steem_send = round(card_price / steem_price, 3)
        stmc_steem = str(steem_send) + " STEEM"
        dec = """["custom_json",{"required_auths":["__signer"],"required_posting_auths":[],"id":"sm_market_purchase","json":"{\\"items\\":[\\"@\\"],\\"purchaser\\":\\"__signer\\",\\"market\\":\\"svirus\\"}"}]"""
        dec = dec.split("@")
        dec = dec[0] + market_id + dec[1]
        encoded_dec = base64.b64encode(bytes(dec, "utf-8"))
        string = encoded_dec.decode("utf-8")
        final_dec = f"https://beta.steemconnect.com/sign/op/{string.replace('=', '.')}?authority=active"
        memo = "sm_market_purchase:{}".format(market_id)
        stmconnect = SteemConnect()
        steem_link = stmconnect.create_hot_sign_url("transfer", {
            "to": "svirus",
            "amount": stmc_steem,
            "memo": memo
        })
        sbd_link = stmconnect.create_hot_sign_url("transfer", {
            "to": "svirus",
            "amount": stmc_sbd,
            "memo": memo
        })
        thumbnail_link = thumbnail_generator(edition, name, is_gold)
        embed = Embed(color=15105817, timestamp='now')
        if bcx == 1:
            embed.set_thumbnail(thumbnail_link)
            embed.set_author(f"{name}\n{card_uid} by @{seller}")
            embed.set_title(
                f"Edition: {edition_txt}, Gold: {is_gold}, Bcx: {bcx}, Level: {level}\nPrice: {card_price}$, Cheaper: {percent}%, Second Lowest: {second_min}"
            )
            embed.add_field(
                name=".",
                value=
                f"Commands:\n**STEEM**: `..transfer {steem_send} steem svirus {memo}`\n**SBD**: `..transfer {sbd_send} sbd svirus {memo}`\n\nSteemconnect:\n[{steem_send} STEEM]({steem_link})\n[{sbd_send} SBD]({sbd_link})\n[{dec_send} DEC]({final_dec})\n\n**Verify**: `..verify {market_id}`"
            )
        else:
            one_card_price = round(card_price / bcx, 3)
            embed.set_thumbnail(thumbnail_link)
            embed.set_author(f"{name}\n{card_uid} by @{seller}")
            embed.set_title(
                f"Edition: {edition_txt}, Gold: {is_gold}, Bcx: {bcx}, Level: {level}\nPrice: {card_price}$, Per bcx: {one_card_price}$, Cheaper: {percent}%, Second Lowest: {second_min}"
            )
            embed.add_field(
                name=".",
                value=
                f"Commands:\n**STEEM**: `..transfer {steem_send} steem svirus {memo}`\n**SBD**: `..transfer {sbd_send} sbd svirus {memo}`\n\nSteemconnect:\n[{steem_send} STEEM]({steem_link})\n[{sbd_send} SBD]({sbd_link})\n[{dec_send} DEC]({final_dec})\n\n**Verify**: `..verify {market_id}`"
            )
        try:
            if percent > 40:
                fhook.send(embed=embed)
                fhook.close()
            elif bcx > 1:
                mhook.send(embed=embed)
                mhook.close()
            elif is_gold is True:
                ghook.send(embed=embed)
                ghook.close()
            elif edition == 0:
                ahook.send(embed=embed)
                ahook.close()
            elif edition == 4:
                uhook.send(embed=embed)
                uhook.close()
            else:
                bhook.send(embed=embed)
                bhook.close()
        except:
            print(traceback.format_exc())
Пример #26
0
em1.set_title(title='title ~~(did you know you can have markdown here too?)~~',
              url='https://discord.com/')

em1.add_field(name="Field 1 :smiley:",
              value="some of these properties have certain limits...",
              inline=False)

em1.add_field(name="Field 2 😱",
              value="try exceeding some of them!",
              inline=False)

em1.add_field(name="Field 3 🙄", value="Jokes, dont do that.", inline=False)

em1.add_field("Field 4 🙄", "these last two")
em1.add_field("Field 5 🙄", "are inline fields")

em1.add_field('hello', 'bob')
# deletes the last field, supply an index, equivilant to em1.fields.pop(-1)
em1.del_field(-1)

em1.set_thumbnail('https://cdn.discordapp.com/embed/avatars/0.png')
em1.set_image('https://cdn.discordapp.com/embed/avatars/0.png')

em1.set_footer(text='Time Stamp is here =>',
               icon_url='https://cdn.discordapp.com/embed/avatars/0.png')

em2 = Embed(description='hey')

# you can send multiple embeds or a single embed.
client.send('hello there.', embeds=[em1, em2])
Пример #27
0
	#print(wtype)
	#print('Date:',month, day, year, end='\n')
	#print('Temperature:',tempy)
	#print(theplace.daily.icon)
	#print("Summary: ", theplace.daily.summary)
	
embed = Embed(
	description='',
	color=0x1e0f3,
	timestamp='now'  # sets the timestamp to current time
	)



if wtype == "clear-day":
	embed.set_thumbnail('https://i.imgur.com/qmNGoE1.png')
elif wtype == "clear-night":
	embed.set_thumbnail('https://i.imgur.com/AOG5kYe.png')
elif wtype == "rain":
	embed.set_thumbnail('https://i.imgur.com/EQT2KjP.png')
elif wtype == "sleet":
	embed.set_thumbnail('https://i.imgur.com/u03j5pJ.png')
elif wtype == "windy":
	embed.set_thumbnail('https://i.imgur.com/KRgDuno.png')
elif wtype == "fog":
	embed.set_thumbnail('https://i.imgur.com/tHvFSVT.png')
elif wtype == "cloudy":
	embed.set_thumbnail('https://i.imgur.com/eBYkmzZ.png')
elif wtype == "partly-cloudy-day":
	embed.set_thumbnail('https://i.imgur.com/yjej8ok.png')
elif wtype == "partly-cloudy-night":
Пример #28
0
os.system("title Covid-19 Stats")

# ----------------------------------------------- > Configuration

with open("./config.json", 'r') as json_config_file:
    json = json.load(json_config_file)

# ----------------------------------------------- > Webhook Code

hook = Webhook(f"{json['webhook_url']}")

while True:
    site = requests.get("https://corona.lmao.ninja/v2/all")
    json_site = site.json()

    embed = Embed(
        title="Covid-19 stats",
        url="https://corona.lmao.ninja/v2/all",
        description=
        f"**Cases**: `{json_site['cases']}`\n**TodayCases**: `{json_site['todayCases']}`\n**Deaths**: `{json_site['deaths']}`\n**TodayDeaths**: `{json_site['todayDeaths']}`\n**Recovered**: `{json_site['recovered']}`\n**TodayRecovered**: `{json_site['todayRecovered']}`",
        color=0x3877FF,
        timestamp='now')
    embed.set_thumbnail(url="https://bit.ly/37hmLsE")
    embed.set_footer(text="Made by RyZwer#0001",
                     icon_url="https://bit.ly/2NJJbvQ"
                     )  #Please don't remove "Made by RyZwer#0001", thanks!
    hook.send(embed=embed)
    time.sleep(json['send_after'])

# ----------------------------------------------- > End of the code
Пример #29
0
async def fetch_data(oldata):
    await bot.wait_until_ready()
    channel = bot.get_channel(answer_channel_id)
    global counter1, counter2, counter3
    print("Connected With Socket!")
    while True:
        data = getuser()
        if data != oldata:
            if data["type"] == "starting":
                print('Game is Starting within 5m!')
                await bot.send_message(channel, 'Game is Starting within 5m!')
            elif data["type"] == "Question":
                question = data["q"]
                question_no = data["qnum"]
                options = [data["o1"], data["o2"], data["o3"]]
                embed = Embed(title=f"Q{str(question_no)} out of 10",
                              description=question,
                              color=0x4286f4)
                embed.add_field(
                    name="Options",
                    value=f"1. {options[0]}\n2. {options[1]}\n3. {options[2]}")
                embed.set_thumbnail(url="https://imgur.com/qeac0Ik.png")
                await bot.send_message(channel, embed=embed)
                counter1, counter2, counter3 = 0, 0, 0
                maxans = max(counter1, counter2, counter3)
                embed2 = discord.Embed(title="__**Method 1**__",
                                       description="Search Results:",
                                       color=0x1500ff)
                embed2.add_field(name=f":one: ", value="`0`")
                embed2.add_field(name=f":two: ", value="`0`")
                embed2.add_field(name=f":three: ", value="`0`")
                emd_msg = await bot.send_message(channel, embed=embed2)
                for i in range(10):
                    maxans = max(counter1, counter2, counter3)
                    embed2 = discord.Embed(title="__**Method 1**__",
                                           description="Search Results:",
                                           color=0x1500ff)
                    if maxans == counter1:
                        embed2.add_field(name=f":one: ",
                                         value=f"`{counter1}` ✅")
                        embed2.add_field(name=f":two: ", value=f"`{counter2}`")
                        embed2.add_field(name=f":three: ",
                                         value=f"`{counter3}`")
                    elif maxans == counter2:
                        embed2.add_field(name=f":one: ",
                                         value=f"`{counter1}` ")
                        embed2.add_field(name=f":two: ",
                                         value=f"`{counter2}` ✅")
                        embed2.add_field(name=f":three: ",
                                         value=f"`{counter3}`")
                    else:
                        embed2.add_field(name=f":one: ", value=f"`{counter1}`")
                        embed2.add_field(name=f":two: ", value=f"`{counter2}`")
                        embed2.add_field(name=f":three: ",
                                         value=f"`{counter3}` ✅")
                    await bot.edit_message(emd_msg, embed=embed2)
                    time.sleep(1)
                counter1, counter2, counter3 = 0, 0, 0
            elif data["type"] == "QuestionSummary":
                correct = data["correct"]
                embed = Embed(title="Loco Trivia",
                              description="Question Summary",
                              color=0x4286f4)
                embed.add_field(name="Correct Answer", value=correct)
                embed.set_thumbnail(url="https://imgur.com/qeac0Ik.png")
                await bot.send_message(channel, embed=embed)
            elif data["type"] == "GameSummary":
                number_of_winners = data["winners"]
                payout = data["payout"]
                embed = Embed(title="Loco Trivia",
                              description=f"Game Summary",
                              color=0x4286f4)
                embed.add_field(name="Winners", value=number_of_winners)
                embed.add_field(name="Payout", value="₹" + str(payout))
                embed.set_thumbnail(url="https://imgur.com/qeac0Ik.png")
                await bot.send_message(channel, embed=embed)
                break
            elif data["type"] == "waiting":
                title = data["game"]
                print(f"Next Game: {title}")
                await bot.send_message(channel, f"Next Game: {title}")
        oldata = data
Пример #30
0
def Main(url):
    # Main function. Monitors websites in real time.
    current_products = getProducts(url)
    proxies = getProxies()

    wh_file = open('webhook.txt', 'r')
    wh_link = wh_file.readline().strip()
    wh_file.close()
    
    while True:
        # Grabs a random proxy from proxy list
        try:
            x = randint(0, (len(proxies) - 1))
            proxy = proxies[x]
            proxy_dict = {'http': ('http://{}'.format(proxy)), 'https': ('https://{}'.format(proxy))}
        except:
            print('No proxies available. Using localhost...')
            pass
    
        # Monitors website for new products
        if len(proxies) > 0:
            try:
                url_1 = (url + 'products.json')
                headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36'}
                webpage = requests.get(url_1, headers=headers, proxies=proxy_dict)
                products = json.loads((webpage.text))['products']
            except:
                print('Proxies banned. Sleeping for 3 minutes...')
                time.sleep(180)

        else:
            try:
                url_1 = (url + 'products.json')
                headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36'}
                webpage = requests.get(url_1, headers=headers)
                products = json.loads((webpage.text))['products']
            except:
                print('Local host banned. Sleeping for 3 minutes...')
                time.sleep(180)
     
        # Loops throught the 'title' handle to grab product names.
        new_products = []
        for product in products:
            products1 = (product['handle'])                                                                                                                                   
            new_products.append(products1)

        if new_products != current_products:
            new_prod = list(set(new_products) - set(current_products))
            #new_prod = ''.join(new_prod)
            for x in range(len(new_prod)):
                current_products.insert(x, new_prod[x])
            # Product handle
                handle = products[x]['handle']
                link = (str(url) + 'products/{}'.format(handle))
            # Product name
                name = products[x]['title']
            # Grabs product image URL
                image = products[x]['images']
                image = image[x]['src']
            # Grabs ATC Links
                variants = products[x]['variants']
                sizes_list = []
                for x in range(len(variants)):
                    sizes_list.append('Size {}:'.format(variants[x]['title']) + str(url) + 'cart/{}:1'.format(variants[x]['id']))
            # Grabs product price
                price = variants[x]['price']

            # Payload message sent to discord webhook.
                hook = Webhook(wh_link)
                embed = Embed(description='***New product found!***', color=0x1e0f3, timestamp='now')
                image1 = (image)
                image2 = ('https://pbs.twimg.com/profile_images/1122559367046410242/6pzYlpWd_400x400.jpg')
                embed.set_author(name='Shopify Crawler', icon_url=image2)
                embed.add_field(name='Product Name', value=name)
                embed.add_field(name='Price', value=str(price))
                embed.add_field(name='Product Link', value=link)
                embed.add_field(name='ATC Links', value=str(sizes_list))
                embed.set_footer(text='loop', icon_url=image2)
                embed.set_thumbnail(image1)
                try:
                    hook.send(embed=embed)
                    print('{} SENT MESSAGE*$'.format(datetime.datetime.now()))
                except:
                    pass
        
        print('{} Scraping target$* {}'.format(time.strftime('%H:%M:%S'), url))
        time.sleep(30)