Beispiel #1
0
def bot(hookName, username):
    if hookName == "":
        pass
    else:
        hook = Webhook(hookName)

        embed = Embed(
            description="GITAM Meetings",
            color=0xB1040E,
            timestamp="now"
        )

        embed.set_author(name="Meetings")
        with open('meet.csv', 'r') as file:
            reader = csv.reader(file)
            for row in reader:
                # print(row)
                title=row[0]
                dateandlink=row[1] + ", " + row[2]
                embed.add_field(name=title, value=dateandlink)
        
        footer = 'By ' + username

        embed.set_footer(text=footer)
        hook.send(embed=embed)
Beispiel #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)
Beispiel #3
0
async def post_to_webhook(new_tweet: Tweet):
    start_time = time.time()
    url = "https://discordapp.com/api/webhooks/644694815094734848/Y9Ixa2Wh7xpF7uQzbzX8uua-cERYWbtyoD3Xg8-7NJmUl47UTN_IF-QD5W_W-3oymtdy"
    text = new_tweet.text
    webhook = Webhook.Async(url)
    embed = Embed(
        title=f"Link to tweet",
        url=
        f"https://twitter.com/{new_tweet.created_by.screen_name}/status/{new_tweet.id}"
    )
    embed.set_author(
        name=f"New tweet from {new_tweet.created_by.screen_name}",
        url=f'https://twitter.com/{new_tweet.created_by.screen_name}',
        icon_url=new_tweet.created_by.profile_image_url)
    for mentioned_user in new_tweet.mentioned_users:
        text = text.replace(
            f"@{mentioned_user.screen_name}",
            f"[@{mentioned_user.screen_name}](https://twitter.com/{mentioned_user.screen_name})"
        )
    embed.add_field(name="Content: ", value=text, inline=True)
    for url in new_tweet.links_in_tweet:
        embed.add_field(name="Link Found: ", value=f"{url.url}")
    embed.set_footer(text=f'Monitor by ike_on')
    await webhook.send(embed=embed)
    print(f"Took {time.time() - start_time} seconds to send to webhook")
    for url in new_tweet.links_in_tweet:
        if ("discord" in url.url):
            await webhook.send(f"Possible discord invite found: {url.url}")
    await webhook.close()
Beispiel #4
0
 async def on_ready(self):
     if not hasattr(self.bot, "uptime"):
         self.bot.uptime = datetime.utcnow()
     webhook = Webhook(self.config.readywebhook, is_async=True)
     embed = Embed(
         title=f"Reconnected, Online and Operational!",
         description="Ready Info",
         color=5_810_826,
         timestamp=True,
     )
     embed.set_author(
         name=f"PawBot",
         url=
         "https://discordapp.com/oauth2/authorize?client_id=460383314973556756&scope=bot&permissions=469888118",
         icon_url=
         "https://cdn.discordapp.com/avatars/460383314973556756/2814a7328962f7947a25ccd2ee177ac1.webp",
     )
     embed.add_field(name="Guilds",
                     value=f"**{len(self.bot.guilds)}**",
                     inline=True)
     embed.add_field(name="Users",
                     value=f"**{len(self.bot.users)}**",
                     inline=True)
     await webhook.execute(embeds=embed)
     await webhook.close()
     await self.bot.change_presence(
         activity=discord.Game(
             type=0,
             name=f"{random.choice(lists.randomPlayings)} | paw help"),
         status=discord.Status.online,
     )
Beispiel #5
0
def SendOutWebhook():
    embed = Embed(
        title="KITH MOSAIC TEE/SLATE(并没有补货)",
        url=
        "https://kith.com/collections/kith-monday-program/products/kith-mosaic-tee-slate",
        description="In Stock Now!",
        color=6940159,
        timestamp="now",
    )

    hook = Webhook(
        "https://ptb.discordapp.com/api/webhooks/665206935125098496/5nqd6ABS3So5UVCRle7nZIqhJ8wRLFPCBbTReW9MqC6l8A9zYiUe4TlRCwbTMtn0Ov_u"
    )

    embed.add_field(
        name="商品页面",
        value=
        "https://cdn.shopify.com/s/files/1/0094/2252/products/KH3777-105-2_300x300.jpg?v=1590786070"
    )
    embed.set_author(
        name="eee7272的小小monitor",
        icon_url=
        "https://cdn.discordapp.com/avatars/677904239527329817/a5fb74580580dd6d3354e8ecd7f136ee.png?size=128"
    )
    embed.set_image(
        "https://cdn.shopify.com/s/files/1/0094/2252/products/KH3777-105_200x200_crop_center.jpg?v=1590786070"
    )
    embed.set_footer(
        text="eee7272#6012",
        icon_url=
        "https://cdn.discordapp.com/avatars/677904239527329817/a5fb74580580dd6d3354e8ecd7f136ee.png?size=128"
    )

    hook.send(embed=embed)
Beispiel #6
0
 async def post_to_webhook(self, new_tweet: Tweet):
     start_time = time.time()
     text = new_tweet.text
     webhook = Webhook.Async(self.webhookURL)
     embed = Embed(
         title=f"Link to tweet",
         url=
         f"https://twitter.com/{new_tweet.created_by.screen_name}/status/{new_tweet.id}"
     )
     embed.set_author(
         name=f"New tweet from {new_tweet.created_by.screen_name}",
         url=f'https://twitter.com/{new_tweet.created_by.screen_name}',
         icon_url=new_tweet.created_by.profile_image_url)
     for mentioned_user in new_tweet.mentioned_users:
         text = text.replace(
             f"@{mentioned_user.screen_name}",
             f"[@{mentioned_user.screen_name}](https://twitter.com/{mentioned_user.screen_name})"
         )
     embed.add_field(name="Content: ", value=text, inline=True)
     for url in new_tweet.links_in_tweet:
         embed.add_field(name="Link Found: ", value=f"{url.url}")
     embed.set_footer(
         text=
         f'Monitor by ike_on not recursive {datetime.now().strftime("%I:%M:%S.%f %p")}'
     )
     await webhook.send(embed=embed)
     print(f"Took {time.time() - start_time} seconds to send to webhook")
     for url in new_tweet.links_in_tweet:
         if ("discord" in url.url):
             await webhook.send(f"Possible discord invite found: {url.url}")
     await webhook.close()
Beispiel #7
0
def discord_embed(severity, source, title, description=None, **fields):
    """Send an embedded message to discord.
    """
    global DISCORD_WARNING_SENT

    severity_icon, discord_url = severities[severity]

    if not discord_url or discord_url == 'none':
        if not DISCORD_WARNING_SENT:
            DISCORD_WARNING_SENT = True
            logging.warning(
                'DISCORD_WEBHOOK_URL not configured, will not send messages to discord.'
            )
        logging.info('Discord embed not sent: %s: %s: %s', title, description,
                     fields)
        return

    try:
        discord = Webhook(discord_url)
        title = severity_icon + ' ' + title
        embed = Embed(title=title,
                      description=description,
                      color=0xff0000,
                      timestamp='now')
        embed.set_author(source)
        for field, value in fields.items():
            embed.add_field(field, value)
        discord.send(embed=embed)
    except Exception as e:
        logging.error('Unhandled exception when sending discord embed:')
        logging.exception(e)
Beispiel #8
0
    def second_embed(self, potrjeni, potrjenipretekli, aktivni, dni,
                     zadnjih7dni):
        embed = Embed(
            description='COVID-19 EMBED 2',
            color=0x5CDBF0,
            timestamp=str(datetime.now())  # sets the timestamp to current time
        )

        embed.add_field(name="potrjenih primerov",
                        value=potrjeni,
                        inline=False)
        embed.add_field(name="potrjenih primerov v preteklem dnevu",
                        value=potrjenipretekli,
                        inline=False)
        embed.add_field(name="aktivnih primerov (ocena)",
                        value=aktivni,
                        inline=False)
        embed.add_field(
            name=
            "potrjenih primerov na 100.000 prebivalcev Slovenije v zadnjih 14 dneh",
            value=dni,
            inline=False)
        embed.add_field(name="povprečje potrjenih primerov v zadnjih 7 dneh",
                        value=zadnjih7dni,
                        inline=False)
        return embed
Beispiel #9
0
def hook_send(product_url, stock):
    print(product_url)
    hook = Webhook(
        "https://discordapp.com/api/webhooks/697993898659676230/09E2-tTgtVWc6NLuJ5NgaXyioE98A_VADBR3MbULkupaz-C_1UDX350L2VEDV46ams07"
    )
    embed = Embed(description=product_url, color=0x5CDBF0, timestamp="now")
    embed.add_field(name="STOCK AVAILABILITY", value=stock)
    hook.send(embed=embed)
Beispiel #10
0
 def detect_profile_pic(self):
     hook = Webhook(self.hook)
     embed = Embed(description='New profile picture 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.set_image(self.profile_pic_link)
     hook.send(embed=embed)
def ScrapeSite(productURL):
	print(info + '\nSending the webhook!' + reset)

	#Getting selected product page by Selenium
	driver.get(productURL)

	#Waiting for website check
	try:
		driver.find_element_by_class_name('attack-box')
		print(yellow + 'The website is being checked...' + reset)
		time.sleep(10)
	except:
		print('This page is clean')

	#Scraping the page
	titleElem = driver.find_element_by_class_name('product-view__title').find_elements_by_css_selector("*")
	priceElem = driver.find_element_by_class_name('product-view__price').find_elements_by_css_selector("*")
	name1 = titleElem[0].text
	name2 = titleElem[1].text
	price = priceElem[0].text

	productImage = driver.find_element_by_class_name('image-gallery__link')
	productImageURL = productImage.get_attribute('href')

	logoImage = driver.find_element_by_class_name('site-logo--header').find_element_by_css_selector("*")
	logoImageURL = logoImage.get_attribute('src')

	#Scraping images
	driver.get(productImageURL)
	driver.save_screenshot("images/product.png")
	driver.get(logoImageURL)
	driver.save_screenshot("images/logo.png")

	#Creating Webhook
	webhook = Webhook(webhookURL)

	embed = Embed(
		title=name1 + ' ' + name2,
		url=productURL,
		color=65280,
		timestamp='now'
		)

	#Making a Discord Webhook
	embed.add_field(name='**Sizes**', value='[S](https://www.sneakersnstuff.com/en/product/40044/adidas-pleckgate-tp),'
											' [M](https://www.sneakersnstuff.com/en/product/40044/adidas-pleckgate-tp),'
											' [L](https://www.sneakersnstuff.com/en/product/40044/adidas-pleckgate-tp),'
											' [XL](https://www.sneakersnstuff.com/en/product/40044/adidas-pleckgate-tp)')
	embed.add_field(name='**Price**', value='$'+price)
	#embed.set_thumbnail("./product.png")
	#webhook.send(embed=embed)
	print(correct + 'webhook sent' + reset)
Beispiel #12
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)
Beispiel #13
0
def discord_webhook(product_item):
    hook = Webhook(url="")
    """
    Sends a Discord webhook notification to the specified webhook URL
    :param product_item: An array of the product's details
    :return: None
    """
    embed = Embed(color=int(16711816))
    if product_item == 'initial':
        embed.description = 'NBA Top Shot Monitor // INITIALISED // Twitter: @LNDNHYPE :smile:'
    else:
        embed.set_author('NBA Top Shot Monitor')
        embed.set_title(title=f'{product_item[1]}')  # Item Name
        embed.add_field(name='Price:', value=product_item[2], inline=True)
        embed.add_field(name='Stock Count:',
                        value=product_item[4],
                        inline=True)
        embed.add_field(name='Remaining:', value=product_item[3], inline=True)
        embed.add_field(name='Pre Order:', value=product_item[5], inline=False)
        #embed.set_thumbnail(product_item[4])

    embed.set_footer(
        text=
        f'Developer Twitter: @LNDNHYPE • {datetime.now().strftime("%Y-%m-%d %H:%M")}',
        icon_url='https://i.imgur.com/jjOXloc.png')

    try:
        hook.send(embed=embed)
    except requests.exceptions.HTTPError as err:
        print(err)
        logging.error(msg=err)
    else:
        print("Payload delivered successfully")
        logging.info("Payload delivered successfully")
Beispiel #14
0
async def init(app, loop):
    app.secret = config.SECRET
    app.session = aiohttp.ClientSession(
        loop=loop)  # we use this to make web requests
    app.webhook = Webhook.Async(config.WEBHOOK_URL, session=app.session)
    app.db = AsyncIOMotorClient(config.MONGO_URI).majorproject
    app.users = UserBase(app)

    em = Embed(color=Color.green)
    em.set_author('[INFO] Starting Worker', url=app.ngrok_url)
    em.set_footer(f'Host: {socket.gethostname()}')
    em.add_field('Public URL', app.ngrok_url) if app.ngrok_url else ...

    await app.webhook.send(embed=em)
Beispiel #15
0
    def send_report(self, id):
        embed = Embed(
            description='A user reported the following face',
            color=0x5CDBF0,
            timestamp='now'  # sets the timestamp to current time
        )
        img_file = self.xml_parser.get_imgpath_from_uid(self.xml, id)
        if img_file:
            img_file = self.xml.replace("config.xml", "") + img_file + ".png"
            file = File(img_file)
            embed.add_field(name='File', value=img_file)

            self.webhook.send(embed=embed, file=file)
        return img_file
Beispiel #16
0
def send_webhook(title, inputsize, image, url, paymentype, checkout_time):
    try:
        hook = Webhook(url=webhook_url)
        embed = Embed(title='SACAI Checkout',
                      color=15957463,
                      url=url,
                      thumbnail_url=str(image))

        embed.add_field(name='Product', value=str(title))
        embed.add_field(name='Product Size', value=str(inputsize))
        embed.add_field(name='Payment Type', value=str(paymentype))
        embed.add_field(name='Checkout Speed',
                        value=str(checkout_time) + ' sec')
        embed.set_footer(
            text=
            f'BONZAY SACAI • {datetime.datetime.now().strftime("%Y-%m-%d %H:%M")}',
            icon_url=
            'https://cdn.discordapp.com/icons/594125608003305492/7f5110cf3bb22f6d622cd03ba1586f59.webp?size=512'
        )

        hook.send(embed=embed)
        print(gettime() + Fore.GREEN + Style.BRIGHT +
              ' [SUCCESS] -> Successfully sent success webhook!')
    except:
        print(gettime() + Fore.RED +
              ' [ERROR] -> Failed sending success webhook!')
    def send_to_discord(self, altered_sizes):
        hook = Webhook(self.webhook)
        hook.username = "******"
        hook.avatar_url = "https://pbs.twimg.com/profile_images/1001585704303030273/SNhhIYL8_400x400.jpg"

        # create embed
        embed = Embed(title='%s on Adidas %s' %
                      (self.pid, self.region.upper()),
                      url=self.get_wishlist_url(),
                      color=10764258,
                      timestamp='now')

        # add embed fields
        embed.add_field(name='PID', value=self.pid)
        embed.add_field(name='Region', value=self.region.upper())
        embed.add_field(name='Overall Status',
                        value=self.latest_status,
                        inline=False)

        for size in altered_sizes:
            embed.add_field(name='Size %s' % size['size'],
                            value=size['availability_status'],
                            inline=True)

        embed.set_footer(text='SD Adidas Monitor',
                         icon_url='https://i.imgur.com/ceVbiGI.png')
        hook.send(embed=embed)
        self.log("Posted status update to Discord")
Beispiel #18
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)
Beispiel #19
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)
Beispiel #20
0
    def send_to_discord(self):
        hook = Webhook(self.webhook)
        hook.username = "******"
        hook.avatar_url = "https://pbs.twimg.com/profile_images/1001585704303030273/SNhhIYL8_400x400.jpg"

        embed = Embed(description='Status update on %s on Adidas %s' %
                      (self.pid, self.region.upper()),
                      color=0x1e0f3,
                      timestamp='now')

        embed.add_field(name='Status', value=self.latest_status)
        embed.set_footer(text='SD Adidas Monitor',
                         icon_url='https://i.imgur.com/ceVbiGI.png')
        hook.send(embed=embed)
        self.log("Posted status update to Discord")
Beispiel #21
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)
Beispiel #22
0
def send_alert(webhook, stores, proxies):

    # Sends alert to Discord webhook re: monitor.

    hook = Webhook(webhook)
    embed = Embed(color=0x43b581, title="Monitor started!", timestamp="now")
    stores_str = "\n".join(stores)

    embed.add_field(
        name="Stores",
        value=stores_str,
    )
    embed.add_field(
        name="Proxies",
        value=len(proxies),
    )
    hook.send(embed=embed)
Beispiel #23
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(
                "Неправильно задана команда или параметр!")
def CreateWebHook(name, sizes, price):
	webhook = Webhook("WEBHOOK_URL")

	embed = Embed(
		description='A new thing is out! :wink:',
		timestamp='now'
		)

	#Making a Discord Webhook
	embed.set_author(name=name, icon_url="https://pmcfootwearnews.files.wordpress.com/2016/12/sns-logo-black_1024x1024.jpg")
	embed.add_field(name='**Sizes**', value='[S](https://www.sneakersnstuff.com/en/product/40044/adidas-pleckgate-tp),'
											' [M](https://www.sneakersnstuff.com/en/product/40044/adidas-pleckgate-tp),'
											' [L](https://www.sneakersnstuff.com/en/product/40044/adidas-pleckgate-tp),'
											' [XL](https://www.sneakersnstuff.com/en/product/40044/adidas-pleckgate-tp)')
	#embed.set_thumbnail("./product.png")
	webhook.send(embed=embed)
	print('webhook sent')
	pass
Beispiel #25
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
Beispiel #26
0
 async def on_guild_remove(self, guild):
     findbots = sum(1 for member in guild.members if member.bot)
     findusers = sum(1 for member in guild.members if not member.bot)
     webhook = Webhook(self.config.guildleavewebhook, is_async=True)
     embed = Embed(description=f"I've left {guild.name}...",
                   color=5_810_826,
                   timestamp=True)
     embed.set_author(
         name=f"{guild.name}",
         url=
         "https://discordapp.com/oauth2/authorize?client_id=460383314973556756&scope=bot&permissions=469888118"
     )
     embed.add_field(
         name="Info",
         value=
         f"New guild count: **{len(self.bot.guilds)}**\nOwner: **{guild.owner}**\nUsers/Bot Ratio: **{findusers}/{findbots}**",
     )
     await webhook.execute(embeds=embed, username=guild.name)
     await webhook.close()
Beispiel #27
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)
Beispiel #28
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)
Beispiel #29
0
    def send_report(self, e):
        uid = self.rep_inp.value
        img_name = self.prf_cfg["imgs"][uid]
        img_eth = self.prf_cfg["ethnics"][uid]
        img_path = img_eth + "/" + img_name
        img_file = self.rep_img.image.path
        self.logger.info("send report: {}".format(img_file))

        hook = Webhook("https://discord.com/api/webhooks/770397581149863946/Wls0g6LEyTXEpOqzfLn2YuDRKANFSAFpwKe62VL9IxpwsQDWFjYHVfy19hrYiv5p0X2a")

        embed = Embed(
            description='A user reported the following face',
            color=0x5CDBF0,
            timestamp='now'  # sets the timestamp to current time
            )

        file = File(img_file)
        embed.add_field(name='File', value=img_path)

        hook.send(embed=embed, file=file)
Beispiel #30
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