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)
async def aexit(app, loop): em = Embed(color=Color.orange) em.set_footer(f'Host: {socket.gethostname()}') em.set_author('[INFO] Server Stopped') await app.webhook.send(embed=em) await app.session.close()
def sendWebhook(self, nitroCode, startTime, success=False, errorCode=None): webhook = Webhook(os.environ["discordWebhook"]) if success == False: embedColor = 16724787 embedTitle = "Failed Claiming Nitro" else: embedColor = 9881393 embedTitle = "Claimed Discord Nitro" embed = Embed( title=embedTitle, color=embedColor, time="now" ) embed.add_field(name="Nitro Code", value=nitroCode, inline=True) embed.add_field(name="Elapsed time", value=str(time.time() - startTime) + " sec", inline=True) if success == False and errorCode != None: embed.add_field(name="Error code", value=errorCode, inline=True) embed.set_author(name="Andromeda") embed.set_footer(text="Andromeda - Made By Thoosje") try: webhook.send(embed=embed) except Exception: print(colored(getPrintFormat() + "Failed to send webhook.", "red")) return
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)
def notify_password_url(webhook_url, password_url, screen_name, profile_pic): hook = Webhook(url=webhook_url) color = random.choice(HEX_LIST) embed = Embed( title="Possible link found:", color=color, timestamp='now', description=password_url, ) embed.set_author(name=screen_name, icon_url=profile_pic, url=f'https://twitter.com/{screen_name}') embed.set_footer( text= f'BONZAY Twitter • {datetime.datetime.now().strftime("%Y-%m-%d %H:%M")}', icon_url='https://cdn.discordapp.com/emojis/636516489322561536.png?v=1' ) # if url: # embed.add_field('Link in tweet', value=url) #embed.set_author(name='New post by {instagram_user}') # if tweet_content: # embed.add_field("Tweet description", tweet_content) # embed.image(image) hook.send(embed=embed)
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()
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)
def update_set(webhook, set_info): hook = Webhook(webhook) embed = Embed( color=14177041, title="Release Date Update", description=set_info["name"], timestamp="now", ) embed.add_field(name="Release Date", value=set_info["release_date"], inline=False) embed.add_field(name="Category", value=set_info["category"], inline=False) embed.add_field(name="View Full Calendar", value="[Click here](https://tempest.cards/)", inline=True) embed.set_author( name="Card Release Calendar", icon_url= "https://cdn.discordapp.com/attachments/161323390362320897/743688864694009856/Untitled-1.png" ) embed.set_footer( text="Tempest Cards Release Calendar", icon_url= "https://cdn.discordapp.com/attachments/161323390362320897/743688864694009856/Untitled-1.png" ) hook.send(embed=embed)
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 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")
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()
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")
def sendWebhook(self, inviteCode, startTime, success=False, guildName=None): webhook = Webhook(os.environ["discordWebhook"]) if success == False: embedColor = 16724787 embedTitle = "Failed Joining Guild" else: embedColor = 9881393 embedTitle = "Joined Guild" embed = Embed( title=embedTitle, color=embedColor, time="now" ) embed.add_field(name="Invite Code", value=inviteCode, inline=True) embed.add_field(name="Elapsed time", value=str(time.time() - startTime) + " sec", inline=True) if success == True and guildName != None: embed.add_field(name="Guild Name", value=guildName, inline=True) embed.set_author(name="Andromeda") embed.set_footer(text="Andromeda - Made By Thoosje") try: webhook.send(embed=embed) except Exception: print(colored(getPrintFormat() + "Failed to send webhook.", "red")) return
def sendDiscordInitialize(): now = datetime.datetime.now() hook = Webhook(os.environ.get("DISC_HOOK")) embed = Embed(description="The scraper has successfully booted up!", color=0x5CDBF0, timestamp='now') embed.set_footer(text="MCS") hook.send(embed=embed)
async def server_stop(app, loop): """Sends a message to the webhook channel when server stops.""" em = Embed(color=0xe67e22) em.set_footer('Host: {}'.format(socket.gethostname())) em.description = '[INFO] Server Stopped' await app.webhook.send(embed=em) await app.session.close()
def form(): if request.method == "POST": link = request.form.get('link') hook = request.form.get('webhook') group = request.form.get('group') icon = request.form.get('icon') print(f"Sending list {link} to {hook} for {group}") wh = Webhook(hook) try: r = requests.get(link) soup = BeautifulSoup(r.text, "html.parser") cards = soup.find_all(class_="masonry__item") for card in cards: try: img = card.find("img")['src'] imageUrl = f"https://supremecommunity.com/{img}" name = card.find( class_="name item-details item-details-title") price = card.find(class_="label-price") ratio = card.find(class_="upvotesratio hidden") embed = Embed(title=f"{name.text}", description="", color=0xff2b2b, timestamp="now") try: embed.set_image(url=imageUrl) except: print("no image") try: embed.add_field(name="Price", value=f"{price.text}", inline=False) except: embed.add_field(name="Price", value=f"No Prices Yet", inline=False) try: embed.add_field( name="Vote Ratio", value=f"{str(ratio.text)[:5]}% Positive", inline=False) except: print("no ratio") embed.set_footer(f"connorstevens#0001 x {group}", icon_url=f"{icon}") wh.send(embed=embed) except Exception as e: print(e) continue except Exception as e: print(e) return render_template("index.html")
def webHook(url, buildNum, project, downloadURL, code): hook = Webhook(url) embed = Embed( description="A new patreon build for " + project + " has been compiled!", color=0xf96854, timestamp='now', url=downloadURL, image_url="https://flagbrew.org/download/"+ code +"/cia_qr.png", title="New " + project + " build!" ) embed.set_footer("Build: " + buildNum) hook.send(embed=embed)
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)
def notify_discord_invite(webhook_url, invite_url, screen_name, profile_pic): hook = Webhook(url=webhook_url) color= random.choice(HEX_LIST) embed = Embed( title = "Discord invite found:", color=color, description = invite_url, ) embed.set_author(name=screen_name,icon_url=profile_pic,url=f'https://twitter.com/{screen_name}') embed.set_footer(text='BONZAY', icon_url="https://cdn.discordapp.com/emojis/636516489322561536.png?v=1") hook.send(embed=embed)
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)
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)
def badhook(): embed = Embed( title='AIO Search Failed', description= "AIO Search Program was un-able to open you're defined searches", color=0xff0000, timestamp='now' # sets the timestamp to current time ) image1 = 'https://avatars2.githubusercontent.com/u/25069719?s=460&u=0758922d6a85a09f971fbf778bb720788a2f2e5b&v=4' # hook.modify(name='AIO Search', avatar=image1) embed.set_footer(text='AIO Search | Made by iHildy#3839', icon_url=image1) 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)
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")
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)
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()
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( "Неправильно задана команда или параметр!")
async def log_new_instance(request): data = request.json count = await request.app.db.users.count_documents({}) em = Embed(color=0x36393F) em.add_field(name='Guild Name', value=data['guild_name']) em.add_field(name='Member Count', value=data['member_count']) em.add_field(name='Owner', value=f"<@{data.get('owner_id', 0)}>") selfhosted = data.get('selfhosted', False) em.set_footer( text= f"#{count} • {'selfhosted ' if selfhosted else ''}v{data['version']} • {data['bot_name']} ({data['bot_id']})", icon_url=data.get('avatar_url')) await request.app.new_instance_webhook.send( embed=em, username='******', avatar_url='https://i.imgur.com/klWk4Si.png')
def webhook(self, patch_notes_url, discord_webhook): """ Sends POST request to the specified webhook URL, posts in a neat fashion """ hook = Webhook(discord_webhook) embed = Embed( description= "Epic just released the new patch notes, check them out above!", color=0x1e0f3, timestamp="now") embed.set_author(name="New Fortnite Patch Notes", url=patch_notes_url) embed.set_footer(text="Fortnite Patch Notes V1 | by @visuxls") hook.send(embed=embed)
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])