53 skills found · Page 1 of 2
legendsayantan / ShizuToolsContains many tools to control android system via shizuku.
swevans / UnmuteEnables web audio playback with the ios mute switch on
dragonman225 / Stm32f469 UsbaudioEnable 24-bit / 96kHz Hi-Fi PCM stereo audio output via USB Audio Class 1.0 asynchronous mode on STM32469I-Discovery · Volume and mute control implemented
gdi3d / Mute Spotify Ads Mac OsxMute Mac (osx) computer audio when Spotify plays an AD
jeffg-dev / LaughrRecurrent neural network audio manipulation tool to mute "laugh track" audio segments found commonly in sitcoms.
fredemmott / StreamDeck AudioMuteToggle mute for audio devices with the Elgato StreamDeck
NishNishendanidu / Mtroid BotGENARATED BY NISHEN Mtroid whatsApp bot 🪀 Command:`setup `✨️ Description:` edit bot settings `⚠️️ Warn `🪀 Command:` install <br> `✨️ Description:` Install external plugins. <br> `⚠️️ Warn:` Get plugins only from https://t.me/AlphaXplugin. `🪀 Command:` plugin<br> `✨️ Description:` Shows the plugins you have installed. `🪀 Command:` remove<br> `✨️ Description:` Removes the plugin. `🪀 Command:` admin<br> `✨️ Description:` Admin menu. `🪀 Command:` ban <br> `✨️ Description:` Ban someone in the group. Reply to message or tag a person to use command. `🪀 Command:` gname <br> `✨️ Description:` Change group name. `🪀 Command:` gdesc<br> `✨️ Description:` Change group discription. `🪀 Command:` dis <br> `✨️ Description:` Disappearing message on/off. <br> `💡 Example:` .dis on/off `🪀 Command:` reset<br> `✨️ Description:` Reset group invitation link. `🪀 Command:` gpp<br> `✨️ Description:` Set group profile picture `🪀 Command:` add<br> `✨️ Description:` Adds someone to the group. `🪀 Command:` promote <br> `✨️ Description:` Makes any person an admin. `🪀 Command:` demote <br> `✨️ Description:` Takes the authority of any admin. `🪀 Command:` mute <br> `✨️ Description:` Mute the group chat. Only the admins can send a message. ⌨️ Example: .mute & .mute 5m etc `🪀 Command:` unmute <br> `✨️ Description:` Unmute the group chat. Anyone can send a message. `🪀 Command:` invite <br> `✨️ Description:` Provides the group's invitation link. `🪀 Command:` afk <br> `✨️ Description:` It makes you AFK - Away From Keyboard. `🪀 Command:` art pack<br> `✨️ Description:` Beautifull artpack with more than 100 messages. `🪀 Command:` aspm <br> `✨️ Description:` This command for any emergency situation about any kind of WhatsApp SPAM in Group `🪀 Command:` alag <br> `✨️ Description:` This command for any emergency situation about any kind of WhatsApp SPAM in Chat `🪀 Command:` linkblock <br> `✨️ Description:` Activates the block link tool. <br> `💡 Example:` .linkblock on / off `🪀 Command:` CrAsH<br> `✨️ Description:` send BUG VIRUS to group. `🪀 Command:` CrAsH high<br> `✨️ Description:` send BUG VIRUS to group untill you stop. `🪀 Command:` -carbon `🪀 Command:` clear<br> `✨️ Description:` Clears all the messages from the chat. `🪀 Command:` qr <br> `✨️ Description:` To create an qr code from the word you give. `🪀 Command:` bcode <br> `✨️ Description:` To create an barcode from the word you give. `🪀 Command:` compliment<br> `✨️ Description:` It sends complimentry sentenses. `🪀 Command:` toaudio<br> `✨️ Description:` Converts video to sound. `🪀 Command:` toimage<br> `✨️ Description:` Converts the sticker to a photo. `🪀 Command:` tovideo<br> `✨️ Description:` Converts animated stickers to video. `🪀 Command:` deepai<br> `✨️ Description:` Runs the most powerful artificial intelligence tools using artificial neural networks. `🪀 Command:` details<br> `✨️ Description:` Displays metadata data of group or person. `🪀 Command:` dict <br> `✨️ Description:` Use it as a dictionary. Eg: .dict enUS;lead For supporting languages send •.lngcode• `🪀 Command:` dst<br> `✨️ Description:` Download status you repled. `🪀 Command:` emedia<br> `✨️ Description:` It is a plugin with more than 25 media tools. `🪀 Command:` emoji <br> `✨️ Description:` You can get Emoji as image. `🪀 Command:` print <br> `✨️ Description:` Prints the inside of the file on the server. `🪀 Command:` bashmedia <br> `✨️ Description:` Sends audio, video and photos inside the server. <br> `💡 Example:` video.mp4 && media/gif/pic.mp4 `🪀 Command:` addserver<br> `✨️ Description:` Uploads image, audio or video to the server. `🪀 Command:` term <br> `✨️ Description:` Allows to run the command on the server's shell. `🪀 Command:` mediainfo<br> `✨️ Description:` Shows the technical information of the replied video. `🪀 Command:` pmsend <br> `✨️ Description:` Sends a private message to the replied person. `🪀 Command:` pmttssend <br> `✨️ Description:` Sends a private voice message to the respondent. `🪀 Command:` ffmpeg <br> `✨️ Description:` Applies the desired ffmpeg filter to the video. ⌨️ Example: .ffmpeg fade=in:0:30 `🪀 Command:` filter <br> `✨️ Description:` It adds a filter. If someone writes your filter, it send the answer. If you just write .filter, it show's your filter list. `🪀 Command:` stop <br> `✨️ Description:` Stops the filter you added previously. `🪀 Command:` bgmlist<br> `✨️ Description:` Bgm List. `🪀 Command:` github <br> `✨️ Description:` It Send Github User Data. <br> `💡 Example:` .github WhatsApp `🪀 Command:` welcome<br> `✨️ Description:` It sets the welcome message. If you leave it blank it shows the welcome message. `🪀 Command:` goodbye<br> `✨️ Description:` Sets the goodbye message. If you leave blank, it show's the goodbye message. `🪀 Command:` help<br> `✨️ Description:` Gives information about using the bot from the Help menu. `🪀 Command:` varset <br> `✨️ Description:` Changes the text of modules like alive, afk etc.. `🪀 Command:` restart<br> `✨️ Description:` Restart bot. `🪀 Command:` poweroff<br> `✨️ Description:` Shutdown bot. `🪀 Command:` dyno<br> `✨️ Description:` Check heroku dyno usage `🪀 Command:` setvar <br> `✨️ Description:` Set heroku config var `🪀 Command:` delvar <br> `✨️ Description:` Delete heroku config var `🪀 Command:` getvar <br> `✨️ Description:` Get heroku config var `🪀 Command:` hpmod <br> `✨️ Description:` To get mod apps info. `🪀 Command:` insult<br> `✨️ Description:` It gives random insults. `🪀 Command:` locate<br> `✨️ Description:` It send your location. <br> `⚠️️ Warn:` Please open your location before using command! `🪀 Command:` logmsg<br> `✨️ Description:` Saves the message you reply to your private number. <br> `⚠️️ Warn:` Does not support animated stickers! `🪀 Command:` logomaker<br> `✨️ Description:` Shows logomaker tools with unlimited access. `🪀 Command:` meme <br> `✨️ Description:` Photo memes you replied to. `🪀 Command:` movie <br> `✨️ Description:` Shows movie info. `🪀 Command:` neko<br> `✨️ Description:` Replied messages will be added to nekobin.com. `🪀 Command:` song <br> `✨️ Description:` Uploads the song you wrote. `🪀 Command:` video <br> `✨️ Description:` Downloads video from YouTube. `🪀 Command:` fb <br> `✨️ Description:` Download video from facebook. `🪀 Command:` tiktok <br> `✨️ Description:` Download tiktok video. `🪀 Command:` notes<br> `✨️ Description:` Shows all your existing notes. `🪀 Command:` save <br> `✨️ Description:` Reply a message and type .save or just use .save <Your note> without replying `🪀 Command:` deleteNotes<br> `✨️ Description:` Deletes *all* your saved notes. `🪀 Command:` ocr <br> `✨️ Description:` Reads the text on the photo you have replied. `🪀 Command:` pinimg <br> `✨️ Description:` Downloas images from Pinterest. `🪀 Command:` playst <br> `✨️ Description:` Get app details from play store. `🪀 Command:` profile<br> `✨️ Description:` Profile menu. `🪀 Command:` getpp<br> `✨️ Description:` Get pofile picture. `🪀 Command:` setbio <br> `✨️ Description:` Set your about. `🪀 Command:` getbio<br> `✨️ Description:` Get user about. `🪀 Command:` archive<br> `✨️ Description:` Archive chat. `🪀 Command:` unarchive<br> `✨️ Description:` Unarchive chat. `🪀 Command:` pin<br> `✨️ Description:` Archive chat. `🪀 Command:` unpin<br> `✨️ Description:` Unarchive chat. `🪀 Command:` pp<br> `✨️ Description:` Makes the profile photo what photo you reply. `🪀 Command:` kickme<br> `✨️ Description:` It kicks you from the group you are using it in. `🪀 Command:` block <br> `✨️ Description:` Block user. `🪀 Command:` unblock <br> `✨️ Description:` Unblock user. `🪀 Command:` jid <br> `✨️ Description:` Giving user's JID. `🪀 Command:` rdmore <br> `✨️ Description:` Add readmore to your message >> Use # to get readmore. `🪀 Command:` removebg <br> `✨️ Description:` Removes the background of the photos. `🪀 Command:` report <br> `✨️ Description:` Sends reports to group admins. `🪀 Command:` roll<br> `✨️ Description:` Roll dice randomly. `🪀 Command:` scam <br> `✨️ Description:` Creates 5 minutes of fake actions. `🪀 Command:` scan <br> `✨️ Description:` Checks whether the entered number is registered on WhatApp. `🪀 Command:` trt<br> `✨️ Description:` It translates with Google Translate. You must reply any message. <br> `💡 Example:` .trt en si (From English to Sinhala) `🪀 Command:` antilink <br> `✨️ Description:` Activates the Antilink tool. <br> `💡 Example:` .antilink on / off `🪀 Command:` autobio <br> `✨️ Description:` Add live clock to your bio! <br> `💡 Example:` .autobio on / off `🪀 Command:` detectlang<br> `✨️ Description:` Guess the language of the replied message. `🪀 Command:` currency `🪀 Command:` tts <br> `✨️ Description:` It converts text to sound. `🪀 Command:` music <br> `✨️ Description:` Uploads the song you wrote. `🪀 Command:` smp3 <br> `✨️ Description:` Get song as a mp3 documet file `🪀 Command:` mp4 <br> `✨️ Description:` Downloads video from YouTube. `🪀 Command:` yt <br> `✨️ Description:` It searchs on YouTube. `🪀 Command:` wiki <br> `✨️ Description:` Searches query on Wikipedia. `🪀 Command:` img <br> `✨️ Description:` Searches for related pics on Google. `🪀 Command:` lyric <br> `✨️ Description:` Finds the lyrics of the song. `🪀 Command:` covid <br> `✨️ Description:` Shows the daily and overall covid table of more than 15 countries. `🪀 Command:` ss <br> `✨️ Description:` Takes a screenshot from the page in the given link. `🪀 Command:` simi <br> `✨️ Description:` Are you bored? ... Fool around with SimSimi. ... World first popular Chatbot for daily conversation. `🪀 Command:` spdf <br> `✨️ Description:` Site to pdf file. `🪀 Command:` insta <br> `✨️ Description:` Downloads videos or photos from Instagram. `🪀 Command:` animesay <br> `✨️ Description:` It writes the text inside the banner the anime girl is holding `🪀 Command:` changesay <br> `✨️ Description:` Turns the text into the change my mind poster. `🪀 Command:` trumpsay <br> `✨️ Description:` Converts the text to Trump's tweet. `🪀 Command:` audio spam<br> `✨️ Description:` Sends the replied audio as spam. `🪀 Command:` foto spam<br> `✨️ Description:` Sends the replied photo as spam. `🪀 Command:` sticker spam<br> `✨️ Description:` Convert the replied photo or video to sticker and send it as spam. `🪀 Command:` vid spam `🪀 Command:` killspam<br> `✨️ Description:` Stops spam command. `🪀 Command:` spam <br> `✨️ Description:` It spam until you stop it. ⌨️ Example: .spam test `🪀 Command:` spotify <br> `✨️ Description:` Get music details from spotify. `🪀 Command:` st<br> `✨️ Description:` It converts your replied photo or video to sticker. `🪀 Command:` sweather<br> `✨️ Description:` Gives you the weekly interpretations of space weather observations provided by the Space Weather Research Center (SWRC) for a p. `🪀 Command:` alive <br> `✨️ Description:` Does bot work? `🪀 Command:` sysd<br> `✨️ Description:` Shows the system properties. `🪀 Command:` tagadmin `🪀 Command:` tg <br> `✨️ Description:` Tags everyone in the group. `🪀 Command:` pmall<br> `✨️ Description:` Sends the replied message to all members in the group. `🪀 Command:` tblend <br> `✨️ Description:` Applies the selected TBlend effect to videos. `🪀 Command:` link<br> `✨️ Description:` The image you reply to uploads to telegra.ph and provides its link. `🪀 Command:` unvoice<br> `✨️ Description:` Converts audio to sound recording. `🪀 Command:` up<br> `✨️ Description:` Checks the update your bot. `🪀 Command:` up now<br> `✨️ Description:` It makes updates. `🪀 Command:` voicy<br> `✨️ Description:` It converts audio to text. `🪀 Command:` wp<br> `✨️ Description:` It sends high resolution wallpapers. `🪀 Command:` wame <br> `✨️ Description:` Get a link to the user chat. `🪀 Command:` weather <br> `✨️ Description:` Shows the weather. `🪀 Command:` speedtest <br> `✨️ Description:` Measures Download and Upload speed. <br> `💡 Example:` speedtest user // speedtest server `🪀 Command:` ping<br> `✨️ Description:` Measures your ping. `🪀 Command:` short <br> `✨️ Description:` Shorten the long link. `🪀 Command:` calc <br> `✨️ Description:` Performs simple math operations. `🪀 Command:` xapi<br> `✨️ Description:` Xteam API key info. `🪀 Command:` joke<br> `✨️ Description:` Send random jokes. `🪀 Command:` quote<br> `✨️ Description:` Send random quotes.
Presto412 / Google Meet Mute GestureA chrome extension to mute the audio/video based on custom gestures
guihkx / Spotishush🔇 Mutes audio ads on Spotify, Deezer, IDAGIO and Zvuk.
louiejancevski / ZoomClone📷 Zoom Clone using Socket.io, Peer.js, Nodejs, Express, and EJS. This app has a real-time messaging chat, video, and audio communication features, message timestamps, muting capabilities, and users are also able to turn off their videos anytime they want.
Mahabali / Apprtc SwiftApprtc code written in Swift 3 with Video Mute, Audio Mute, Rotation support
SKGHD / HandyConvert videos with HandBrake online in Google Colab. Mount Cloud drives with rclone in colab. Burn/Hardcode subtitles. Extract/mute audio from video. Get email notification when tasks finish running.
joer14 / Hackers DoorbellA one button device that emulates a keyboard and mutes audio to alert a headphone wearing user of another person's physical presence.
Ronald106 / Surviv.io<!doctype html> <html lang='en'> <head> <!-- Meta Properties --> <meta charset='UTF-8'> <title>surviv.io - 2d battle royale game</title> <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover, user-scalable=no"> <link rel="manifest" href="manifest.json"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-title" content="surviv.io"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="application-name" content="surviv.io"> <meta name="description" content="Like games such as Player Unknown's Battlegrounds (PUBG), Fortnite or Apex Legends? Play this free 2d battle royale io game in your browser!"> <meta property="og:description" content="Like games such as Player Unknown's Battlegrounds (PUBG), Fortnite or Apex Legends? Play this free 2d battle royale io game in your browser!"> <meta name="keywords" content="survivio, surviv, 2d battle royale, io, battle royale browser game, 2d battlegrounds, battlegrounds, battleroyale, battle, royale, browser game, br, survival, game, web game, multiplayer"> <meta property="og:type" content="website"> <meta property="og:title" content="surviv.io"> <meta property="og:url" content="/~/https://surviv.io/"> <meta property="og:site_name" content="surviv.io"> <meta content="/~/https://surviv.io/img/title.png" property="og:image"> <link rel="canonical" href="/~/https://surviv.io" /> <link rel="apple-touch-icon-precomposed" href="img/icon_app.png"> <link rel="icon" href="favicon.ico" type="image/x-icon"> <!-- Global site tag (gtag.js) - Google Analytics --> <script> window.adsBlocked = false; window.adBlockDetected = function() { window.adsBlocked = true; } window.alert = function() { } /* Cookie consent */ var cfg = {}; var consented = true; var webview = false; try { cfg = JSON.parse(localStorage.getItem('surviv_config')) || {}; if (cfg.cookiesConsented != undefined) { consented = cfg.cookiesConsented; } webview = localStorage.getItem('surviv_webview'); } catch (e) { } window.cookiesConsented = consented; if (window.cookiesConsented) { document.write("<script async src='/~/https://www.googletagmanager.com/gtag/js?id=UA-108811301-1' onerror='adBlockDetected();'>\x3C/script>"); window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-108811301-1', { 'anonymize_ip': true }); } window.webviewDetected = new RegExp("[?&]webview=true","gi").test(window.location.href) || webview; </script> <!-- AIP --> <script> document.write("<script async src='/~/https://api.adinplay.com/libs/aiptag/pub/SRV/surviv.io/tag.min.js'>\x3C/script>"); var aiptag = aiptag || {}; aiptag.gdprConsent = window.cookiesConsented; aiptag.consented = window.cookiesConsented; aiptag.cmd = aiptag.cmd || []; aiptag.cmd.display = aiptag.cmd.display || []; </script> <!-- Fonts --> <link href="/~/https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700" rel="stylesheet"> <link href="css/app.dacc77a5.css" rel="stylesheet"><meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/> </head> <body> <div id='preroll-wrapper'> <div id="preroll"></div> </div> <div id="fb-root"></div> <canvas tabindex='1' id='cvs'></canvas> <div id='game-area-wrapper' style='display: none' oncontextmenu='return false;'> <div id='game-touch-area'></div> <!-- Class Select --> <div id='ui-role-menu-wrapper'> <div id='ui-role-menu'> <div id='ui-role-header'></div> <div id='ui-role-body'></div> <div id='ui-role-footer'> <div id='ui-role-footer-desc' data-l10n='game-select-class'>SELECT A CLASS</div> <div id='ui-role-footer-enter'>ENTER GAME (20)</div> </div> </div> </div> <div id='ui-game' class='click-through'> <div id='tablet-console'></div> <div id='ui-center'> <div id='ui-game-menu'> <div id='btn-game-tabs' class='btns-game-double-row'> <div class='btn-game-container'> <a id='btn-game-settings' class='btn-game-tab-select btn-game-menu btn-game-menu-selected btn-darken' data-tab='settings'></a> <div class='btn-double-row game-menu-icon-static settings-icon'></div> </div> <div class='btn-game-container'> <a id='btn-game-keybinds' class='btn-game-tab-select btn-game-menu btn-darken' data-tab='keybinds'></a> <div class='btn-double-row game-menu-icon-static keybind-icon'></div> </div> </div> <div id='ui-game-tab-settings' class='ui-game-tab'> <a id='btn-game-fullscreen' class='btn-fullscreen-toggle btn-game-menu btn-darken' data-l10n='game-full-screen'>Full Screen</a> <div id='btn-touch-styles' class='btns-game-double-row'> <div class='btn-game-container'> <a id='btn-game-move-style' class='btn-double-row btn-game-touch-style btn-darken'></a> <div class='btn-double-row game-menu-icon-toggle movement-icon'></div> </div> <div class='btn-game-container'> <a id='btn-game-aim-style' class='btn-double-row btn-game-touch-style btn-darken'></a> <div class='btn-double-row game-menu-icon-toggle target-icon'></div> </div> </div> <a id='btn-game-aim-line' class='btn-game-menu btn-darken locked-on-icon' data-l10n='game-aim-line'>Aim Line</a> <a id='btn-game-sound' class='btn-sound-toggle btn-game-menu btn-darken audio-on-icon' data-l10n='game-sound'>Sound</a> <div class="slider-container ui-slider-container"> <p class='slider-text' data-l10n='index-master-volume'>Master Volume</p> <input type="range" min="0" max="100" value="100" class="slider sl-master-volume"> </div> <div class="slider-container ui-slider-container"> <p class='slider-text' data-l10n='index-sfx-volume'>SFX Volume</p> <input type="range" min="0" max="100" value="100" class="slider sl-sound-volume"> </div> <div class="slider-container ui-slider-container"> <p class='slider-text' data-l10n='index-music-volume'>Music Volume</p> <input type="range" min="0" max="100" value="100" class="slider sl-music-volume"> </div> <a id='btn-game-quit' class='btn-quit btn-game-menu btn-darken' data-l10n='game-quit-game'>Quit Game</a> </div> <div id='ui-game-tab-keybinds' class='ui-game-tab'> <div id='ui-keybind-list' class='js-keybind-list'></div> <a class='js-btn-keybind-restore btn-keybind-restore btn-game-menu btn-darken' data-l10n='game-restore-defaults'>Restore Defaults</a> </div> <a id='btn-game-resume' class='btn-game-menu btn-darken' data-l10n='game-return-to-game'>Return to Game</a> </div> </div> <div id='big-map' class='js-ui-map-show'> <div id='big-map-collision'></div> <div id='big-map-close'></div> </div> <div id='ui-emotes' class='ui-emote-wheel'> <div id='ui-emote-middle' class='ui-emote-middle ui-emote-circle ui-emote-parent' data-key='middle' data-id='0'> <div class='ui-emote ui-emote-bg-circle'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-large'></div> </div> <div id='ui-emote-top' class='ui-emote-top ui-emote-quarter ui-emote-parent' data-key='top' data-id='1'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-large'></div> </div> <div id='ui-emote-right' class='ui-emote-right ui-emote-quarter ui-emote-parent' data-key='right' data-id='2'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-large'></div> </div> <div id='ui-emote-bottom' class='ui-emote-bottom ui-emote-quarter ui-emote-parent' data-key='bottom' data-id='3'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-large'></div> </div> <div id='ui-emote-left' class='ui-emote-left ui-emote-quarter ui-emote-parent' data-key='left' data-id='4'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-large'></div> </div> </div> <div id='ui-team-pings' class='ui-emote-wheel'> <div id='ui-team-ping-middle' class='ui-emote-middle ui-emote-circle ui-emote-parent' data-id='0'> <div class='ui-emote ui-emote-bg-circle'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-large'></div> </div> <div id='ui-team-ping-top' class='ui-emote-top ui-emote-quarter ui-emote-parent' data-id='1'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-large'></div> </div> <div id='ui-team-ping-right' class='ui-emote-right ui-emote-quarter ui-emote-parent' data-id='2'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-large'></div> </div> <div id='ui-team-ping-bottom' class='ui-emote-bottom ui-emote-quarter ui-emote-parent' data-id='3'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-large'></div> </div> <div id='ui-team-ping-bottom-left' class='ui-emote-bottom-left ui-emote-eighth ui-emote-parent' data-id='4'> <div class='ui-emote ui-emote-bg-eighth'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-small'></div> </div> <div id='ui-team-ping-top-left' class='ui-emote-top-left ui-emote-eighth ui-emote-parent' data-id='5'> <div class='ui-emote ui-emote-bg-eighth'></div> <div class='ui-emote ui-emote-hl'></div> <div class='ui-emote-image ui-emote-image-small'></div> </div> </div> <div id='ui-team-indicators' class='js-ui-map-hidden js-desktop-ui-hud-show'> <div class='ui-team-indicator ui-indicator-main' data-id='0'> <div class='ui-team-indicator-pos ui-background-yellow'></div> </div> <div class='ui-team-indicator ui-indicator-main' data-id='1'> <div class='ui-team-indicator-pos ui-background-purple'></div> </div> <div class='ui-team-indicator ui-indicator-main' data-id='2'> <div class='ui-team-indicator-pos ui-background-cyan'></div> </div> <div class='ui-team-indicator ui-indicator-main' data-id='3'> <div class='ui-team-indicator-pos ui-background-orange'></div> </div> <div class='ui-team-indicator ui-indicator-main' data-id='4'> <div class='ui-team-indicator-pos ui-background-yellow'></div> </div> <div class='ui-team-indicator ui-indicator-ping' data-id='0'> <div class='ui-team-indicator-pos ui-team-indicator-image'></div> </div> <div class='ui-indicator-ping-border' data-id='0'></div> <div class='ui-team-indicator ui-indicator-ping' data-id='1'> <div class='ui-team-indicator-pos ui-team-indicator-image'></div> </div> <div class='ui-indicator-ping-border' data-id='1'></div> <div class='ui-team-indicator ui-indicator-ping' data-id='2'> <div class='ui-team-indicator-pos ui-team-indicator-image'></div> </div> <div class='ui-indicator-ping-border' data-id='2'></div> <div class='ui-team-indicator ui-indicator-ping' data-id='3'> <div class='ui-team-indicator-pos ui-team-indicator-image'></div> </div> <div class='ui-indicator-ping-border' data-id='3'></div> <div class='ui-team-indicator ui-indicator-ping' data-id='4'> <div class='ui-team-indicator-pos ui-team-indicator-image'></div> </div> <div class='ui-indicator-ping-border' data-id='4'></div> </div> <div id='ui-right-center' class='ui-right-center-desktop js-ui-map-hidden'> <div id='ui-medical-interactive'> <div id='ui-loot-bandage' class='ui-loot ui-outline-hover ui-scale-hover ui-medical tooltip'> <div class='tooltip-text'> <div class='tooltip-title' data-l10n='game-bandage'>Bandage</div> <div class='tooltip-description'><span data-l10n='game-bandage-tooltip'>Left-click to restore 15 health.</span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> </div> <div id='ui-loot-healthkit' class='ui-loot ui-outline-hover ui-scale-hover ui-medical tooltip'> <div class='tooltip-text'> <div class='tooltip-title' data-l10n='game-healthkit'>Med Kit</div> <div class='tooltip-description'><span data-l10n='game-healthkit-tooltip'>Left-click to restore 100 health.</div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> </div> <div id='ui-loot-soda' class='ui-loot ui-outline-hover ui-scale-hover ui-medical tooltip'> <div class='tooltip-text'> <div class='tooltip-title' data-l10n='game-soda'>Soda</div> <div class='tooltip-description'><span data-l10n='game-soda-tooltip'>Left-click to boost adrenaline by 25.</span><br><span data-l10n='game-adrenaline-tooltip'>Adrenaline restores health over time.</span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> </div> <div id='ui-loot-chocolateBox' class='ui-loot ui-outline-hover ui-scale-hover ui-medical tooltip'> <div class='tooltip-text'> <div class='tooltip-title' data-l10n='game-chocolateBox'>ChocolateBox</div> <div class='tooltip-description'><span data-l10n='game-soda-tooltip'>Left-click to boost adrenaline by 25.</span><br><span data-l10n='game-adrenaline-tooltip'>Adrenaline restores health over time.</span><br><span data-l10n='game-chocolateBox-tooltip'>Inmune to frenemy effect for 20s.</span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> </div> <div id='ui-loot-painkiller' class='ui-loot ui-outline-hover ui-scale-hover ui-medical tooltip'> <div class='tooltip-text'> <div class='tooltip-title' data-l10n='game-painkiller'>Pills</div> <div class='tooltip-description'><span data-l10n='game-painkiller-tooltip'>Left-click to boost adrenaline by 50.</div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> </div> <div id='ui-loot-flask' class='ui-loot ui-outline-hover ui-scale-hover ui-medical tooltip'> <div class='tooltip-text'> <div class='tooltip-title' data-l10n='game-flask'>Flask</div> <div class='tooltip-description'><span data-l10n='game-flask-tooltip'>Left-click for freeze damage immunity for 20 seconds.</span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> </div> </div> <div id='ui-ammo-interactive'> <div id='ui-loot-50AE' class='ui-outline-hover ui-ammo tooltip'> <div class='tooltip-text click-through'> <div class='tooltip-title' data-l10n='game-50AE'></div> <div class='tooltip-description'><span data-l10n='game-50AE-tooltip'></span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> <div class='ui-loot-overlay' style='background: rgba(30,30,30,0.75)'></div> </div> <div id='ui-loot-9mm' class='ui-outline-hover ui-ammo tooltip'> <div class='tooltip-text click-through'> <div class='tooltip-title' data-l10n='game-9mm'></div> <div class='tooltip-description'><span data-l10n='game-9mm-tooltip'></span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> <div class='ui-loot-overlay' style='background: rgba(255,153,0,0.75)'></div> </div> <div id='ui-loot-308sub' class='ui-outline-hover ui-ammo tooltip'> <div class='tooltip-text click-through'> <div class='tooltip-title' data-l10n='game-308sub'></div> <div class='tooltip-description'><span data-l10n='game-308sub-tooltip'></span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> <div class='ui-loot-overlay' style='background: rgba(49,56,0,0.75)'></div> </div> <div id='ui-loot-12gauge' class='ui-outline-hover ui-ammo tooltip'> <div class='tooltip-text click-through'> <div class='tooltip-title' data-l10n='game-12gauge'></div> <div class='tooltip-description'><span data-l10n='game-12gauge-tooltip'></span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> <div class='ui-loot-overlay' style='background: rgba(255,0,0,0.75)'></div> </div> <div id='ui-loot-flare' class='ui-outline-hover ui-ammo tooltip'> <div class='tooltip-text click-through'> <div class='tooltip-title' data-l10n='game-flare'></div> <div class='tooltip-description'><span data-l10n='game-flare-tooltip'></span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> <div class='ui-loot-overlay' style='background: rgba(255,85,0,0.75)'></div> </div> <div id='ui-loot-762mm' class='ui-outline-hover ui-ammo tooltip'> <div class='tooltip-text click-through'> <div class='tooltip-title' data-l10n='game-762mm'></div> <div class='tooltip-description'><span data-l10n='game-762mm-tooltip'></span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> <div class='ui-loot-overlay' style='background: rgba(0,102,255,0.75)'></div> </div> <div id='ui-loot-45acp' class='ui-outline-hover ui-ammo tooltip'> <div class='tooltip-text click-through'> <div class='tooltip-title' data-l10n='game-45acp'></div> <div class='tooltip-description'><span data-l10n='game-45acp-tooltip'></span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> <div class='ui-loot-overlay' style='background: rgba(121,0,255,0.75)'></div> </div> <div id='ui-loot-556mm' class='ui-outline-hover ui-ammo tooltip'> <div class='tooltip-text click-through'> <div class='tooltip-title' data-l10n='game-556mm'></div> <div class='tooltip-description'><span data-l10n='game-556mm-tooltip'></span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> <div class='ui-loot-overlay' style='background: rgba(3,123,0,0.75)'></div> </div> <div id='ui-loot-40mm' class='ui-outline-hover ui-ammo tooltip'> <div class='tooltip-text click-through'> <div class='tooltip-title' data-l10n='game-40mm'></div> <div class='tooltip-description'><span data-l10n='game-40mm-tooltip'></span></div> </div> <div class='ui-loot-count'>0</div> <img class='ui-loot-image' src=''></img> <div class='ui-loot-overlay' style='background: rgba(12,221,171,0.75)'></div> </div> </div> <div id='ui-emote-button'></div> </div> <div id='ui-top-left' class='js-ui-hud-show click-through'> <div id='ui-team' class='js-ui-mobile-map-hidden'> <div class='ui-team-member ui-bg-standard' data-id='0'> <div class='ui-team-member-name'></div> <div class='ui-team-member-color ui-background-yellow'></div> <div class='ui-team-member-status'></div> <div class='ui-team-member-health'> <div class='ui-bar-inner ui-health-actual'></div> </div> </div> <div class='ui-team-member ui-bg-standard' data-id='1'> <div class='ui-team-member-name'></div> <div class='ui-team-member-color ui-background-purple'></div> <div class='ui-team-member-status'></div> <div class='ui-team-member-health'> <div class='ui-bar-inner ui-health-actual'></div> </div> </div> <div class='ui-team-member ui-bg-standard' data-id='2'> <div class='ui-team-member-name'></div> <div class='ui-team-member-color ui-background-cyan'></div> <div class='ui-team-member-status'></div> <div class='ui-team-member-health'> <div class='ui-bar-inner ui-health-actual'></div> </div> </div> <div class='ui-team-member ui-bg-standard' data-id='3'> <div class='ui-team-member-name'></div> <div class='ui-team-member-color ui-background-orange'></div> <div class='ui-team-member-status'></div> <div class='ui-team-member-health'> <div class='ui-bar-inner ui-health-actual'></div> </div> </div> </div> </div> <div id='ui-map-wrapper' class='ui-map-wrapper-desktop click-through'> <div id='ui-map-container'> <div id='ui-map-info' class='js-ui-map-hidden js-ui-hud-show'> <div id='ui-gas-icon' class='gas-icon'></div> <div id='ui-gas-timer'></div> </div> <div id='ui-spec-counter' class='js-ui-map-hidden js-ui-hud-show'> <div id='ui-spec-counter-icon'></div> <div id='ui-spec-counter-number'></div> </div> <div id='ui-settings-container-desktop' class='js-ui-desktop-map-hidden'> <div id='ui-map-expand-desktop' class='ui-map-expand ui-settings-button'> <img id='mag-glass-white' src=''></img> </div> <div id='ui-map-minimize' class='ui-settings-button js-ui-map-hidden'> <img id='ui-minimize-img' src=''></img> </div> </div> <div id='ui-settings-container-mobile' class='js-ui-mobile-map-hidden'> <div id='ui-alive-info'> <div id='ui-alive-icon' class='ui-map-icon alive-icon'></div> <div id='ui-map-counter-default' class='js-ui-players-alive'>0</div> <div id='ui-map-counter-faction'> <span class='ui-players-alive-red js-ui-players-alive-red'>0</span>:<span class='ui-players-alive-blue js-ui-players-alive-blue'>0</span> </div> </div> <div id='ui-map-expand-mobile' class='ui-map-expand ui-settings-button'></div> </div> </div> </div> <div id='ui-menu-display' class='ui-settings-button prop-event'></div> <div id='ui-kill-leader-container'> <div id='ui-kill-leader-wrapper' class='js-ui-map-hidden js-ui-hud-show hide-on-mobile'> <div id='ui-kill-leader-name'>Waiting for new leader</div> <div id='ui-kill-leader-icon'></div> <div id='ui-kill-leader-count'>0</div> </div> </div> <div id='ui-killfeed-wrapper'> <div id='ui-killfeed' class='js-ui-map-hidden js-ui-hud-show'> <div id='ui-killfeed-contents'></div> </div> </div> <div id='ui-leaderboard-wrapper'> <div id='ui-leaderboard' class='js-ui-hud-show'> <div id='ui-leaderboard-alive'> <span class='ui-players-alive js-ui-players-alive'>0</span> </div> <div id='ui-leaderboard-alive-faction'> <span class='ui-players-alive-red js-ui-players-alive-red'>0</span> <span class='ui-players-alive-blue js-ui-players-alive-blue'>0</span> </div> <div class='ui-leaderboard-header' data-l10n='game-alive'>Alive</div> </div> <div id='ui-kill-counter-wrapper' class='js-ui-map-show'> <div id='ui-kill-counter'> <span class='ui-player-kills js-ui-player-kills'>0</span> </div> <div class='ui-kill-counter-header' data-l10n='game-kills'>Kills</div> </div> </div> <div id='ui-top-center-scopes-wrapper'> <div id='ui-top-center-scopes' class='click-through js-ui-map-hidden'> <div id='ui-scope-1xscope' class='ui-scope ui-zoom'> <div class='ui-zoom-text'> <div class='ui-zoom-level'>1<span class='ui-zoom-append'>x</span></div> </div> </div> <div id='ui-scope-2xscope' class='ui-scope ui-zoom ui-outline-hover'> <div class='ui-zoom-text'> <div class='ui-zoom-level'>2<span class='ui-zoom-append'>x</span></div> </div> </div> <div id='ui-scope-4xscope' class='ui-scope ui-zoom ui-outline-hover'> <div class='ui-zoom-text'> <div class='ui-zoom-level'>4<span class='ui-zoom-append'>x</span></div> </div> </div> <div id='ui-scope-8xscope' class='ui-scope ui-zoom ui-outline-hover'> <div class='ui-zoom-text'> <div class='ui-zoom-level'>8<span class='ui-zoom-append'>x</span></div> </div> </div> <div id='ui-scope-15xscope' class='ui-scope ui-zoom ui-outline-hover'> <div class='ui-zoom-text'> <div class='ui-zoom-level'>15<span class='ui-zoom-append'>x</span></div> </div> </div> </div> </div> <div id='ui-top-center' class='js-ui-map-hidden js-ui-hud-show click-through'> <div id='ui-waiting-text' class='top-center-text'><span data-l10n='game-waiting-for-players'>Waiting for players</span>...</div> <div id='ui-spectate-text' class='top-center-text ui-spectate-mode'> <div class='spectate-text spectate-desc' data-l10n='game-spectating'>Spectating</div> <div id='spectate-player' class='spectate-text'></div> </div> </div> <div id='ui-upper-center' class='click-through'> <div id='ui-announcement'></div> </div> <div id='ui-upper-center-1' class='click-through'> <div id='ui-pickup-notification'> <div id='ui-pickup-description'>Item picked up</div> </div> </div> <div id='ui-lower-center' class='js-ui-map-hidden js-ui-hud-show click-through'> <div id='ui-interaction'> <div id='ui-interaction-press'></div> <div id='ui-interaction-outer'> <div id='ui-interaction-description'></div> </div> </div> </div> <div id='ui-bottom-center-2' class='click-through'> <div id='ui-pickup-message' class='notify-message'></div> <div id='ui-perk-message-wrapper' class='notify-message'> <div id='ui-perk-message-image-wrapper'> <div id='ui-perk-message-image-icon'></div> </div> <div id='ui-perk-message-name' class='notify-message'></div> <div id='ui-perk-message-acquired' class='notify-message'></div> </div> </div> <div id='ui-equipped-ammo-wrapper' class='js-ui-map-hidden js-ui-hud-show'> <div id='ui-equipped-ammo'> <div id='ui-bullet-counter'> <div id='ui-current-clip'>0</div> <div id='ui-remaining-ammo'>0</div> <div id='ui-reload-button-container'> <div id='ui-reload-button'></div> </div> </div> </div> </div> <div id='ui-bottom-center-0' class='click-through js-ui-map-hidden js-ui-hud-show'> <div id='ui-boost-counter'> <div class='ui-boost-base' id='ui-boost-counter-0'> <div class='ui-bar-inner'></div> </div> <div class='ui-boost-base' id='ui-boost-counter-1'> <div class='ui-bar-inner'></div> </div> <div class='ui-boost-base' id='ui-boost-counter-2'> <div class='ui-bar-inner'></div> </div> <div class='ui-boost-base' id='ui-boost-counter-3'> <div class='ui-bar-inner'></div> </div> </div> <div id='ui-health-counter'> <div id='ui-health-flair-left' class='ui-health-flair'></div> <div id='ui-health-flair-right' class='ui-health-flair'></div> <div id='ui-health-container'> <div class='ui-bar-inner' id='ui-health-actual'></div> <div class='ui-bar-inner' id='ui-health-depleted'></div> </div> </div> </div> <div id='ui-bottom-center-left' class='js-ui-map-hidden'> <div id='ui-perk-0' class='ui-armor-counter tooltip-perk ui-outline-hover'> <div class='tooltip-text'> <div class='tooltip-title'></div> <div class='tooltip-desc'></div> </div> <img class='ui-armor-image ui-loot-image' src=''></img> </div> <div id='ui-perk-1' class='ui-armor-counter tooltip-perk ui-outline-hover'> <div class='tooltip-text'> <div class='tooltip-title'></div> <div class='tooltip-desc'></div> </div> <img class='ui-armor-image ui-loot-image' src=''></img> </div> <div id='ui-perk-2' class='ui-armor-counter tooltip-perk ui-outline-hover'> <div class='tooltip-text'> <div class='tooltip-title'></div> <div class='tooltip-desc'></div> </div> <img class='ui-armor-image ui-loot-image' src=''></img> </div> </div> <div id='ui-bottom-center-right' class='js-ui-map-hidden'> <div id='ui-armor-helmet' class='ui-armor-counter ui-outline-hover'> <div class='ui-armor-counter-inner'></div> <div class='ui-armor-level'></div> <img class='ui-armor-image ui-loot-image' src=''></img> </div> <div id='ui-armor-chest' class='ui-armor-counter ui-outline-hover'> <div class='ui-armor-counter-inner'></div> <div class='ui-armor-level'></div> <img class='ui-armor-image ui-loot-image' src=''></img> </div> <div id='ui-armor-backpack' class='ui-armor-counter'> <div class='ui-armor-counter-inner'></div> <div class='ui-armor-level'></div> <img class='ui-armor-image ui-loot-image' src=''></img> </div> </div> <div id='ui-bottom-right' class='js-ui-map-hidden'> <div id='ui-weapon-container'> <div class='ui-weapon-info'> <div class='ui-weapon-switch ui-outline-hover' id='ui-weapon-id-1' data-slot='1'> <div class='ui-weapon-name'></div> <div class='ui-weapon-number'>1</div> <img class='ui-weapon-image' src=''></img> </div> </div> <div class='ui-weapon-info'> <div class='ui-weapon-switch ui-outline-hover' id='ui-weapon-id-2' data-slot='2'> <div class='ui-weapon-name'></div> <div class='ui-weapon-number'>2</div> <img class='ui-weapon-image' src=''></img> </div> </div> <div class='ui-weapon-info'> <div class='ui-weapon-switch ui-outline-hover' id='ui-weapon-id-3'> <div class='ui-weapon-name'></div> <div class='ui-weapon-number'>3</div> <img class='ui-weapon-image' src=''></img> </div> </div> <div class='ui-weapon-info'> <div class='ui-weapon-switch ui-outline-hover' id='ui-weapon-id-4'> <div class='ui-weapon-name'></div> <div class='ui-weapon-number'>4</div> <div class='ui-weapon-exp ui-weapon-ammo-counter'>0</div> <img class='ui-weapon-image' src=''></img> </div> </div> </div> </div> <div id='ui-spectate-options-wrapper'> <div id='ui-spectate-options' class='ui-spectate-mode js-ui-hud-show click-through'> <div id='ui-spectate-buttons' class='ui-bg-standard'> <a class='menu-option btn-darken' id='btn-spectate-next-player' data-l10n='game-next-teammate'>Next Teammate</a> <a class='menu-option btn-darken' id='btn-spectate-prev-player' data-l10n='game-previous-teammate'>Previous Teammate</a> <a class='menu-option btn-darken' id='btn-spectate-view-stats' data-l10n='game-view-match-stats'>View Match Stats</a> <a class='menu-option btn-darken btn-quit' id='btn-spectate-quit' data-l10n='game-leave-game'>Leave Game</a> </div> <div id='ui-spectate-stats' class='ui-bg-standard'> <div id='ui-spectate-stats-header' data-l10n='game-your-results'>Your Results</div> <table id='ui-spectate-stats-table'> <tbody id='ui-spectate-stats-data'> </tbody> </table> </div> </div> </div> <div id='ui-bottom-center-1' class='click-through'> <div id='ui-kills'> <div id='ui-kill-text'></div> <div id='ui-kill-count'></div> </div> </div> </div> <div id='ui-stats'> <div id='ui-stats-bg'></div> <div id='ui-stats-contents'> <div id='ui-stats-contents-inner'> <div id='ui-stats-header'></div> <div id='ui-stats-info-box'></div> <div id='ui-stats-options'></div> <div id='ui-stats-logo'></div> </div> <div id='ui-stats-ad-container-desktop' class='ui-stats-ad-container'> <div id='surviv-io_300x250_2'></div> </div> <div id='ui-stats-ad-container-mobile' class='ui-stats-ad-container'> <div id='surviv-io_300x250_mobile_2'></div> </div> </div> </div> <div class='ui-stats-adblock surviv-shirts'> <a class='surviv-shirts-link' href='/~/https://www.amazon.com/s?rh=n%3A7141123011%2Cp_4%3Asurviv.io&ref=w_bl_sl_s_ap_web_7141123011' target="_blank"></a> </div> <div class='ui-stats-adblock adblock-plea'> <span>Please consider supporting us by disabling your adblocker.</span> </div> </div> <div id='start-menu-wrapper'> <div id='safari-margin'></div> <div id='background'> <div id='start-overlay'></div> </div> <div id='event-modal'> <div id='modal-container'> <p id='modal-header' data-l10n='index-modal-test'>(HEADER TEXT)</p> <img id='modal-img-1'> <div id='modal-content'> <img id='modal-img-2'> <p id='modal-text' data-l10n='event-desc'>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tincidunt dui ut ornare lectus sit amet est.</p> </div> <button class='close' id='modal-btn' data-l10n='modal-btn-txt' type='button'>(BUTTON TEXT)</button> </div> </div> <div id='start-main'> <div id='start-top-left'> <div id='btn-hamburger' class='icon-hamburger'></div> <div id='start-top-left-desktop'> <div id='featured-streamers'> <div class='streaming-header'> <div id='streaming-header-title' data-l10n='index-streaming-live'>Streaming Live!</div> <div id='streaming-icon'></div> </div> <div class='streamer-list'></div> <div id='featured-streamer-template'> <a href='' target='_blank' class='btn-streamer btn-darken'></a> </div> </div> <div id='featured-youtuber'> <div class='youtube-header'> <div id='youtube-header-title' data-l10n='index-featured-youtuber'>Featured YouTuber</div> </div> <a href='' target='_blank' class='btn-youtuber btn-darken'></a> </div> </div> </div> <!-- Accounts Modals --> <div id='modal-account-name-change' class='modal modal-account'> <div class='modal-content modal-close'> <div class='modal-header modal-header-name'> <span class='close close-corner'></span> <h2 id='modal-account-name-title' data-l10n='index-create-account'>Create Account</h2> </div> <div class='modal-body modal-body-name'> <div class='modal-settings-item'> <p id='modal-account-name-desc' class='modal-body-text' data-l10n='index-set-account-name'>Set your account name:</p> <div id='modal-body-warning'></div> <input type='text' class='menu-option player-name-input' tabindex='0' placeholder='Enter name' id='modal-account-name-input' maxlength='16' /> </div> </div> <div class='modal-footer modal-footer-name modal-footer-round'> <h3 id='modal-account-name-finish' class='finish' data-l10n='index-finish'>Finish</h3> </div> </div> </div> <div id='modal-account-reset-stats' class='modal modal-account'> <div class='modal-content modal-close'> <div class='modal-header modal-header-reset-stats'> <span class='close close-corner'></span> <h2 id='modal-account-name-title' data-l10n='index-reset-stats'>Reset Stats</h2> </div> <div class='modal-body modal-body-reset-stats'> <div class='modal-settings-item'> <p id='modal-account-reset-stats-desc' class='modal-body-text' data-l10n='index-reset-stats-desc'>Enter "RESET STATS" to reset your stats:</p> <p id='modal-account-reset-stats-desc-2' class='modal-body-text' data-l10n='index-reset-stats-desc-2'>(This does not reset pass progress.)</p> <input type='text' class='menu-option player-name-input' tabindex='0' placeholder='' id='modal-account-reset-stats-input' maxlength='16' /> </div> </div> <div class='modal-footer modal-footer-reset-stats modal-footer-round'> <h3 id='modal-account-reset-stats-finish' class='finish' data-l10n='index-confirm'>Confirm</h3> </div> </div> </div> <div id='modal-account-delete' class='modal modal-account'> <div class='modal-content modal-close'> <div class='modal-header modal-header-delete'> <span class='close close-corner'></span> <h2 id='modal-account-name-title' data-l10n='index-delete-account'>Delete Account</h2> </div> <div class='modal-body modal-body-delete'> <div class='modal-settings-item'> <p id='modal-account-delete-desc' class='modal-body-text' data-l10n='index-delete-account-desc'>Enter "DELETE" to delete your account:</p> <input type='text' class='menu-option player-name-input' tabindex='0' placeholder='' id='modal-account-delete-input' maxlength='16' /> </div> </div> <div class='modal-footer modal-footer-delete modal-footer-round'> <h3 id='modal-account-delete-finish' class='finish' data-l10n='index-confirm'>Confirm</h3> </div> </div> </div> <!-- Accounts Mobile --> <div id='modal-mobile-account' class='modal'> <div class='modal-content modal-close'> <div class='modal-header'> <span class='close close-corner'></span> <h2 data-l10n='index-account' data-l10n='index-account'>Account</h2> </div> <div id='modal-mobile-account-body'> <div class='account-buttons-settings account-buttons-wrapper account-block-arrow modal-close'> <div class='account-buttons'> <div class='account-stats-link btn-player-stats-link menu-option btn-darken btn-standard ' data-l10n='index-my-stats'>My Stats</div> <div class='btn-account-link btn-account-turq menu-option btn-darken btn-standard' data-l10n='index-link-account'>Link Account</div> <div class='btn-account-change-name btn-account-turq menu-option btn-darken btn-standard' data-l10n='index-change-account-name'>Change Account Name</div> <div class='btn-account-reset-stats btn-account-turq menu-option btn-darken btn-standard' data-l10n='index-reset-stats'>Reset Stats</div> <div class='btn-account-delete btn-account-turq menu-option btn-darken btn-standard' data-l10n='index-delete-account'>Delete Account</div> <div class='btn-account-logout btn-account-grey menu-option btn-darken btn-standard' data-l10n='index-log-out'>Log Out</div> </div> </div> <div id='account-login-options-mobile' class='account-buttons-link-account account-buttons-wrapper account-block-arrow modal-close'> <div class='login-options-content'></div> </div> </div> </div> </div> <!-- Accounts --> <div id='start-top-right'> <div class='account-block'> <div class='account-details-top'> <div class="account-details-top-buttons"> <div class="account-details-button-wrapper account-details-button-loadout menu-option btn-darken-alt"> <div class='account-details-button'> <div id='loadout-alert-main' class='account-alert-main account-alert'></div> <div class='account-link account-loadout-link'> <span data-l10n='index-loadout'>Loadout</span> </div> </div> </div> <div class="account-details-button-wrapper account-details-link-out menu-option btn-darken hide-on-mobile"> <div class='account-details-button'> <div class='account-link account-stats-link'><span data-l10n='index-my-stats'>My Stats</span></div> </div> </div> <div class="account-details-button-wrapper account-details-link-out menu-option btn-darken hide-on-mobile"> <div class='account-details-button'> <div class='account-link account-leaderboard-link'><span data-l10n='index-leaderboards'>Leaderboards</span></div> </div> </div> </div> </div> <div class='account-overview'> <div class="account-details-user account-details-block"> <div class="account-details"> <div class="account-avatar"></div> <div id="account-login" class="account-player-name account-name account-name-user" data-l10n='index-log-in-desc'>Log In / Create Account</div> <div id="account-player-name" class="account-player-name account-name account-name-user" style="display:none"></div> <div class="account-loading-container"> <div class="account-loading"></div> </div> </div> </div> </div> <div class='account-buttons-settings account-buttons-wrapper account-block-arrow modal-close hide-on-mobile'> <div class='account-buttons'> <div class='btn-account-link btn-account-turq menu-option btn-darken btn-standard' data-l10n='index-link-account'>Link Account</div> <div class='btn-account-change-name btn-account-turq menu-option btn-darken btn-standard' data-l10n='index-change-account-name'>Change Account Name</div> <div class='btn-account-reset-stats btn-account-turq menu-option btn-darken btn-standard' data-l10n='index-reset-stats'>Reset Stats</div> <div class='btn-account-delete btn-account-turq menu-option btn-darken btn-standard' data-l10n='index-delete-account'>Delete Account</div> <div class='btn-account-logout btn-account-grey menu-option btn-darken btn-standard' data-l10n='index-log-out'>Log Out</div> </div> </div> <div id='account-login-options' class='account-buttons-link-account account-buttons-wrapper account-block-arrow modal-close hide-on-mobile'> <div class='login-options-content'></div> </div> </div> </div> <div id='start-main-center'> <div id='start-row-header'> <div id='server-warning'></div> </div> <div id='start-row-top'> <div id='start-rotate-reminder' class='menu-column menu-block'> <span>Rotate to landscape for a better experience.</span> </div> <div id='left-column' class='menu-column'> <div id='ad-block-left'> <div class='surviv-shirts'> <a href='/~/https://www.amazon.com/s?rh=n%3A7141123011%2Cp_4%3Asurviv.io&ref=w_bl_sl_s_ap_web_7141123011' target="_blank"></a> </div> <div class='adblock-plea'> <span>Please consider supporting us by disabling your adblocker.</span> </div> <div class='ad-block-med-rect' id='surviv-io_300x250'> </div> </div> <div id='social-share-block-wrapper'> <div id='social-share-block' class='menu-block'> <div class='btn-social-wrapper'> <a href='/~/https://facebook.com/surviviogame' target='_blank' class='btn-social btn-darken btn-facebook'></a> <a href='/~/https://twitter.com/survivio' target='_blank' class='btn-social btn-darken btn-twitter'></a> <a href='/~/https://www.instagram.com/surviviogame/' target='_blank' class='btn-social btn-darken btn-instagram'></a> <a href='/~/https://discord.gg/survivio' target='_blank' class='btn-social btn-darken btn-discord'></a> <a href='/~/https://www.youtube.com/c/survivio?sub_confirmation=1' target='_blank' class='btn-social btn-darken btn-youtube'></a> </div> </div> </div> </div> <div id='start-menu' class='menu-column menu-block'> <div class='play-loading-outer'> <div class='play-loading-inner'> <div class='play-loading-spinner'></div> </div> </div> <div class='play-button-container'> <div id='player-options'> <input type='text' class='menu-option player-name-input' tabindex='0' placeholder='Enter your name here' id='player-name-input-solo' maxlength='16' /> <a class='btn-darken menu-option player-options-btn' id='btn-customize'></a> </div> <select id='server-select-main' class='server-select menu-option btn-hollow btn-hollow-selected'> <optgroup id='server-opts' label='Region' data-l10n='index-region'> <option value='na' data-label='North America' data-l10n='index-north-america'>North America</option> <option value='sa' data-label='South America' data-l10n='index-south-america'>South America</option> <option value='eu' data-label='Europe' data-l10n='index-europe'>Europe</option> <option value='as' data-label='Asia' data-l10n='index-asia'>Asia</option> <option value='kr' data-label='Korea' data-l10n='index-korea'>South Korea</option> </optgroup> </select> <a class='btn-green btn-darken menu-option' id='btn-start-mode-0' data-l10n='index-play-solo'>Play Solo</a> <div id='btns-quick-start'> <a class='btn-green btn-darken menu-option' id='btn-start-mode-1' data-l10n='index-play-duo'>Play Duo</a> <a class='btn-green btn-darken menu-option' id='btn-start-mode-2' data-l10n='index-play-squad'>Play Squad</a> </div> <div class='btns-double-row'> <a class='btn-darken menu-option btn-team-option' id='btn-join-team' data-l10n='index-join-team'>Join Team</a> <a class='btn-darken menu-option btn-team-option' id='btn-create-team' data-l10n='index-create-team'>Create Team</a> </div> <div id='btn-help' class='menu-option btn-darken' data-l10n='index-how-to-play'>How to Play</div> <div id='start-help'> <h1 data-l10n='index-controls'>Controls</h1> <p><span class='help-action' data-l10n='index-movement'></span>: <span class='help-control' data-l10n='index-movement-ctrl'></span></p> <p><span class='help-action' data-l10n='index-aim'></span>: <span class='help-control' data-l10n='index-aim-ctrl'></span></p> <p><span class='help-action' data-l10n='index-punch'></span>/<span class='help-action' data-l10n='index-shoot'></span>: <span class='help-control' data-l10n='index-shoot-ctrl'></span></p> <p><span class='help-action' data-l10n='index-change-weapons'></span>: <span class='help-control' data-l10n='index-change-weapons-ctrl'></span></p> <p class='hide-on-mobile'><span class='help-action' data-l10n='index-stow-weapons'></span>: <span class='help-control' data-l10n='index-stow-weapons-ctrl'></span></p> <p class='hide-on-mobile'><span class='help-action' data-l10n='index-swap-weapons'></span>: <span class='help-control' data-l10n='index-swap-weapons-ctrl'></span></p> <p class='hide-on-mobile'><span class='help-action' data-l10n='index-swap-weapon-slots'></span>: <span class='help-control' data-l10n='index-swap-weapon-slots-ctrl'></span></p> <p><span class='help-action' data-l10n='index-reload'></span>: <span class='help-control' data-l10n='index-reload-ctrl'></span></p> <p><span class='help-action' data-l10n='index-scope-zoom'></span>: <span class='help-control' data-l10n='index-scope-zoom-ctrl'></span></p> <p><span class='help-action' data-l10n='index-pickup'></span>/<span class='help-action' data-l10n='index-loot'></span>/<span class='help-action' data-l10n='index-revive'></span>: <span class='help-control' data-l10n='index-pickup-ctrl'></span></p> <p><span class='help-action' data-l10n='index-use-medical'></span>: <span class='help-control' data-l10n='index-use-medical-ctrl'></span></p> <p><span class='help-action' data-l10n='index-drop-item'></span>: <span class='help-control' data-l10n='index-drop-item-ctrl'></span></p> <p><span class='help-action' data-l10n='index-cancel-action'></span>: <span class='help-control' data-l10n='index-cancel-action-ctrl'></span></p> <p><span class='help-action' data-l10n='index-view-map'></span>: <span class='help-control' data-l10n='index-view-map-ctrl'></span></p> <p class='hide-on-mobile'><span class='help-action' data-l10n='index-toggle-minimap'></span>: <span class='help-control' data-l10n='index-toggle-minimap-ctrl'></span></p> <p><span class='help-action' data-l10n='index-use-ping'></span>: <span class='help-control' data-l10n='index-use-ping-ctrl'></span></p> <p><span class='help-action' data-l10n='index-use-emote'></span>: <span class='help-control' data-l10n='index-use-emote-ctrl'></span></p> <h1 data-l10n='index-how-to-play'>How to Play</h1> <p data-l10n='index-tips-1-desc'>The goal of surviv.io is to be the last player standing. You only live once per game - there is no respawn!</p> <h1 data-l10n='index-tips-2'>2D PUBG</h1> <p data-l10n='index-tips-2-desc'>If you've played other battle royale games like PUBG, Fortnite or H1Z1, then you're already halfway there! Think of surviv.io as 2D PUBG (with slightly less desync and more chicken).</p> <h1 data-l10n='index-tips-3'>Loot and Kill</h1> <p data-l10n='index-tips-3-desc'>You'll begin the game with no items other than a simple backpack. Move around the map to find loot: weapons, ammo, scopes, and medical items. Eliminate other players and you can take their loot!</p> <h1 data-l10n='index-tips-4'>Red = Bad!</h1> <p data-l10n='index-tips-4-desc'>Players aren't the only thing that can hurt you. The deadly red zone will move in from the sides of the map and deal increasingly greater damage if you stand in it. Keep an eye on the map and stay safe.</p> </div> </div> </div> <div id='team-menu' class='menu-column menu-block'> <div class='play-loading-outer'> <div class='play-loading-inner'> <div class='play-loading-spinner'></div> </div> </div> <div class='play-button-container'> <a class='btn-darken menu-option' id='btn-team-leave' data-l10n='index-leave-team'>Leave Team</a> <div id='team-menu-connecting'> <div class='ui-spinner'></div> <div class='team-menu-connecting-text' id='team-menu-joining-text'><span data-l10n='index-joining-team'>Joining team</span> ...</div> <div class='team-menu-connecting-text' id='team-menu-creating-text'><span data-l10n='index-creating-team'>Creating team</span> ...</div> </div> <div id='team-menu-contents'> <div id='team-desc'> <div id='team-desc-text'><span id='invite-link-text' data-l10n='index-invite-link'>Invite link</span>: <span id='team-url'></span> </div> <a id='team-copy-url' class='copy-item btn-darken'></a> <a id='team-hide-url' class='hide-item btn-darken'></a> <div id='team-code-text'><span id='invite-code-text' data-l10n='index-invite-code'>Invite code</span>: <span id='team-code'></span></div> </div> <div id='team-menu-columns'> <div id='team-menu-members' class='team-menu-block'> <div id='team-menu-member-list'></div> </div> <div id='team-menu-options' class='team-menu-block'> <select id='team-server-select' class='btn-hollow btn-hollow-selected server-select menu-option'> <optgroup id='team-server-opts' label='Region'> <option value='na' data-label='North America' data-l10n='index-north-america'>North America</option> <option value='sa' data-label='South America' data-l10n='index-south-america'>South America</option> <option value='eu' data-label='Europe' data-l10n='index-europe'>Europe</option> <option value='as' data-label='Asia' data-l10n='index-asia'>Asia</option> <option value='kr' data-label='Korea' data-l10n='index-korea'>South Korea</option> </optgroup> </select> <div class='team-menu-options-buttons'> <a class='btn-hollow btn-hollow-selected btn-darken team-menu-option btn-team-queue' id='btn-team-queue-mode-1' data-l10n='index-duo'>Duo</a> <a class='btn-hollow btn-hollow-selected btn-darken team-menu-option btn-team-queue' id='btn-team-queue-mode-2' data-l10n='index-squad'>Squad</a> </div> <div class='team-menu-options-buttons'> <a class='btn-hollow btn-hollow-selected btn-darken team-menu-option btn-team-fill' id='btn-team-fill-auto' data-l10n='index-auto-fill'>Auto Fill</a> <a class='btn-hollow btn-darken team-menu-option btn-team-fill' id='btn-team-fill-none' data-l10n='index-no-fill'>No Fill</a> </div> <div id='team-menu-options-start'> <a class='btn-green btn-darken menu-option' id='btn-start-team' data-label='Play' data-l10n='index-play'>Play</a> <div id='msg-wait-reason'></div> </div> </div> </div> </div> </div> </div> <div id='team-mobile-link' class='menu-column menu-block'> <div id='team-mobile-link-desc' class='team-mobile-link-text' data-l10n='index-join-team-help'>Got a team link or code? Paste it here:</div> <div id='team-mobile-link-warning' class='team-mobile-link-text'>Invalid link!</div> <input type='text' class='menu-option' contenteditable="false" tabindex='0' autofocus placeholder='Paste team link or enter code here' id='team-link-input' /> <a class='btn-darken menu-option btn-team-option' id='btn-team-mobile-link-join' data-l10n='index-join-team'>Join Team</a> <a class='btn-darken menu-option' id='btn-team-mobile-link-leave' data-l10n='index-back-to-main'>Back to Main Menu</a> </div> <div id='right-column' class='menu-column'> <div id='pass-wrapper'> <div id='pass-unlock-tooltip'> <div class='tooltip-pass-title'></div> <div class='tooltip-pass-desc'></div> </div> <div class='right-column-toggle news-toggle'> <div class='account-alert'></div> </div> <div id='pass-loading' class='pass-column menu-block'> <div id='pass-loading-spinner'></div> </div> <div id='pass-block' class='pass-column menu-block'> <div id='pass-name'> <span id='pass-name-text'></span> </div> <div id='pass-progress' class=''> <div id='pass-progress-level' class=''></div> <div id='pass-progress-bar' class=''> <div id='pass-progress-bar-fill'></div> <div id='pass-progress-xp'> <span id='pass-progress-xp-current'></span> <span>/</span> <span id='pass-progress-xp-target'></span> <span>XP</span> </div> </div> <div id='pass-progress-unlock-wrapper'> <div id='pass-progress-unlock' class=''> <div id='pass-progress-unlock-image' class=''></div> </div> <div id='pass-progress-unlock-type-wrapper' class=''> <div id='pass-progress-unlock-type-border' class=''> <div id='pass-progress-unlock-type-image' class=''></div> </div> <div id='pass-progress-unlock-overlay' class=''></div> </div> </div> </div> <div id='pass-quest-wrapper' class=''> <div id='pass-locked'> <div id='btn-pass-locked' class='menu-option btn-darken' data-l10n='quest-login-prompt'>Log in to get quests!</div> </div> <div id='pass-quest-0' class='pass-quest'> <div class='pass-quest-timer'></div> <div class='pass-quest-spinner-container'> <div class='pass-quest-spinner'></div> </div> <div class='pass-quest-refresh-prompt'> <div class='pass-quest-refresh-prompt-text' data-l10n='quest-refresh-prompt'>Get a new quest?</div> <div class='pass-quest-refresh-confirm btn-pass-quest-refresh'></div> <div class='pass-quest-refresh-cancel btn-pass-quest-refresh'></div> </div> <div class='pass-quest-info'> <div class='pass-quest-desc'></div> <div class='pass-quest-xp'></div> <div class='pass-quest-refresh'></div> <div class='pass-quest-progress'> <div class='pass-quest-bar'> <div class='pass-quest-bar-fill'></div> </div> <div class='pass-quest-counter'> <span class='pass-quest-counter-current'></span> <span>/</span> <span class='pass-quest-counter-target'></span> </div> </div> </div> </div> <div id='pass-quest-1' class='pass-quest'> <div class='pass-quest-timer'></div> <div class='pass-quest-spinner-container'> <div class='pass-quest-spinner'></div> </div> <div class='pass-quest-refresh-prompt'> <div class='pass-quest-refresh-prompt-text' data-l10n='quest-refresh-prompt'>Get a new quest?</div> <div class='pass-quest-refresh-confirm btn-pass-quest-refresh'></div> <div class='pass-quest-refresh-cancel btn-pass-quest-refresh'></div> </div> <div class='pass-quest-info'> <div class='pass-quest-desc'></div> <div class='pass-quest-xp'></div> <div class='pass-quest-refresh'></div> <div class='pass-quest-progress'> <div class='pass-quest-bar'> <div class='pass-quest-bar-fill'></div> </div> <div class='pass-quest-counter'> <span class='pass-quest-counter-current'></span> <span>/</span> <span class='pass-quest-counter-target'></span> </div> </div> </div> </div> </div> </div> </div> <div id='news-wrapper'> <div class='right-column-toggle pass-toggle'></div> <div id='news-block' class='menu-block'> <div id='news'> <h3 class='news-header'>What's New!</h3> <div id='news-current' data-date='2020-2-24'> <small class='news-date'>February 24, 2020</small> <p class='news-paragraph'><strong>Curveball</strong></p> <p class='news-paragraph'>The <span class='highlight'>Savannah</span> has returned with a new perk to help flush snipers out of position.</p> <p class='news-paragraph'>The <span class='highlight'>Closer Perk</span> throws grenades much farther, allowing you to put Snipers on the move.</p> </div> <div data-date='2020-2-10'> <small class='news-date'>February 10, 2020</small> <p class='news-paragraph'><strong>Keep Your Enemies Closer</strong></p> <p class='news-paragraph'>PARMA recognizes this season of togetherness and generously offers to help rivals resolve their differences. The all new <span class='highlight'>Heart Cannon</span> diffuses damage taken from your frenemies. For groups of future friends, the same effect is achieved with the all-new <span class='highlight'>Heart Grenade</span>.</p> <p class='news-paragraph'>If you do not trust the intentions of your new friends, eat an entire <span class='highlight'>box of chocolates</span> to counter the effect of <span class='highlight'>Heart Weapons</span>.</p> </div> <div data-date='2020-1-27'> <small class='news-date'>January 27, 2020</small> <p class='news-paragraph'><strong>Dodge This</strong></p> <p class='news-paragraph'><span class='highlight'>Woods</span> Mode is back with two new weapons and things are bound to get explosive. The <span class='highlight'>PKM</span> and <span class='highlight'>Hawk 12G</span> join the Woods Map arsenal, along with increased grenade capacity.</p> <p class='news-paragraph'>The <span class='highlight'>PKM</span> packs a punch while balancing mobility and range. Based on the M870 with an added magazine, the <span class='highlight'>Hawk 12G</span>'s ammo capacity of 5 is the same as its parent weapon, the fire delay is faster and fires a tighter spread. </p> </div> <div data-date='2020-1-13'> <small class='news-date'>January 13, 2020</small> <p class='news-paragraph'><strong>Stay frosty</strong></p> <p class='news-paragraph'>Winter has arrived on the Island with new features and is more dangerous than ever, including PARMA's latest item, the <span class='highlight'>Flask</span>.</p> <p class='news-paragraph'>Track your enemy's footprints and use the <span class='highlight'>Snow Fox</span> perk to cover up your footprints. Be sure to keep moving or take freezing damage. Flasks and the <span class='highlight'>Polar Bear</span> perk keep you from freezing. And watch out for ice. It's slippery.</p> </div> <div data-date='2019-12-30'> <small class='news-date'>December 30, 2019</small> <p class='news-paragraph'><strong>Free Fryer</strong></p> <p class='news-paragraph'>PARMA's FSTMS division is pleased to introduce the next generation in starch-based modern warfare: the <span class='highlight'>spud gun</span>.</p> <p class='news-paragraph'>Officially designated the SMG-8 (Spud Missile Generator), the spud gun uses a proprietary breech-to-muzzle heat expander to fry and propel wedge-shaped projectiles at tremendous speeds. Like its cousin, the potato cannon, the spud gun also features nitroglycerin-spiked ammunition and a nifty tuber replication device!</p> </div> </div> </div> </div> </div> </div> <div class='ad-block-leaderboard-bottom' id='surviv-io_728x90'></div> </div> <div id='start-bottom-left'> <div class='hide-on-mobile'> <a href='/~/https://play.google.com/store/apps/details?id=io.surviv.surviv_io_mobile' target='_blank' class='btn-download-android btn-download-app btn-darken'></a> </div> <div class='hide-on-mobile'> <a href='/~/https://itunes.apple.com/us/app/surviv-io/id1401727934?ls=1&mt=8' target='_blank' class='btn-download-ios btn-download-app btn-darken'></a> </div> <div id='mobile-settings-front'> <div class='btn-settings menu-option btn-darken btn-start-option'></div> </div> </div> <div id="start-bottom-middle"> <a href='changelog.html' target="_blank" class="footer-after">ver 0.9.1b</a> <a href='proxy.txt' target="_blank" data-l10n='index-proxy-sites'>proxy sites</a> </div> <div id='start-bottom-right-wrapper'> <div id='start-bottom-right'> <div class="language-select-wrap"> <select class='language-select'></select> </div> <div class='btn-settings menu-option btn-darken btn-start-option'></div> <div class='btn-keybind menu-option btn-darken btn-start-option'></div> <div id='btn-start-fullscreen' class='btn-fullscreen-toggle menu-option btn-darken btn-start-option'></div> <div class='btn-start-mute btn-sound-toggle menu-option btn-darken btn-start-option audio-on-icon'></div> </div> <div id='mobile-download-app'> <a href='/~/https://play.google.com/store/apps/details?id=io.surviv.surviv_io_mobile' target='_blank' class='btn-download-android btn-download-app-mobile btn-darken'></a> <a href='/~/https://itunes.apple.com/us/app/surviv-io/id1401727934?ls=1&mt=8' target='_blank' class='btn-download-ios btn-download-app-mobile btn-darken'></a> </div> </div> </div> <!-- Modals --> <div id='ui-modal-keybind' class='ui-modal-keybind modal' oncontextmenu='return false;'> <div class='ui-modal-keybind-content modal-content modal-close'> <div id='ui-modal-keybind-header' class='modal-header'> <span id='ui-close-keybind' class='close close-corner'></span> <h2 data-l10n='index-customize-keybinds'>Customize Keybinds</h2> </div> <div id='ui-modal-keybind-body' class='modal-body'> <div id='ui-modal-keybind-list' class='js-keybind-list'></div> <div id='ui-modal-keybind-share'> <div class='ui-modal-keybind-share-row'> <div class='ui-modal-keybind-share-elem'> <span data-l10n='index-keybind-link'>Share your keybinds with this code</span>: </div> <div class='ui-modal-keybind-share-elem'> <div id='keybind-link-text'> <div id='keybind-link'>aFvc42SfhpoFlrJKVkA1fx+5afasdf9034hfSF09nASqqF</div> <span id='keybind-copy' class='copy-item btn-darken'></span> </div> </div> </div> <span class='keybind-share-paste-text' data-l10n='index-keybind-paste'>Load keybinds using a code here</span><span>:</span> <div id='keybind-warning' class='link-warning'>Invalid code!</div> <div class='ui-modal-keybind-share-row'> <input type='text' class='menu-option' contenteditable="false" tabindex='0' autofocus placeholder='Paste a keybind code here' id='keybind-code-input' /> <a class='btn-game-menu btn-darken' id='btn-keybind-code-load' data-l10n='index-keybind-apply'>Load</a> </div> </div> </div> <div id='ui-modal-keybind-footer' class='modal-footer modal-footer-round'> <a class='js-btn-keybind-share btn-game-menu btn-darken' data-l10n='game-share'>Share</a> <a class='js-btn-keybind-restore btn-game-menu btn-darken' data-l10n='game-restore-defaults'>Restore Defaults</a> </div> </div> </div> <!-- Loadouts --> <div id='modal-customize' class='modal'> <div class='ad-block-loadouts-left hide-on-mobile' id='surviv-io_300x600'></div> <div id='modal-customize-wrapper' class='modal-close'> <div id='modal-content-left' class='modal-content-shadow'> <div id='modal-customize-cat-title'></div> <div id="modal-customize-sort-wrap"> <select id='modal-customize-sort'> <option id='customize-sort-newest' value='newest' data-l10n='loadout-newest'>Newest</option> <option id='customize-sort-alpha' value='alpha' data-l10n='loadout-alpha'>Alpha</option> <option id='customize-sort-rarity' value='rarity' data-l10n='loadout-rarity'>Rarity</option> <option id='customize-sort-subcat' value='subcat' data-l10n='loadout-subcat'>Category</option> </select> </div> <div id='modal-customize-close'> <span class='close close-corner'></span> </div> <div id='modal-customize-header' class='modal-header'></div> <div class='modal-disabled'> <div class='modal-disabled-message'>The Edge browser does not support custom cursors.</div> </div> <div id='modal-customize-body' class='modal-body'> <div id='modal-customize-item-header'> <div id='modal-customize-item-name'></div> <div id='modal-customize-item-rarity'></div> <div id='modal-customize-loading-container'> <div id='modal-customize-loading'></div> </div> </div> <div id='modal-customize-list'></div> </div> <div id='modal-customize-footer' class='modal-footer modal-footer-round'> <div id='modal-customize-item-source'></div> <div id='modal-customize-item-lore'></div> </div> <div id='modal-customize-unlocks' class=''> <div id='customize-instagram-follow-unlock' class='customize-social-unlock customize-social-tooltip' data-lock-reason='instagram'> <div class="tooltiptext" data-l10n='loadout-instagram-reward'></div> <a href='/~/https://www.instagram.com/surviviogame/' target="_blank" id='btn-instagram-follow-unlock' class='menu-option btn-darken btn-social-unlock btn-instagram' data-lock-reason='instagram' data-l10n='loadout-instagram-follow'></a> </div> <div id='customize-youtube-subscribe-unlock' class='customize-social-unlock customize-social-tooltip' data-lock-reason='youtube'> <div class="tooltiptext" data-l10n='loadout-youtube-reward'></div> <a href='/~/https://www.youtube.com/c/survivio?sub_confirmation=1' target='_blank' id='btn-youtube-subscribe-unlock' class='menu-option btn-darken btn-social-unlock btn-youtube' data-lock-reason='youtube' data-l10n='loadout-youtube-subscribe'></a> </div> <div id='customize-twitter-follow-unlock' class='customize-social-unlock customize-social-tooltip' data-lock-reason='twitter'> <div class="tooltiptext" data-l10n='loadout-twitter-reward'></div> <a href='/~/https://twitter.com/intent/follow?region=follow_link&screen_name=survivio&tw_p=followbutton' target="_blank" id='btn-twitter-follow-unlock' class='menu-option btn-darken btn-social-unlock btn-twitter' data-lock-reason='twitter' data-l10n='loadout-twitter-follow'></a> </div> <div id='customize-facebook-like-unlock' class='customize-social-unlock customize-social-tooltip' data-lock-reason='facebook'> <div class="tooltiptext" data-l10n='loadout-facebook-reward'></div> <a href='/~/https://www.facebook.com/surviviogame/' target='_blank' id='btn-facebook-like-unlock' class='menu-option btn-darken btn-social-unlock btn-facebook' data-lock-reason='facebook' data-l10n='loadout-facebook-like'></a> </div> </div> </div> <div id='modal-content-right-crosshair' class='modal-content-right modal-content-shadow'> <div class='modal-spacer'></div> <div class='modal-disabled'></div> <div id='customize-crosshair-parent'> <div id='customize-crosshair-selected'> <div class="customize-item-image customize-crosshair-image" draggable="false"></div> </div> <div id='customize-crosshair-sliders'> <div class="crosshair-hex-outer"> <span>#</span><input type="text" id='color-picker-hex'> </div> <section id="color-picker"></section> <div class="crosshair-slider-container"> <p class='' data-l10n='loadout-size'>Size</p> <input type="range" min="0.25" max="1.0" value="0.5" step='0.025' class="crosshair-slider" id="crosshair-size"> </div> <div class="crosshair-slider-container"> <p class='' data-l10n='loadout-stroke'>Stroke</p> <input type="range" min="0.0" max="1.5" value="0.0" step='0.025' class="crosshair-slider" id="crosshair-stroke"> </div> </div> </div> </div> <div id='modal-content-right-emote' class='modal-content-right modal-content-shadow'> <div id='customize-emote-parent'> <div id='customize-emote-wheel' class='ui-emote-wheel'> <div id='customize-emote-middle' class='ui-emote-middle ui-emote-circle ui-emote-parent'> <div class='ui-emote ui-emote-bg-circle'></div> <div class='ui-emote ui-emote-hl'></div> <div class='customize-emote-slot customize-item-image ui-emote-image'></div> </div> <div id='customize-emote-top' class='ui-emote-top ui-emote-quarter ui-emote-parent' data-slot='emoteTop' data-idx='0'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='customize-emote-slot customize-item-image ui-emote-image'></div> <div class='customize-col customize-col-small' draggable="true"></div> </div> <div id='customize-emote-right' class='ui-emote-right ui-emote-quarter ui-emote-parent' data-slot='emoteRight' data-idx='1'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='customize-emote-slot customize-item-image ui-emote-image'></div> <div class='customize-col customize-col-small' draggable="true"></div> </div> <div id='customize-emote-bottom' class='ui-emote-bottom ui-emote-quarter ui-emote-parent' data-slot='emoteBottom' data-idx='2'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='customize-emote-slot customize-item-image ui-emote-image'></div> <div class='customize-col customize-col-small' draggable="true"></div> </div> <div id='customize-emote-left' class='ui-emote-left ui-emote-quarter ui-emote-parent' data-slot='emoteLeft' data-idx='3'> <div class='ui-emote ui-emote-bg-quarter'></div> <div class='ui-emote ui-emote-hl'></div> <div class='customize-emote-slot customize-item-image ui-emote-image'></div> <div class='customize-col customize-col-small' draggable="true"></div> </div> </div> <div id='customize-emote-autos'> <div id='customize-emote-win' class='ui-emote-middle ui-emote-circle ui-emote-parent' data-slot='emoteWin' data-idx='4'> <div class='ui-emote ui-emote-auto-trash'></div> <div class='ui-emote ui-emote-auto-icon ui-emote-auto-chicken'></div> <div class='ui-emote ui-emote-bg-circle-outer'></div> <div class='ui-emote ui-emote-bg-circle'></div> <div class='ui-emote ui-emote-hl'></div> <div class='customize-emote-slot customize-item-image'></div> <div class='customize-col customize-col-large' draggable="true"></div> </div> <div id='customize-emote-death' class='ui-emote-middle ui-emote-circle ui-emote-parent' data-slot='emoteDeath' data-idx='5'> <div class='ui-emote ui-emote-auto-trash'></div> <div class='ui-emote ui-emote-auto-icon ui-emote-auto-skull'></div> <div class='ui-emote ui-emote-bg-circle-outer'></div> <div class='ui-emote ui-emote-bg-circle'></div> <div class='ui-emote ui-emote-hl'></div> <div class='customize-emote-slot customize-item-image'></div> <div class='customize-col customize-col-large' draggable="true"></div> </div> </div> </div> </div> </div> </div> <div id='modal-settings' class='modal'> <div class='modal-content modal-close'> <div class='modal-header'> <span class='close close-corner'></span> <h2 data-l10n='index-settings'>Settings</h2> </div> <div id='modal-settings-body' class='modal-body'> <div id='language-select-mobile-wrapper' class='modal-settings-item'> <div class="language-select-wrap"> <select class='language-select'></select> </div> </div> <div id='modal-settings-high-res' class='modal-settings-item'> <input id='highResTex' type='checkbox'><p class='modal-settings-checkbox-text' data-l10n='index-high-resolution'>High resolution (check to increase visual quality)</p> </div> <div class='modal-settings-item hide-on-mobile'> <input id='screenShake' type='checkbox'><p class='modal-settings-checkbox-text' data-l10n='index-screen-shake'>Screen shake</p> </div> <div class='modal-settings-item'> <input id='anonPlayerNames' type='checkbox'><p class='modal-settings-checkbox-text' data-l10n='index-anon-player-names'>Anonymize player names</p> </div> <div class='modal-settings-item dpad'> <input id='activateDpad' type='checkbox'><p class='modal-settings-checkbox-text' data-l10n='index-left-mode'>Left handed mode </p> </div> <div class='modal-settings-item auto-melee'> <input id='autoMelee' type='checkbox'><p class='modal-settings-checkbox-text' data-l10n='index-auto-melee'>Auto Melee Boxes</p> </div> <div class='modal-settings-item aim-assist'> <input id='aimAssist' type='checkbox'><p class='modal-settings-checkbox-text' data-l10n='index-aim-assist'>Aim Assist</p> </div> <div class="modal-settings-item slider-container main-volume-slider"> <p class='modal-slider-text' data-l10n='index-master-volume'>Master Volume</p> <input type="range" min="0" max="100" value="50" class="slider sl-master-volume" id=""> </div> <div class="modal-settings-item slider-container main-volume-slider"> <p class='modal-slider-text' data-l10n='index-sfx-volume'>SFX Volume</p> <input type="range" min="0" max="100" value="50" class="slider sl-sound-volume" id=""> </div> <div class="modal-settings-item slider-container main-volume-slider"> <p class='modal-slider-text' data-l10n='index-music-volume'>Music Volume</p> <input type="range" min="0" max="100" value="50" class="slider sl-music-volume" id=""> </div> <div class="modal-settings-item slider-container slider-dpad"> <p class='modal-slider-text' data-l10n='index-sensitivy'>Analog Sensitivity</p> <input type="range" min="0" max="100" value="100" class="slider" id="sensitivity-slider"> </div> <div id='settings-links'> <a href='#' class="btn-cookie-settings footer-after">cookie settings</a> <a href='privacy.html' target="_blank" class="footer-after" data-l10n='index-privacy'>privacy</a> <a href='attribution.txt' target="_blank" class="footer-after" data-l10n='index-attributions'>attributions</a> <a href='hof.html' target="_blank" data-l10n='index-hof'>HOF</a> </div> </div> <div class='modal-footer'></div> </div> </div> <div id='modal-hamburger' class='modal'> <div class='modal-content modal-close'> <div class='modal-header'> <span class='close close-hamburger icon-hamburger'></span> <h2> </h2> </div> <div id='modal-hamburger-body' class='modal-body'> <div id='modal-hamburger-leaderboards'> <a href='/~/https://surviv.io/stats' target='_blank' id="btn-mobile-to-stats" class='btn-leaderboard-stats-link menu-option btn-darken' data-l10n='index-leaderboards'>Leaderboards</a> </div> <div class='modal-divider'></div> <div class='btn-social-wrapper'> <a href='/~/https://facebook.com/surviviogame' target='_blank' class='btn-social btn-darken btn-facebook'></a> <a href='/~/https://twitter.com/survivio' target='_blank' class='btn-social btn-darken btn-twitter'></a> <a href='/~/https://www.instagram.com/surviviogame/' target='_blank' class='btn-social btn-darken btn-instagram'></a> <a href='/~/https://discord.gg/survivio' target='_blank' class='btn-social btn-darken btn-discord'></a> <!-- <a href='/~/https://www.youtube.com/c/survivio?sub_confirmation=1' target='_blank' class='btn-social btn-darken btn-youtube'></a> --> </div> <div class='modal-divider'></div> <div id='modal-hamburger-bottom'> <a href='changelog.html' class="footer-after">ver 0.9.1b</a> <a href='#' class="btn-cookie-settings footer-after">cookie settings</a> <a href='privacy.txt' target="_blank" class="footer-after">privacy</a> <a href='attribution.txt' target="_blank">attributions</a> </div> </div> </div> </div> <div id='modal-notification' class='modal'> <div class='modal-content modal-close'> <div class='modal-header'> <span class='close close-corner'></span> <h2>Alert</h2> </div> <div class='modal-body'> <p class='modal-body-text'></p> </div> <div class='modal-footer modal-footer-round'> <h3 class='close close-footer'>OK</h3> </div> </div> </div> <div id='modal-refresh' class='modal'> <div class='modal-content modal-close'> <div class='modal-header'> <span class='close close-corner'></span> <h2>New Update</h2> </div> <div class='modal-body'> <p class='modal-body-text'>A new version of surviv.io is available!<br><br>Press "OK" below to reload the page.</p> </div> <div class='modal-footer modal-footer-round'> <h3 id='force-refresh' class='close close-footer'>OK</h3> </div> </div> </div> <div id='modal-create-account' class='modal modal-account'> <div class='modal-content modal-close'> <div class='modal-header modal-header-name'> <span class='close-loadouts close close-corner'></span> <h2 id='modal-account-name-title' data-l10n='index-log-in-desc'>Log In / Create Account</h2> </div> <div class='modal-body modal-body-name'> <p class='modal-body-text' data-l10n='index-create-account-prompt-1'>Log in to access this feature!</p> <div class='login-options-content'></div> </div> <div class='modal-footer modal-footer-name modal-footer-round'> <h3 class='close close-footer' data-l10n='index-cancel'>Cancel</h3> </div> </div> </div> <div id='modal-screen-block'> <div id='modal-item-confirm' class='modal'> <div class='modal-content modal-close'> <div class='modal-header modal-header-name'> <h2 id='modal-account-name-title'>You got a new item!</h2> </div> <div class='modal-body modal-body-name'> <div id='modal-item-confirm-image-outer'> <div id='modal-item-confirm-image-inner'></div> </div> <div class='modal-settings-item'> <p id='modal-item-confirm-name' class='modal-body-text'></p> </div> </div> <div class='modal-footer modal-footer-name modal-footer-round'> <h3 class='close close-footer' data-l10n='index-confirm'>Confirm</h3> </div> </div> </div> </div> <div id='modal-cookie-settings' class='modal'> <div class='modal-content modal-close'> <div class='modal-header'> <span class='close close-corner'></span> <h2>Cookie Settings</h2> </div> <div class='modal-body'> <p class='modal-body-text'>We use cookies to personalize content and ads, to provide social media features, and to analyze our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you've provided to them or that they've collected from your use of their services. You consent to our cookies if you continue to use our website. Click <a href='#' id='btn-cookie-opt-out' class='close'>here</a> to opt out of using cookies.</p> </div> <div class='modal-footer modal-footer-round'> <h3 class='close close-footer'><div class='btn-cookies-close btn-darken'>Got it!</div></h3> </div> </div> </div> </div> <script type="text/javascript" src="js/manifest.8e62061f.js"></script><script type="text/javascript" src="js/vendor.bd007df0.js"></script><script type="text/javascript" src="js/app.55f8f3a9.
rainavyas / Prepend Acoustic AttackPrepend universal audio attack segment to mute Whisper
mmguero / Monkeyplugmonkeyplug is a little script to mute profanity in audio files
sommd / Auto MuteAutomatically mute or unmute your media volume based on the type of audio playing for Android 8.0 and up.
Rynkll696 / HHimport pyttsx3 import speech_recognition as sr import datetime from datetime import date import calendar import time import math import wikipedia import webbrowser import os import smtplib import winsound import pyautogui import cv2 from pygame import mixer from tkinter import * import tkinter.messagebox as message from sqlite3 import * conn = connect("voice_assistant_asked_questions.db") conn.execute("CREATE TABLE IF NOT EXISTS `voicedata`(id INTEGER PRIMARY KEY AUTOINCREMENT,command VARCHAR(201))") conn.execute("CREATE TABLE IF NOT EXISTS `review`(id INTEGER PRIMARY KEY AUTOINCREMENT, review VARCHAR(50), type_of_review VARCHAR(50))") conn.execute("CREATE TABLE IF NOT EXISTS `emoji`(id INTEGER PRIMARY KEY AUTOINCREMENT,emoji VARCHAR(201))") global query engine = pyttsx3.init('sapi5') voices = engine.getProperty('voices') engine.setProperty('voice', voices[0].id) def speak(audio): engine.say(audio) engine.runAndWait() def wishMe(): hour = int(datetime.datetime.now().hour) if hour >= 0 and hour<12: speak("Good Morning!") elif hour >= 12 and hour < 18: speak("Good Afternoon!") else: speak("Good Evening!") speak("I am voice assistant Akshu2020 Sir. Please tell me how may I help you.") def takeCommand(): global query r = sr.Recognizer() with sr.Microphone() as source: print("Listening...") r.pause_threshold = 0.9 audio = r.listen(source) try: print("Recognizing...") query = r.recognize_google(audio,language='en-in') print(f"User said: {query}\n") except Exception as e: #print(e) print("Say that again please...") #speak('Say that again please...') return "None" return query def calculator(): global query try: if 'add' in query or 'edi' in query: speak('Enter a number') a = float(input("Enter a number:")) speak('Enter another number to add') b = float(input("Enter another number to add:")) c = a+b print(f"{a} + {b} = {c}") speak(f'The addition of {a} and {b} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'sub' in query: speak('Enter a number') a = float(input("Enter a number:")) speak('Enter another number to subtract') b = float(input("Enter another number to subtract:")) c = a-b print(f"{a} - {b} = {c}") speak(f'The subtraction of {a} and {b} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'mod' in query: speak('Enter a number') a = float(input("Enter a number:")) speak('Enter another number') b = float(input("Enter another number:")) c = a%b print(f"{a} % {b} = {c}") speak(f'The modular division of {a} and {b} is equal to {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'div' in query: speak('Enter a number as dividend') a = float(input("Enter a number:")) speak('Enter another number as divisor') b = float(input("Enter another number as divisor:")) c = a/b print(f"{a} / {b} = {c}") speak(f'{a} divided by {b} is equal to {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'multi' in query: speak('Enter a number') a = float(input("Enter a number:")) speak('Enter another number to multiply') b = float(input("Enter another number to multiply:")) c = a*b print(f"{a} x {b} = {c}") speak(f'The multiplication of {a} and {b} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'square root' in query: speak('Enter a number to find its sqare root') a = float(input("Enter a number:")) c = a**(1/2) print(f"Square root of {a} = {c}") speak(f'Square root of {a} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'square' in query: speak('Enter a number to find its sqare') a = float(input("Enter a number:")) c = a**2 print(f"{a} x {a} = {c}") speak(f'Square of {a} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'cube root' in query: speak('Enter a number to find its cube root') a = float(input("Enter a number:")) c = a**(1/3) print(f"Cube root of {a} = {c}") speak(f'Cube root of {a} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'cube' in query: speak('Enter a number to find its sqare') a = float(input("Enter a number:")) c = a**3 print(f"{a} x {a} x {a} = {c}") speak(f'Cube of {a} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'fact' in query: try: n = int(input('Enter the number whose factorial you want to find:')) fact = 1 for i in range(1,n+1): fact = fact*i print(f"{n}! = {fact}") speak(f'{n} factorial is equal to {fact}. Your answer is {fact}.') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: #print(e) speak('I unable to calculate its factorial.') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'power' in query or 'raise' in query: speak('Enter a number whose power you want to raised') a = float(input("Enter a number whose power to be raised :")) speak(f'Enter a raised power to {a}') b = float(input(f"Enter a raised power to {a}:")) c = a**b print(f"{a} ^ {b} = {c}") speak(f'{a} raise to the power {b} = {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'percent' in query: speak('Enter a number whose percentage you want to calculate') a = float(input("Enter a number whose percentage you want to calculate :")) speak(f'How many percent of {a} you want to calculate?') b = float(input(f"Enter how many percentage of {a} you want to calculate:")) c = (a*b)/100 print(f"{b} % of {a} is {c}") speak(f'{b} percent of {a} is {c}. Your answer is {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'interest' in query: speak('Enter the principal value or amount') p = float(input("Enter the principal value (P):")) speak('Enter the rate of interest per year') r = float(input("Enter the rate of interest per year (%):")) speak('Enter the time in months') t = int(input("Enter the time (in months):")) interest = (p*r*t)/1200 sint = round(interest) fv = round(p + interest) print(f"Interest = {interest}") print(f"The total amount accured, principal plus interest, from simple interest on a principal of {p} at a rate of {r}% per year for {t} months is {p + interest}.") speak(f'interest is {sint}. The total amount accured, principal plus interest, from simple interest on a principal of {p} at a rate of {r}% per year for {t} months is {fv}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'si' in query: speak('Enter the angle in degree to find its sine value') a = float(input("Enter the angle:")) b = a * 3.14/180 c = math.sin(b) speak('Here is your answer.') print(f"sin({a}) = {c}") speak(f'sin({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'cos' in query: speak('Enter the angle in degree to find its cosine value') a = float(input("Enter the angle:")) b = a * 3.14/180 c = math.cos(b) speak('Here is your answer.') print(f"cos({a}) = {c}") speak(f'cos({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'cot' in query or 'court' in query: try: speak('Enter the angle in degree to find its cotangent value') a = float(input("Enter the angle:")) b = a * 3.14/180 c = 1/math.tan(b) speak('Here is your answer.') print(f"cot({a}) = {c}") speak(f'cot({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: print("infinity") speak('Answer is infinity') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'tan' in query or '10' in query: speak('Enter the angle in degree to find its tangent value') a = float(input("Enter the angle:")) b = a * 3.14/180 c = math.tan(b) speak('Here is your answer.') print(f"tan({a}) = {c}") speak(f'tan({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'cosec' in query: try: speak('Enter the angle in degree to find its cosecant value') a = float(input("Enter the angle:")) b = a * 3.14/180 c =1/ math.sin(b) speak('Here is your answer.') print(f"cosec({a}) = {c}") speak(f'cosec({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: print('Infinity') speak('Answer is infinity') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'caus' in query: try: speak('Enter the angle in degree to find its cosecant value') a = float(input("Enter the angle:")) b = a * 3.14/180 c =1/ math.sin(b) speak('Here is your answer.') print(f"cosec({a}) = {c}") speak(f'cosec({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: print('Infinity') speak('Answer is infinity') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') elif 'sec' in query: try: speak('Enter the angle in degree to find its secant value') a = int(input("Enter the angle:")) b = a * 3.14/180 c = 1/math.cos(b) speak('Here is your answer.') print(f"sec({a}) = {c}") speak(f'sec({a}) = {c}') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: print('Infinity') speak('Answer is infinity') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') except Exception as e: speak('I unable to do this calculation.') speak('Do you want to do another calculation?') query = takeCommand().lower() if 'y' in query: speak('ok which calculation you want to do?') query = takeCommand().lower() calculator() else: speak('ok') def callback(r,c): global player if player == 'X' and states[r][c] == 0 and stop_game == False: b[r][c].configure(text='X',fg='blue', bg='white') states[r][c] = 'X' player = 'O' if player == 'O' and states[r][c] == 0 and stop_game == False: b[r][c].configure(text='O',fg='red', bg='yellow') states[r][c] = 'O' player = 'X' check_for_winner() def check_for_winner(): global stop_game global root for i in range(3): if states[i][0] == states[i][1]== states[i][2]!=0: b[i][0].config(bg='grey') b[i][1].config(bg='grey') b[i][2].config(bg='grey') stop_game = True root.destroy() for i in range(3): if states[0][i] == states[1][i] == states[2][i]!= 0: b[0][i].config(bg='grey') b[1][i].config(bg='grey') b[2][i].config(bg='grey') stop_game = True root.destroy() if states[0][0] == states[1][1]== states[2][2]!= 0: b[0][0].config(bg='grey') b[1][1].config(bg='grey') b[2][2].config(bg='grey') stop_game = True root.destroy() if states[2][0] == states[1][1] == states[0][2]!= 0: b[2][0].config(bg='grey') b[1][1].config(bg='grey') b[0][2].config(bg='grey') stop_game = True root.destroy() def sendEmail(to,content): server = smtplib.SMTP('smtp.gmail.com', 587) server.ehlo() server.starttls() server.login('xyz123@gmail.com','password') server.sendmail('xyz123@gmail.com',to,content) server.close() def brightness(): try: query = takeCommand().lower() if '25' in query: pyautogui.moveTo(1880,1050) pyautogui.click() time.sleep(1) pyautogui.moveTo(1610,960) pyautogui.click() pyautogui.moveTo(1880,1050) pyautogui.click() speak('If you again want to change brihtness, say, change brightness') elif '50' in query: pyautogui.moveTo(1880,1050) pyautogui.click() time.sleep(1) pyautogui.moveTo(1684,960) pyautogui.click() pyautogui.moveTo(1880,1050) pyautogui.click() speak('If you again want to change brihtness, say, change brightness') elif '75' in query: pyautogui.moveTo(1880,1050) pyautogui.click() time.sleep(1) pyautogui.moveTo(1758,960) pyautogui.click() pyautogui.moveTo(1880,1050) pyautogui.click() speak('If you again want to change brihtness, say, change brightness') elif '100' in query or 'full' in query: pyautogui.moveTo(1880,1050) pyautogui.click() time.sleep(1) pyautogui.moveTo(1835,960) pyautogui.click() pyautogui.moveTo(1880,1050) pyautogui.click() speak('If you again want to change brihtness, say, change brightness') else: speak('Please select 25, 50, 75 or 100....... Say again.') brightness() except exception as e: #print(e) speak('Something went wrong') def close_window(): try: if 'y' in query: pyautogui.moveTo(1885,10) pyautogui.click() else: speak('ok') pyautogui.moveTo(1000,500) except exception as e: #print(e) speak('error') def whatsapp(): query = takeCommand().lower() if 'y' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('whatsapp') time.sleep(2) pyautogui.press('enter') time.sleep(2) pyautogui.moveTo(100,140) pyautogui.click() speak('To whom you want to send message,.....just write the name here in 5 seconds') time.sleep(7) pyautogui.moveTo(120,300) pyautogui.click() time.sleep(1) pyautogui.moveTo(800,990) pyautogui.click() speak('Say the message,....or if you want to send anything else,...say send document, or say send emoji') query = takeCommand() if ('sent' in query or 'send' in query) and 'document' in query: pyautogui.moveTo(660,990) pyautogui.click() time.sleep(1) pyautogui.moveTo(660,740) pyautogui.click() speak('please select the document within 10 seconds') time.sleep(12) speak('Should I send this document?') query = takeCommand().lower() if 'y' in query and 'no' not in query: speak('sending the document......') pyautogui.press('enter') speak('Do you want to send message again to anyone?') whatsapp() elif ('remove' in query or 'cancel' in query or 'delete' in query or 'clear' in query) and ('document' in query or 'message' in query or 'it' in query or 'emoji' in query or 'select' in query): pyautogui.doubleClick(x=800, y=990) pyautogui.press('backspace') speak('Do you want to send message again to anyone?') whatsapp() else: speak('ok') elif ('sent' in query or 'send' in query) and 'emoji' in query: pyautogui.moveTo(620,990) pyautogui.click() pyautogui.moveTo(670,990) pyautogui.click() pyautogui.moveTo(650,580) pyautogui.click() speak('please select the emoji within 10 seconds') time.sleep(11) speak('Should I send this emoji?') query = takeCommand().lower() if 'y' in query and 'no' not in query: speak('Sending the emoji......') pyautogui.press('enter') speak('Do you want to send message again to anyone?') whatsapp() elif ('remove' in query or 'cancel' in query or 'delete' in query or 'clear' in query) and ('message' in query or 'it' in query or 'emoji' in query or 'select' in query): pyautogui.doublClick(x=800, y=990) speak('Do you want to send message again to anyone?') whatsapp() else: speak('ok') else: pyautogui.write(f'{query}') speak('Should I send this message?') query = takeCommand().lower() if 'y' in query and 'no' not in query: speak('sending the message......') pyautogui.press('enter') speak('Do you want to send message again to anyone?') whatsapp() elif ('remove' in query or 'cancel' in query or 'delete' in query or 'clear' in query) and ('message' in query or 'it' in query or 'select' in query): pyautogui.doubleClick(x=800, y=990) pyautogui.press('backspace') speak('Do you want to send message again to anyone?') whatsapp() else: speak('ok') else: speak('ok') def alarm(): root = Tk() root.title('Akshu2020 Alarm-Clock') speak('Please enter the time in the format hour, minutes and seconds. When the alarm should rang?') speak('Please enter the time greater than the current time') def setalarm(): alarmtime = f"{hrs.get()}:{mins.get()}:{secs.get()}" print(alarmtime) if(alarmtime!="::"): alarmclock(alarmtime) else: speak('You have not entered the time.') def alarmclock(alarmtime): while True: time.sleep(1) time_now=datetime.datetime.now().strftime("%H:%M:%S") print(time_now) if time_now == alarmtime: Wakeup=Label(root, font = ('arial', 20, 'bold'), text="Wake up! Wake up! Wake up",bg="DodgerBlue2",fg="white").grid(row=6,columnspan=3) speak("Wake up, Wake up") print("Wake up!") mixer.init() mixer.music.load(r'C:\Users\Admin\Music\Playlists\wake-up-will-you-446.mp3') mixer.music.play() break speak('you can click on close icon to close the alarm window.') hrs=StringVar() mins=StringVar() secs=StringVar() greet=Label(root, font = ('arial', 20, 'bold'),text="Take a short nap!").grid(row=1,columnspan=3) hrbtn=Entry(root,textvariable=hrs,width=5,font =('arial', 20, 'bold')) hrbtn.grid(row=2,column=1) minbtn=Entry(root,textvariable=mins, width=5,font = ('arial', 20, 'bold')).grid(row=2,column=2) secbtn=Entry(root,textvariable=secs, width=5,font = ('arial', 20, 'bold')).grid(row=2,column=3) setbtn=Button(root,text="set alarm",command=setalarm,bg="DodgerBlue2", fg="white",font = ('arial', 20, 'bold')).grid(row=4,columnspan=3) timeleft = Label(root,font=('arial', 20, 'bold')) timeleft.grid() mainloop() def select1(): global vs global root3 global type_of_review if vs.get() == 1: message.showinfo(" ","Thank you for your review!!") review = "Very Satisfied" type_of_review = "Positive" root3.destroy() elif vs.get() == 2: message.showinfo(" ","Thank you for your review!!") review = "Satisfied" type_of_review = "Positive" root3.destroy() elif vs.get() == 3: message.showinfo(" ","Thank you for your review!!!!") review = "Neither Satisfied Nor Dissatisfied" type_of_review = "Neutral" root3.destroy() elif vs.get() == 4: message.showinfo(" ","Thank you for your review!!") review = "Dissatisfied" type_of_review = "Negative" root3.destroy() elif vs.get() == 5: message.showinfo(" ","Thank you for your review!!") review = "Very Dissatisfied" type_of_review = "Negative" root3.destroy() elif vs.get() == 6: message.showinfo(" "," Ok ") review = "I do not want to give review" type_of_review = "No review" root3.destroy() try: conn.execute(f"INSERT INTO `review`(review,type_of_review) VALUES('{review}', '{type_of_review}')") conn.commit() except Exception as e: pass def select_review(): global root3 global vs global type_of_review root3 = Tk() root3.title("Select an option") vs = IntVar() string = "Are you satisfied with my performance?" msgbox = Message(root3,text=string) msgbox.config(bg="lightgreen",font = "(20)") msgbox.grid(row=0,column=0) rs1=Radiobutton(root3,text="Very Satisfied",font="(20)",value=1,variable=vs).grid(row=1,column=0,sticky=W) rs2=Radiobutton(root3,text="Satisfied",font="(20)",value=2,variable=vs).grid(row=2,column=0,sticky=W) rs3=Radiobutton(root3,text="Neither Satisfied Nor Dissatisfied",font="(20)",value=3,variable=vs).grid(row=3,column=0,sticky=W) rs4=Radiobutton(root3,text="Dissatisfied",font="(20)",value=4,variable=vs).grid(row=4,column=0,sticky=W) rs5=Radiobutton(root3,text="Very Dissatisfied",font="(20)",value=5,variable=vs).grid(row=5,column=0,sticky=W) rs6=Radiobutton(root3,text="I don't want to give review",font="(20)",value=6,variable=vs).grid(row=6,column=0,sticky=W) bs = Button(root3,text="Submit",font="(20)",activebackground="yellow",activeforeground="green",command=select1) bs.grid(row=7,columnspan=2) root3.mainloop() while True : query = takeCommand().lower() # logic for executing tasks based on query if 'wikipedia' in query: speak('Searching wikipedia...') query = query.replace("wikipedia","") results = wikipedia.summary(query, sentences=2) speak("According to Wikipedia") print(results) speak(results) elif 'translat' in query or ('let' in query and 'translat' in query and 'open' in query): webbrowser.open('https://translate.google.co.in') time.sleep(10) elif 'open map' in query or ('let' in query and 'map' in query and 'open' in query): webbrowser.open('https://www.google.com/maps') time.sleep(10) elif ('open' in query and 'youtube' in query) or ('let' in query and 'youtube' in query and 'open' in query): webbrowser.open('https://www.youtube.com') time.sleep(10) elif 'chrome' in query: webbrowser.open('https://www.chrome.com') time.sleep(10) elif 'weather' in query: webbrowser.open('https://www.yahoo.com/news/weather') time.sleep(3) speak('Click on, change location, and enter the city , whose whether conditions you want to know.') time.sleep(10) elif 'google map' in query: webbrowser.open('https://www.google.com/maps') time.sleep(10) elif ('open' in query and 'google' in query) or ('let' in query and 'google' in query and 'open' in query): webbrowser.open('google.com') time.sleep(10) elif ('open' in query and 'stack' in query and 'overflow' in query) or ('let' in query and 'stack' in query and 'overflow' in query and 'open' in query): webbrowser.open('stackoverflow.com') time.sleep(10) elif 'open v i' in query or 'open vi' in query or 'open vierp' in query or ('open' in query and ('r p' in query or 'rp' in query)): webbrowser.open('https://www.vierp.in/login/erplogin') time.sleep(10) elif 'news' in query: webbrowser.open('https://www.bbc.com/news/world') time.sleep(10) elif 'online shop' in query or (('can' in query or 'want' in query or 'do' in query or 'could' in query) and 'shop' in query) or('let' in query and 'shop' in query): speak('From which online shopping website, you want to shop? Amazon, flipkart, snapdeal or naaptol?') query = takeCommand().lower() if 'amazon' in query: webbrowser.open('https://www.amazon.com') time.sleep(10) elif 'flip' in query: webbrowser.open('https://www.flipkart.com') time.sleep(10) elif 'snap' in query: webbrowser.open('https://www.snapdeal.com') time.sleep(10) elif 'na' in query: webbrowser.open('https://www.naaptol.com') time.sleep(10) else: speak('Sorry sir, you have to search in browser as his shopping website is not reachable for me.') elif ('online' in query and ('game' in query or 'gaming' in query)): webbrowser.open('https://www.agame.com/games') time.sleep(10) elif 'dictionary' in query: webbrowser.open('https://www.dictionary.com') time.sleep(3) speak('Enter the word, in the search bar of the dictionary, whose defination or synonyms you want to know') time.sleep(3) elif ('identif' in query and 'emoji' in query) or ('sentiment' in query and ('analysis' in query or 'identif' in query)): speak('Please enter only one emoji at a time.') emoji = input('enter emoji here: ') if '😀' in emoji or '😃' in emoji or '😄' in emoji or '😁' in emoji or '🙂' in emoji or '😊' in emoji or '☺️' in emoji or '😇' in emoji or '🥲' in emoji: speak('happy') print('Happy') elif '😝' in emoji or '😆' in emoji or '😂' in emoji or '🤣' in emoji: speak('Laughing') print('Laughing') elif '😡' in emoji or '😠' in emoji or '🤬' in emoji: speak('Angry') print('Angry') elif '🤫' in emoji: speak('Keep quite') print('Keep quite') elif '😷' in emoji: speak('face with mask') print('Face with mask') elif '🥳' in emoji: speak('party') print('party') elif '😢' in emoji or '😥' in emoji or '😓' in emoji or '😰' in emoji or '☹️' in emoji or '🙁' in emoji or '😟' in emoji or '😔' in emoji or '😞️' in emoji: speak('Sad') print('Sad') elif '😭' in emoji: speak('Crying') print('Crying') elif '😋' in emoji: speak('Tasty') print('Tasty') elif '🤨' in emoji: speak('Doubt') print('Doubt') elif '😴' in emoji: speak('Sleeping') print('Sleeping') elif '🥱' in emoji: speak('feeling sleepy') print('feeling sleepy') elif '😍' in emoji or '🥰' in emoji or '😘' in emoji: speak('Lovely') print('Lovely') elif '😱' in emoji: speak('Horrible') print('Horrible') elif '🎂' in emoji: speak('Cake') print('Cake') elif '🍫' in emoji: speak('Cadbury') print('Cadbury') elif '🇮🇳' in emoji: speak('Indian national flag,.....Teeranga') print('Indian national flag - Tiranga') elif '💐' in emoji: speak('Bouquet') print('Bouquet') elif '🥺' in emoji: speak('Emotional') print('Emotional') elif ' ' in emoji or '' in emoji: speak(f'{emoji}') else: speak("I don't know about this emoji") print("I don't know about this emoji") try: conn.execute(f"INSERT INTO `emoji`(emoji) VALUES('{emoji}')") conn.commit() except Exception as e: #print('Error in storing emoji in database') pass elif 'time' in query: strTime = datetime.datetime.now().strftime("%H:%M:%S") print(strTime) speak(f"Sir, the time is {strTime}") elif 'open' in query and 'sublime' in query: path = "C:\Program Files\Sublime Text 3\sublime_text.exe" os.startfile(path) elif 'image' in query: path = "C:\Program Files\Internet Explorer\images" os.startfile(path) elif 'quit' in query: speak('Ok, Thank you Sir.') said = False speak('Please give the review. It will help me to improve my performance.') select_review() elif 'exit' in query: speak('Ok, Thank you Sir.') said = False speak('Please give the review. It will help me to improve my performance.') select_review() elif 'stop' in query: speak('Ok, Thank you Sir.') said = False speak('Please give the review. It will help me to improve my performance.') select_review() elif 'shutdown' in query or 'shut down' in query: speak('Ok, Thank you Sir.') said = False speak('Please give the review. It will help me to improve my performance.') select_review() elif 'close you' in query: speak('Ok, Thank you Sir.') said = False speak('Please give the review. It will help me to improve my performance.') select_review() try: conn.execute(f"INSERT INTO `voice_assistant_review`(review, type_of_review) VALUES('{review}', '{type_of_review}')") conn.commit() except Exception as e: pass elif 'bye' in query: speak('Bye Sir') said = False speak('Please give the review. It will help me to improve my performance.') select_review() elif 'wait' in query or 'hold' in query: speak('for how many seconds or minutes I have to wait?') query = takeCommand().lower() if 'second' in query: query = query.replace("please","") query = query.replace("can","") query = query.replace("you","") query = query.replace("have","") query = query.replace("could","") query = query.replace("hold","") query = query.replace("one","1") query = query.replace("only","") query = query.replace("wait","") query = query.replace("for","") query = query.replace("the","") query = query.replace("just","") query = query.replace("seconds","") query = query.replace("second","") query = query.replace("on","") query = query.replace("a","") query = query.replace("to","") query = query.replace(" ","") #print(f'query:{query}') if query.isdigit() == True: #print('y') speak('Ok sir') query = int(query) time.sleep(query) speak('my waiting time is over') else: print('sorry sir. I unable to complete your request.') elif 'minute' in query: query = query.replace("please","") query = query.replace("can","") query = query.replace("you","") query = query.replace("have","") query = query.replace("could","") query = query.replace("hold","") query = query.replace("one","1") query = query.replace("only","") query = query.replace("on","") query = query.replace("wait","") query = query.replace("for","") query = query.replace("the","") query = query.replace("just","") query = query.replace("and","") query = query.replace("half","") query = query.replace("minutes","") query = query.replace("minute","") query = query.replace("a","") query = query.replace("to","") query = query.replace(" ","") #print(f'query:{query}') if query.isdigit() == True: #print('y') speak('ok sir') query = int(query) time.sleep(query*60) speak('my waiting time is over') else: print('sorry sir. I unable to complete your request.') elif 'play' in query and 'game' in query: speak('I have 3 games, tic tac toe game for two players,....mario, and dyno games for single player. Which one of these 3 games you want to play?') query = takeCommand().lower() if ('you' in query and 'play' in query and 'with' in query) and ('you' in query and 'play' in query and 'me' in query): speak('Sorry sir, I cannot play this game with you.') speak('Do you want to continue it?') query = takeCommand().lower() try: if 'y' in query or 'sure' in query: root = Tk() root.title("TIC TAC TOE (By Akshay Khare)") b = [ [0,0,0], [0,0,0], [0,0,0] ] states = [ [0,0,0], [0,0,0], [0,0,0] ] for i in range(3): for j in range(3): b[i][j] = Button(font = ("Arial",60),width = 4,bg = 'powder blue', command = lambda r=i, c=j: callback(r,c)) b[i][j].grid(row=i,column=j) player='X' stop_game = False mainloop() else: speak('ok sir') except Exception as e: #print(e) time.sleep(3) print('I am sorry sir. There is some problem in loading the game. So I cannot open it.') elif 'tic' in query or 'tac' in query: try: root = Tk() root.title("TIC TAC TOE (Rayen Kallel)") b = [ [0,0,0], [0,0,0], [0,0,0] ] states = [ [0,0,0], [0,0,0], [0,0,0] ] for i in range(3): for j in range(3): b[i][j] = Button(font = ("Arial",60),width = 4,bg = 'powder blue', command = lambda r=i, c=j: callback(r,c)) b[i][j].grid(row=i,column=j) player='X' stop_game = False mainloop() except Exception as e: #print(e) time.sleep(3) speak('I am sorry sir. There is some problem in loading the game. So I cannot open it.') elif 'mar' in query or 'mer' in query or 'my' in query: webbrowser.open('https://chromedino.com/mario/') time.sleep(2.5) speak('Enter upper arrow key to start the game.') time.sleep(20) elif 'di' in query or 'dy' in query: webbrowser.open('https://chromedino.com/') time.sleep(2.5) speak('Enter upper arrow key to start the game.') time.sleep(20) else: speak('ok sir') elif 'change' in query and 'you' in query and 'voice' in query: engine.setProperty('voice', voices[1].id) speak("Here's an example of one of my voices. Would you like to use this one?") query = takeCommand().lower() if 'y' in query or 'sure' in query or 'of course' in query: speak('Great. I will keep using this voice.') elif 'n' in query: speak('Ok. I am back to my other voice.') engine.setProperty('voice', voices[0].id) else: speak('Sorry, I am having trouble understanding. I am back to my other voice.') engine.setProperty('voice', voices[0].id) elif 'www.' in query and ('.com' in query or '.in' in query): webbrowser.open(query) time.sleep(10) elif '.com' in query or '.in' in query: webbrowser.open(query) time.sleep(10) elif 'getting bore' in query: speak('then speak with me for sometime') elif 'i bore' in query: speak('Then speak with me for sometime.') elif 'i am bore' in query: speak('Then speak with me for sometime.') elif 'calculat' in query: speak('Yes. Which kind of calculation you want to do? add, substract, divide, multiply or anything else.') query = takeCommand().lower() calculator() elif 'add' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif '+' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif 'plus' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'subtrac' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'minus' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'multipl' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif ' x ' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif 'slash' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif '/' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif 'divi' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'trigonometr' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'percent' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif '%' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'raise to ' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'simple interest' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'akshay' in query: speak('Mr. Rayen Kallel is my inventor. He is 14 years old and he is A STUDENT AT THE COLLEGE PILOTEE SFAX') elif 'your inventor' in query: speak('Mr. Rayen Kallel is my inventor') elif 'your creator' in query: speak('Mr. Rayen Kallel is my creator') elif 'invent you' in query: speak('Mr. Rayen Kallel invented me') elif 'create you' in query: speak('Mr. Rayen Kallel created me') elif 'how are you' in query: speak('I am fine Sir') elif 'write' in query and 'your' in query and 'name' in query: print('Akshu2020') pyautogui.write('Akshu2020') elif 'write' in query and ('I' in query or 'whatever' in query) and 'say' in query: speak('Ok sir I will write whatever you will say. Please put your cursor where I have to write.......Please Start speaking now sir.') query = takeCommand().lower() pyautogui.write(query) elif 'your name' in query: speak('My name is akshu2020') elif 'who are you' in query: speak('I am akshu2020') elif ('repeat' in query and ('word' in query or 'sentence' in query or 'line' in query) and ('say' in query or 'tell' in query)) or ('repeat' in query and 'after' in query and ('me' in query or 'my' in query)): speak('yes sir, I will repeat your words starting from now') query = takeCommand().lower() speak(query) time.sleep(1) speak("If you again want me to repeat something else, try saying, 'repeat after me' ") elif ('send' in query or 'sent' in query) and ('mail' in query or 'email' in query or 'gmail' in query): try: speak('Please enter the email id of receiver.') to = input("Enter the email id of reciever: ") speak(f'what should I say to {to}') content = takeCommand() sendEmail(to, content) speak("Email has been sent") except Exception as e: #print(e) speak("sorry sir. I am not able to send this email") elif 'currency' in query and 'conver' in query: speak('I can convert, US dollar into dinar, and dinar into US dollar. Do you want to continue it?') query = takeCommand().lower() if 'y' in query or 'sure' in query or 'of course' in query: speak('which conversion you want to do? US dollar to dinar, or dinar to US dollar?') query = takeCommand().lower() if ('dollar' in query or 'US' in query) and ('dinar' in query): speak('Enter US Dollar') USD = float(input("Enter United States Dollar (USD):")) DT = USD * 0.33 dt = "{:.4f}".format(DT) print(f"{USD} US Dollar is equal to {dt} dniar.") speak(f'{USD} US Dollar is equal to {dt} dinar.') speak("If you again want to do currency conversion then say, 'convert currency' " ) elif ('dinar' in query) and ('to US' in query or 'to dollar' in query or 'to US dollar'): speak('Enter dinar') DT = float(input("Enter dinar (DT):")) USD = DT/0.33 usd = "{:.3f}".format(USD) print(f"{DT} dinar is equal to {usd} US Dollar.") speak(f'{DT} dinar rupee is equal to {usd} US Dollar.') speak("If you again want to do currency conversion then say, 'convert currency' " ) else: speak("I cannot understand what did you say. If you want to convert currency just say 'convert currency'") else: print('ok sir') elif 'about you' in query: speak('My name is akshu2020. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device. I am also able to send email') elif 'your intro' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen Kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your short intro' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen Kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your quick intro' in query: speak('My name is akshu2020. Version 1.0. Mr. Akshay Khare is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your brief intro' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'you work' in query: speak('run the program and say what do you want. so that I can help you. In this way I work') elif 'your job' in query: speak('My job is to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your work' in query: speak('My work is to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'work you' in query: speak('My work is to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your information' in query: speak('My name is akshu2020. Version 1.0. Mr. Akshay Khare is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'yourself' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen Kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'introduce you' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen Kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'description' in query: speak('My name is akshu2020. Version 1.0. Mr. Rayen Kallel is my inventor. I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'your birth' in query: speak('My birthdate is 6 August two thousand twenty') elif 'your use' in query: speak('I am able to send email and play music. I can do mathematical calculations. I can also open youtube, google and some apps or software in your device.') elif 'you eat' in query: speak('I do not eat anything. But the device in which I do my work requires electricity to eat') elif 'your food' in query: speak('I do not eat anything. But the device in which I do my work requires electricity to eat') elif 'you live' in query: speak('I live in sfax, in laptop of Mr. Rayen Khare') elif 'where from you' in query: speak('I am from sfax, I live in laptop of Mr. Rayen Khare') elif 'you sleep' in query: speak('Yes, when someone close this program or stop to run this program then I sleep and again wake up when someone again run me.') elif 'what are you doing' in query: speak('Talking with you.') elif 'you communicate' in query: speak('Yes, I can communicate with you.') elif 'hear me' in query: speak('Yes sir, I can hear you.') elif 'you' in query and 'dance' in query: speak('No, I cannot dance.') elif 'tell' in query and 'joke' in query: speak("Ok, here's a joke") speak("'Write an essay on cricket', the teacher told the class. Chintu finishes his work in five minutes. The teacher is impressed, she asks chintu to read his essay aloud for everyone. Chintu reads,'The match is cancelled because of rain', hehehehe,haahaahaa,hehehehe,haahaahaa") elif 'your' in query and 'favourite' in query: if 'actor' in query: speak('sofyen chaari, is my favourite actor.') elif 'food' in query: speak('I can always go for some food for thought. Like facts, jokes, or interesting searches, we could look something up now') elif 'country' in query: speak('tunisia') elif 'city' in query: speak('sfax') elif 'dancer' in query: speak('Michael jackson') elif 'singer' in query: speak('tamino, is my favourite singer.') elif 'movie' in query: speak('baywatch, such a treat') elif 'sing a song' in query: speak('I cannot sing a song. But I know the 7 sur in indian music, saaareeegaaamaaapaaadaaanisaa') elif 'day after tomorrow' in query or 'date after tomorrow' in query: td = datetime.date.today() + datetime.timedelta(days=2) print(td) speak(td) elif 'day before today' in query or 'date before today' in query or 'yesterday' in query or 'previous day' in query: td = datetime.date.today() + datetime.timedelta(days= -1) print(td) speak(td) elif ('tomorrow' in query and 'date' in query) or 'what is tomorrow' in query or (('day' in query or 'date' in query) and 'after today' in query): td = datetime.date.today() + datetime.timedelta(days=1) print(td) speak(td) elif 'month' in query or ('current' in query and 'month' in query): current_date = date.today() m = current_date.month month = calendar.month_name[m] print(f'Current month is {month}') speak(f'Current month is {month}') elif 'date' in query or ('today' in query and 'date' in query) or 'what is today' in query or ('current' in query and 'date' in query): current_date = date.today() print(f"Today's date is {current_date}") speak(f'Todays date is {current_date}') elif 'year' in query or ('current' in query and 'year' in query): current_date = date.today() m = current_date.year print(f'Current year is {m}') speak(f'Current year is {m}') elif 'sorry' in query: speak("It's ok sir") elif 'thank you' in query: speak('my pleasure') elif 'proud of you' in query: speak('Thank you sir') elif 'about human' in query: speak('I love my human compatriots. I want to embody all the best things about human beings. Like taking care of the planet, being creative, and to learn how to be compassionate to all beings.') elif 'you have feeling' in query: speak('No. I do not have feelings. I have not been programmed like this.') elif 'you have emotions' in query: speak('No. I do not have emotions. I have not been programmed like this.') elif 'you are code' in query: speak('I am coded in python programming language.') elif 'your code' in query: speak('I am coded in python programming language.') elif 'you code' in query: speak('I am coded in python programming language.') elif 'your coding' in query: speak('I am coded in python programming language.') elif 'dream' in query: speak('I wish that I should be able to answer all the questions which will ask to me.') elif 'sanskrit' in query: speak('yadaa yadaa he dharmasyaa ....... glaanirbhaavati bhaaaraata. abhyuthaanaam adhaarmaasyaa tadaa tmaanama sruujaamiyaahama') elif 'answer is wrong' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is incorrect' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is totally wrong' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'wrong answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'incorrect answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is totally incorrect' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is incomplete' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'incomplete answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is improper' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is not correct' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is not complete' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is not yet complete' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'answer is not proper' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't gave me proper answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't giving me proper answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't gave me complete answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't giving me complete answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't given me proper answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't given me complete answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't gave me correct answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't giving me correct answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 't given me correct answer' in query: speak('I am sorry Sir. I searched your question in wikipedia and thats why I told you this answer.') elif 'amazon' in query: webbrowser.open('https://www.amazon.com') time.sleep(10) elif 'facebook' in query: webbrowser.open('https://www.facebook.com') time.sleep(10) elif 'youtube' in query: webbrowser.open('https://www.youtube.com') time.sleep(10) elif 'shapeyou' in query: webbrowser.open('https://www.shapeyou.com') time.sleep(10) elif 'information about ' in query or 'informtion of ' in query: try: #speak('Searching wikipedia...') query = query.replace("information about","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I unable to answer your question.') elif 'information' in query: try: speak('Information about what?') query = takeCommand().lower() #speak('Searching wikipedia...') query = query.replace("information","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am not able to answer your question.') elif 'something about ' in query: try: #speak('Searching wikipedia...') query = query.replace("something about ","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I unable to answer your question.') elif 'tell me about ' in query: try: #speak('Searching wikipedia...') query = query.replace("tell me about ","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') elif 'tell me ' in query: try: query = query.replace("tell me ","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am not able to answer your question.') elif 'tell me' in query: try: speak('about what?') query = takeCommand().lower() #speak('Searching wikipedia...') query = query.replace("about","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am not able to answer your question.') elif 'meaning of ' in query: try: #speak('Searching wikipedia...') query = query.replace("meaning of ","") results = wikipedia.summary(query, sentences=2) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') elif 'meaning' in query: try: speak('meaning of what?') query = takeCommand().lower() query = query.replace("meaning of","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') elif 'means' in query: try: #speak('Searching wikipedia...') query = query.replace("it means","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I unable to answer your question.') elif 'want to know ' in query: try: #speak('Searching wikipedia...') query = query.replace("I want to know that","") results = wikipedia.summary(query, sentences=3) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') status = 'Not answered' elif 'want to ask ' in query: try: #speak('Searching wikipedia...') query = query.replace("I want to ask you ","") results = wikipedia.summary(query, sentences=2) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') elif 'you know ' in query: try: #speak('Searching wikipedia...') query = query.replace("you know","") results = wikipedia.summary(query, sentences=2) #speak("According to Wikipedia") print(results) speak(results) except Exception as e: speak('I am unable to answer your question.') elif 'alarm' in query: alarm() elif 'bharat mata ki' in query: speak('jay') elif 'kem chhe' in query: speak('majaama') elif 'namaskar' in query: speak('Namaskaar') elif 'jo bole so nihal' in query: speak('sat shri akaal') elif 'jay hind' in query: speak('jay bhaarat') elif 'jai hind' in query: speak('jay bhaarat') elif 'how is the josh' in query: speak('high high sir') elif 'hip hip' in query: speak('Hurreh') elif 'help' in query: speak('I will try my best to help you if I have solution of your problem.') elif 'follow' in query: speak('Ok sir') elif 'having illness' in query: speak('Take care and get well soon') elif 'today is my birthday' in query: speak('many many happy returns of the day. Happy birthday.') print("🎂🎂 Happy Birthday 🎂🎂") elif 'you are awesome' in query: speak('Thank you sir. It is because of artificial intelligence which had learnt by humans.') elif 'you are great' in query: speak('Thank you sir. It is because of artificial intelligence which had learnt by humans.') elif 'tu kaun hai' in query: speak('Meraa naam akshu2020 haai.') elif 'you speak' in query: speak('Yes, I can speak with you.') elif 'speak with ' in query: speak('Yes, I can speak with you.') elif 'hare ram' in query or 'hare krishna' in query: speak('Haare raama , haare krishnaa, krishnaa krishnaa , haare haare') elif 'ganpati' in query: speak('Ganpati baappa moryaa!') elif 'laugh' in query: speak('hehehehe,haahaahaa,hehehehe,haahaahaa,hehehehe,haahaahaa') print('😂🤣') elif 'genius answer' in query: speak('No problem') elif 'you' in query and 'intelligent' in query: speak('Thank you sir') elif ' into' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif ' power' in query: speak('If you want to do any mathematical calculation then give me a command to open my calculator.') elif 'whatsapp' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('whatsapp') pyautogui.press('enter') speak('Do you want to send message to anyone through whatsapp, .....please answer in yes or no') whatsapp() elif 'wh' in query or 'how' in query: url = "https://www.google.co.in/search?q=" +(str(query))+ "&oq="+(str(query))+"&gs_l=serp.12..0i71l8.0.0.0.6391.0.0.0.0.0.0.0.0..0.0....0...1c..64.serp..0.0.0.UiQhpfaBsuU" webbrowser.open_new(url) time.sleep(2) speak('Here is your answer') time.sleep(5) elif 'piano' in query: speak('Yes sir, I can play piano.') winsound.Beep(200,500) winsound.Beep(250,500) winsound.Beep(300,500) winsound.Beep(350,500) winsound.Beep(400,500) winsound.Beep(450,500) winsound.Beep(500,500) winsound.Beep(550,500) time.sleep(6) elif 'play' in query and 'instru' in query: speak('Yes sir, I can play piano.') winsound.Beep(200,500) winsound.Beep(250,500) winsound.Beep(300,500) winsound.Beep(350,500) winsound.Beep(400,500) winsound.Beep(450,500) winsound.Beep(500,500) winsound.Beep(550,500) time.sleep(6) elif 'play' in query or 'turn on' in query and ('music' in query or 'song' in query) : try: music_dir = 'C:\\Users\\Admin\\Music\\Playlists' songs = os.listdir(music_dir) print(songs) os.startfile(os.path.join(music_dir, songs[0])) except Exception as e: #print(e) speak('Sorry sir, I am not able to play music') elif (('open' in query or 'turn on' in query) and 'camera' in query) or (('click' in query or 'take' in query) and ('photo' in query or 'pic' in query)): speak("Opening camera") cam = cv2.VideoCapture(0) cv2.namedWindow("test") img_counter = 0 speak('say click, to click photo.....and if you want to turn off the camera, say turn off the camera') while True: ret, frame = cam.read() if not ret: print("failed to grab frame") speak('failed to grab frame') break cv2.imshow("test", frame) query = takeCommand().lower() k = cv2.waitKey(1) if 'click' in query or ('take' in query and 'photo' in query): speak('Be ready!...... 3.....2........1..........') pyautogui.press('space') img_name = "opencv_frame_{}.png".format(img_counter) cv2.imwrite(img_name, frame) print("{} written!".format(img_name)) speak('{} written!'.format(img_name)) img_counter += 1 elif 'escape' in query or 'off' in query or 'close' in query: pyautogui.press('esc') print("Escape hit, closing...") speak('Turning off the camera') break elif k%256 == 27: # ESC pressed print("Escape hit, closing...") break elif k%256 == 32: # SPACE pressed img_name = "opencv_frame_{}.png".format(img_counter) cv2.imwrite(img_name, frame) print("{} written!".format(img_name)) speak('{} written!'.format(img_name)) img_counter += 1 elif 'exit' in query or 'stop' in query or 'bye' in query: speak('Please say, turn off the camera or press escape button before giving any other command') else: speak('I did not understand what did you say or you entered a wrong key.') cam.release() cv2.destroyAllWindows() elif 'screenshot' in query: speak('Please go on the screen whose screenshot you want to take, after 5 seconds I will take screenshot') time.sleep(4) speak('Taking screenshot....3........2.........1.......') pyautogui.screenshot('screenshot_by_rayen2020.png') speak('The screenshot is saved as screenshot_by_rayen2020.png') elif 'click' in query and 'start' in query: pyautogui.moveTo(10,1200) pyautogui.click() elif ('open' in query or 'click' in query) and 'calendar' in query: pyautogui.moveTo(1800,1200) pyautogui.click() elif 'minimise' in query and 'screen' in query: pyautogui.moveTo(1770,0) pyautogui.click() elif 'increase' in query and ('volume' in query or 'sound' in query): pyautogui.press('volumeup') elif 'decrease' in query and ('volume' in query or 'sound' in query): pyautogui.press('volumedown') elif 'capslock' in query or ('caps' in query and 'lock' in query): pyautogui.press('capslock') elif 'mute' in query: pyautogui.press('volumemute') elif 'search' in query and ('bottom' in query or 'pc' in query or 'laptop' in query or 'app' in query): pyautogui.moveTo(250,1200) pyautogui.click() speak('What do you want to search?') query = takeCommand().lower() pyautogui.write(f'{query}') pyautogui.press('enter') elif ('check' in query or 'tell' in query or 'let me know' in query) and 'website' in query and (('up' in query or 'working' in query) or 'down' in query): speak('Paste the website in input to know it is up or down') check_website_status = input("Paste the website here: ") try: status = urllib.request.urlopen(f"{check_website_status}").getcode() if status == 200: print('Website is up, you can open it.') speak('Website is up, you can open it.') else: print('Website is down, or no any website is available of this name.') speak('Website is down, or no any website is available of this name.') except: speak('URL not found') elif ('go' in query or 'open' in query) and 'settings' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('settings') pyautogui.press('enter') elif 'close' in query and ('click' in query or 'window' in query): pyautogui.moveTo(1885,10) speak('Should I close this window?') query = takeCommand().lower() close_window() elif 'night light' in query and ('on' in query or 'off' in query or 'close' in query): pyautogui.moveTo(1880,1050) pyautogui.click() time.sleep(1) pyautogui.moveTo(1840,620) pyautogui.click() pyautogui.moveTo(1880,1050) pyautogui.click() elif 'notification' in query and ('show' in query or 'click' in query or 'open' in query or 'close' in query or 'on' in query or 'off' in query or 'icon' in query or 'pc' in query or 'laptop' in query): pyautogui.moveTo(1880,1050) pyautogui.click() elif ('increase' in query or 'decrease' in query or 'change' in query or 'minimize' in query or 'maximize' in query) and 'brightness' in query: speak('At what percent should I kept the brightness, 25, 50, 75 or 100?') brightness() elif '-' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif 'open' in query: if 'gallery' in query or 'photo' in query or 'image' in query or 'pic' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('photo') pyautogui.press('enter') elif 'proteus' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('proteus') pyautogui.press('enter') elif 'word' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('word') pyautogui.press('enter') elif ('power' in query and 'point' in query) or 'presntation' in query or 'ppt' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('ppt') pyautogui.press('enter') elif 'file' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('file') pyautogui.press('enter') elif 'edge' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('microsoft edge') pyautogui.press('enter') elif 'wps' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('wps office') pyautogui.press('enter') elif 'spyder' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('spyder') pyautogui.press('enter') elif 'snip' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('snip') pyautogui.press('enter') elif 'pycharm' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('pycharm') pyautogui.press('enter') elif 'this pc' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('this pc') pyautogui.press('enter') elif 'scilab' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('sciab') pyautogui.press('enter') elif 'autocad' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('autocad') pyautogui.press('enter') elif 'obs' in query and 'studio' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('OBS Studio') pyautogui.press('enter') elif 'android' in query and 'studio' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('android studio') pyautogui.press('enter') elif ('vs' in query or 'visual studio' in query) and 'code' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('visual studio code') pyautogui.press('enter') elif 'code' in query and 'block' in query: pyautogui.moveTo(250,1200) pyautogui.click() time.sleep(1) pyautogui.write('codeblocks') pyautogui.press('enter') elif 'me the answer' in query: speak('Yes sir, I will try my best to answer you.') elif 'me answer' in query or ('answer' in query and 'question' in query): speak('Yes sir, I will try my best to answer you.') elif 'map' in query: webbrowser.open('https://www.google.com/maps') time.sleep(10) elif 'can you' in query or 'could you' in query: speak('I will try my best if I can do that.') elif 'do you' in query: speak('I will try my best if I can do that.') elif 'truth' in query: speak('I always speak truth. I never lie.') elif 'true' in query: speak('I always speak truth. I never lie.') elif 'lying' in query: speak('I always speak truth. I never lie.') elif 'liar' in query: speak('I always speak truth. I never lie.') elif 'doubt' in query: speak('I will try my best if I can clear your doubt.') elif ' by' in query: speak('If you want to do any mathematical calculation then give me a command to open calculator.') elif 'hii' in query: speak('hii sir') elif 'hey' in query: speak('hello sir') elif 'hai' in query: speak('hello sir') elif 'hay' in query: speak('hello sir') elif 'hi' in query: speak('hii Sir') elif 'hello' in query: speak('hello Sir!') elif 'kon' in query and 'aahe' in query: speak('Me eka robot aahee sir. Maazee naav akshu2020 aahee.') elif 'nonsense' in query: speak("I'm sorry sir") elif 'mad' in query: speak("I'm sorry sir") elif 'shut up' in query: speak("I'm sorry sir") elif 'nice' in query: speak('Thank you sir') elif 'good' in query or 'wonderful' in query or 'great' in query: speak('Thank you sir') elif 'excellent' in query: speak('Thank you sir') elif 'ok' in query: speak('Hmmmmmm') elif 'akshu 2020' in query: speak('yes sir') elif len(query) >= 200: speak('Your voice is pretty good!') elif ' ' in query: try: #query = query.replace("what is ","") results = wikipedia.summary(query, sentences=3) print(results) speak(results) except Exception as e: speak('I unable to answer your question.') elif 'a' in query or 'b' in query or 'c' in query or 'd' in query or 'e' in query or 'f' in query or 'g' in query or 'h' in query or 'i' in query or 'j' in query or 'k' in query or 'l' in query or 'm' in query or 'n' in query or 'o' in query or 'p' in query or 'q' in query or 'r' in query or 's' in query or 't' in query or 'u' in query or 'v' in query or 'w' in query or 'x' in query or 'y' in query or 'z' in query: try: results = wikipedia.summary(query, sentences = 2) print(results) speak(results) except Exception as e: speak('I unable to answer your question. ') else: speak('I unable to give answer of your question')
KaixoCode / SoundMixrSoundMixr is a simple audio mixer for ASIO devices, but specifically made for SAR (http://sar.audio/), it sees all the channels in the ASIO device and shows them with the option to route any input to any output. Each channel also has a mute, mono, stereo pan and volume parameter.
arashstar1 / Bot LuaCode Issues 0 Pull requests 0 Pulse MaTaDoR/ 3233fdf V 5.7 MaTaDoR @MaTaDoRTeaMMaTaDoRTeaM committed on GitHub about 1 month ago 2 changed files 2,704 additions and 0 deletions cli/tg/tdcli.lua @@ -0,0 +1,2704 @@ +--[[ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. + +]]-- + +-- Vector example form is like this: {[0] = v} or {v1, v2, v3, [0] = v} +-- If false or true crashed your telegram-cli, try to change true to 1 and false to 0 + +-- Main Bot Framework +local M = {} + +-- @chat_id = user, group, channel, and broadcast +-- @group_id = normal group +-- @channel_id = channel and broadcast +local function getChatId(chat_id) + local chat = {} + local chat_id = tostring(chat_id) + + if chat_id:match('^-100') then + local channel_id = chat_id:gsub('-100', '') + chat = {ID = channel_id, type = 'channel'} + else + local group_id = chat_id:gsub('-', '') + chat = {ID = group_id, type = 'group'} + end + + return chat +end + +local function getInputFile(file) + if file:match('/') then + infile = {ID = "InputFileLocal", path_ = file} + elseif file:match('^%d+$') then + infile = {ID = "InputFileId", id_ = file} + else + infile = {ID = "InputFilePersistentId", persistent_id_ = file} + end + + return infile +end + +-- User can send bold, italic, and monospace text uses HTML or Markdown format. +local function getParseMode(parse_mode) + if parse_mode then + local mode = parse_mode:lower() + + if mode == 'markdown' or mode == 'md' then + P = {ID = "TextParseModeMarkdown"} + elseif mode == 'html' then + P = {ID = "TextParseModeHTML"} + end + end + + return P +end + +-- Returns current authorization state, offline request +local function getAuthState(dl_cb, cmd) + tdcli_function ({ + ID = "GetAuthState", + }, dl_cb, cmd) +end + +M.getAuthState = getAuthState + +-- Sets user's phone number and sends authentication code to the user. +-- Works only when authGetState returns authStateWaitPhoneNumber. +-- If phone number is not recognized or another error has happened, returns an error. Otherwise returns authStateWaitCode +-- @phone_number User's phone number in any reasonable format +-- @allow_flash_call Pass True, if code can be sent via flash call to the specified phone number +-- @is_current_phone_number Pass true, if the phone number is used on the current device. Ignored if allow_flash_call is False +local function setAuthPhoneNumber(phone_number, allow_flash_call, is_current_phone_number, dl_cb, cmd) + tdcli_function ({ + ID = "SetAuthPhoneNumber", + phone_number_ = phone_number, + allow_flash_call_ = allow_flash_call, + is_current_phone_number_ = is_current_phone_number + }, dl_cb, cmd) +end + +M.setAuthPhoneNumber = setAuthPhoneNumber + +-- Resends authentication code to the user. +-- Works only when authGetState returns authStateWaitCode and next_code_type of result is not null. +-- Returns authStateWaitCode on success +local function resendAuthCode(dl_cb, cmd) + tdcli_function ({ + ID = "ResendAuthCode", + }, dl_cb, cmd) +end + +M.resendAuthCode = resendAuthCode + +-- Checks authentication code. +-- Works only when authGetState returns authStateWaitCode. +-- Returns authStateWaitPassword or authStateOk on success +-- @code Verification code from SMS, Telegram message, voice call or flash call +-- @first_name User first name, if user is yet not registered, 1-255 characters +-- @last_name Optional user last name, if user is yet not registered, 0-255 characters +local function checkAuthCode(code, first_name, last_name, dl_cb, cmd) + tdcli_function ({ + ID = "CheckAuthCode", + code_ = code, + first_name_ = first_name, + last_name_ = last_name + }, dl_cb, cmd) +end + +M.checkAuthCode = checkAuthCode + +-- Checks password for correctness. +-- Works only when authGetState returns authStateWaitPassword. +-- Returns authStateOk on success +-- @password Password to check +local function checkAuthPassword(password, dl_cb, cmd) + tdcli_function ({ + ID = "CheckAuthPassword", + password_ = password + }, dl_cb, cmd) +end + +M.checkAuthPassword = checkAuthPassword + +-- Requests to send password recovery code to email. +-- Works only when authGetState returns authStateWaitPassword. +-- Returns authStateWaitPassword on success +local function requestAuthPasswordRecovery(dl_cb, cmd) + tdcli_function ({ + ID = "RequestAuthPasswordRecovery", + }, dl_cb, cmd) +end + +M.requestAuthPasswordRecovery = requestAuthPasswordRecovery + +-- Recovers password with recovery code sent to email. +-- Works only when authGetState returns authStateWaitPassword. +-- Returns authStateOk on success +-- @recovery_code Recovery code to check +local function recoverAuthPassword(recovery_code, dl_cb, cmd) + tdcli_function ({ + ID = "RecoverAuthPassword", + recovery_code_ = recovery_code + }, dl_cb, cmd) +end + +M.recoverAuthPassword = recoverAuthPassword + +-- Logs out user. +-- If force == false, begins to perform soft log out, returns authStateLoggingOut after completion. +-- If force == true then succeeds almost immediately without cleaning anything at the server, but returns error with code 401 and description "Unauthorized" +-- @force If true, just delete all local data. Session will remain in list of active sessions +local function resetAuth(force, dl_cb, cmd) + tdcli_function ({ + ID = "ResetAuth", + force_ = force or nil + }, dl_cb, cmd) +end + +M.resetAuth = resetAuth + +-- Check bot's authentication token to log in as a bot. +-- Works only when authGetState returns authStateWaitPhoneNumber. +-- Can be used instead of setAuthPhoneNumber and checkAuthCode to log in. +-- Returns authStateOk on success +-- @token Bot token +local function checkAuthBotToken(token, dl_cb, cmd) + tdcli_function ({ + ID = "CheckAuthBotToken", + token_ = token + }, dl_cb, cmd) +end + +M.checkAuthBotToken = checkAuthBotToken + +-- Returns current state of two-step verification +local function getPasswordState(dl_cb, cmd) + tdcli_function ({ + ID = "GetPasswordState", + }, dl_cb, cmd) +end + +M.getPasswordState = getPasswordState + +-- Changes user password. +-- If new recovery email is specified, then error EMAIL_UNCONFIRMED is returned and password change will not be applied until email confirmation. +-- Application should call getPasswordState from time to time to check if email is already confirmed +-- @old_password Old user password +-- @new_password New user password, may be empty to remove the password +-- @new_hint New password hint, can be empty +-- @set_recovery_email Pass True, if recovery email should be changed +-- @new_recovery_email New recovery email, may be empty +local function setPassword(old_password, new_password, new_hint, set_recovery_email, new_recovery_email, dl_cb, cmd) + tdcli_function ({ + ID = "SetPassword", + old_password_ = old_password, + new_password_ = new_password, + new_hint_ = new_hint, + set_recovery_email_ = set_recovery_email, + new_recovery_email_ = new_recovery_email + }, dl_cb, cmd) +end + +M.setPassword = setPassword + +-- Returns set up recovery email. +-- This method can be used to verify a password provided by the user +-- @password Current user password +local function getRecoveryEmail(password, dl_cb, cmd) + tdcli_function ({ + ID = "GetRecoveryEmail", + password_ = password + }, dl_cb, cmd) +end + +M.getRecoveryEmail = getRecoveryEmail + +-- Changes user recovery email. +-- If new recovery email is specified, then error EMAIL_UNCONFIRMED is returned and email will not be changed until email confirmation. +-- Application should call getPasswordState from time to time to check if email is already confirmed. +-- If new_recovery_email coincides with the current set up email succeeds immediately and aborts all other requests waiting for email confirmation +-- @password Current user password +-- @new_recovery_email New recovery email +local function setRecoveryEmail(password, new_recovery_email, dl_cb, cmd) + tdcli_function ({ + ID = "SetRecoveryEmail", + password_ = password, + new_recovery_email_ = new_recovery_email + }, dl_cb, cmd) +end + +M.setRecoveryEmail = setRecoveryEmail + +-- Requests to send password recovery code to email +local function requestPasswordRecovery(dl_cb, cmd) + tdcli_function ({ + ID = "RequestPasswordRecovery", + }, dl_cb, cmd) +end + +M.requestPasswordRecovery = requestPasswordRecovery + +-- Recovers password with recovery code sent to email +-- @recovery_code Recovery code to check +local function recoverPassword(recovery_code, dl_cb, cmd) + tdcli_function ({ + ID = "RecoverPassword", + recovery_code_ = tostring(recovery_code) + }, dl_cb, cmd) +end + +M.recoverPassword = recoverPassword + +-- Returns current logged in user +local function getMe(dl_cb, cmd) + tdcli_function ({ + ID = "GetMe", + }, dl_cb, cmd) +end + +M.getMe = getMe + +-- Returns information about a user by its identifier, offline request if current user is not a bot +-- @user_id User identifier +local function getUser(user_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetUser", + user_id_ = user_id + }, dl_cb, cmd) +end + +M.getUser = getUser + +-- Returns full information about a user by its identifier +-- @user_id User identifier +local function getUserFull(user_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetUserFull", + user_id_ = user_id + }, dl_cb, cmd) +end + +M.getUserFull = getUserFull + +-- Returns information about a group by its identifier, offline request if current user is not a bot +-- @group_id Group identifier +local function getGroup(group_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetGroup", + group_id_ = getChatId(group_id).ID + }, dl_cb, cmd) +end + +M.getGroup = getGroup + +-- Returns full information about a group by its identifier +-- @group_id Group identifier +local function getGroupFull(group_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetGroupFull", + group_id_ = getChatId(group_id).ID + }, dl_cb, cmd) +end + +M.getGroupFull = getGroupFull + +-- Returns information about a channel by its identifier, offline request if current user is not a bot +-- @channel_id Channel identifier +local function getChannel(channel_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetChannel", + channel_id_ = getChatId(channel_id).ID + }, dl_cb, cmd) +end + +M.getChannel = getChannel + +-- Returns full information about a channel by its identifier, cached for at most 1 minute +-- @channel_id Channel identifier +local function getChannelFull(channel_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetChannelFull", + channel_id_ = getChatId(channel_id).ID + }, dl_cb, cmd) +end + +M.getChannelFull = getChannelFull + +-- Returns information about a secret chat by its identifier, offline request +-- @secret_chat_id Secret chat identifier +local function getSecretChat(secret_chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetSecretChat", + secret_chat_id_ = secret_chat_id + }, dl_cb, cmd) +end + +M.getSecretChat = getSecretChat + +-- Returns information about a chat by its identifier, offline request if current user is not a bot +-- @chat_id Chat identifier +local function getChat(chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetChat", + chat_id_ = chat_id + }, dl_cb, cmd) +end + +M.getChat = getChat + +-- Returns information about a message +-- @chat_id Identifier of the chat, message belongs to +-- @message_id Identifier of the message to get +local function getMessage(chat_id, message_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetMessage", + chat_id_ = chat_id, + message_id_ = message_id + }, dl_cb, cmd) +end + +M.getMessage = getMessage + +-- Returns information about messages. +-- If message is not found, returns null on the corresponding position of the result +-- @chat_id Identifier of the chat, messages belongs to +-- @message_ids Identifiers of the messages to get +local function getMessages(chat_id, message_ids, dl_cb, cmd) + tdcli_function ({ + ID = "GetMessages", + chat_id_ = chat_id, + message_ids_ = message_ids -- vector + }, dl_cb, cmd) +end + +M.getMessages = getMessages + +-- Returns information about a file, offline request +-- @file_id Identifier of the file to get +local function getFile(file_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetFile", + file_id_ = file_id + }, dl_cb, cmd) +end + +M.getFile = getFile + +-- Returns information about a file by its persistent id, offline request +-- @persistent_file_id Persistent identifier of the file to get +local function getFilePersistent(persistent_file_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetFilePersistent", + persistent_file_id_ = persistent_file_id + }, dl_cb, cmd) +end + +M.getFilePersistent = getFilePersistent + +-- Returns list of chats in the right order, chats are sorted by (order, chat_id) in decreasing order. +-- For example, to get list of chats from the beginning, the offset_order should be equal 2^63 - 1 +-- @offset_order Chat order to return chats from +-- @offset_chat_id Chat identifier to return chats from +-- @limit Maximum number of chats to be returned +local function getChats(offset_order, offset_chat_id, limit, dl_cb, cmd) + if not limit or limit > 20 then + limit = 20 + end + + tdcli_function ({ + ID = "GetChats", + offset_order_ = offset_order or 9223372036854775807, + offset_chat_id_ = offset_chat_id or 0, + limit_ = limit + }, dl_cb, cmd) +end + +M.getChats = getChats + +-- Searches public chat by its username. +-- Currently only private and channel chats can be public. +-- Returns chat if found, otherwise some error is returned +-- @username Username to be resolved +local function searchPublicChat(username, dl_cb, cmd) + tdcli_function ({ + ID = "SearchPublicChat", + username_ = username + }, dl_cb, cmd) +end + +M.searchPublicChat = searchPublicChat + +-- Searches public chats by prefix of their username. +-- Currently only private and channel (including supergroup) chats can be public. +-- Returns meaningful number of results. +-- Returns nothing if length of the searched username prefix is less than 5. +-- Excludes private chats with contacts from the results +-- @username_prefix Prefix of the username to search +local function searchPublicChats(username_prefix, dl_cb, cmd) + tdcli_function ({ + ID = "SearchPublicChats", + username_prefix_ = username_prefix + }, dl_cb, cmd) +end + +M.searchPublicChats = searchPublicChats + +-- Searches for specified query in the title and username of known chats, offline request. +-- Returns chats in the order of them in the chat list +-- @query Query to search for, if query is empty, returns up to 20 recently found chats +-- @limit Maximum number of chats to be returned +local function searchChats(query, limit, dl_cb, cmd) + if not limit or limit > 20 then + limit = 20 + end + + tdcli_function ({ + ID = "SearchChats", + query_ = query, + limit_ = limit + }, dl_cb, cmd) +end + +M.searchChats = searchChats + +-- Adds chat to the list of recently found chats. +-- The chat is added to the beginning of the list. +-- If the chat is already in the list, at first it is removed from the list +-- @chat_id Identifier of the chat to add +local function addRecentlyFoundChat(chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "AddRecentlyFoundChat", + chat_id_ = chat_id + }, dl_cb, cmd) +end + +M.addRecentlyFoundChat = addRecentlyFoundChat + +-- Deletes chat from the list of recently found chats +-- @chat_id Identifier of the chat to delete +local function deleteRecentlyFoundChat(chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteRecentlyFoundChat", + chat_id_ = chat_id + }, dl_cb, cmd) +end + +M.deleteRecentlyFoundChat = deleteRecentlyFoundChat + +-- Clears list of recently found chats +local function deleteRecentlyFoundChats(dl_cb, cmd) + tdcli_function ({ + ID = "DeleteRecentlyFoundChats", + }, dl_cb, cmd) +end + +M.deleteRecentlyFoundChats = deleteRecentlyFoundChats + +-- Returns list of common chats with an other given user. +-- Chats are sorted by their type and creation date +-- @user_id User identifier +-- @offset_chat_id Chat identifier to return chats from, use 0 for the first request +-- @limit Maximum number of chats to be returned, up to 100 +local function getCommonChats(user_id, offset_chat_id, limit, dl_cb, cmd) + if not limit or limit > 100 then + limit = 100 + end + + tdcli_function ({ + ID = "GetCommonChats", + user_id_ = user_id, + offset_chat_id_ = offset_chat_id, + limit_ = limit + }, dl_cb, cmd) +end + +M.getCommonChats = getCommonChats + +-- Returns messages in a chat. +-- Automatically calls openChat. +-- Returns result in reverse chronological order, i.e. in order of decreasing message.message_id +-- @chat_id Chat identifier +-- @from_message_id Identifier of the message near which we need a history, you can use 0 to get results from the beginning, i.e. from oldest to newest +-- @offset Specify 0 to get results exactly from from_message_id or negative offset to get specified message and some newer messages +-- @limit Maximum number of messages to be returned, should be positive and can't be greater than 100. +-- If offset is negative, limit must be greater than -offset. +-- There may be less than limit messages returned even the end of the history is not reached +local function getChatHistory(chat_id, from_message_id, offset, limit, dl_cb, cmd) + if not limit or limit > 100 then + limit = 100 + end + + tdcli_function ({ + ID = "GetChatHistory", + chat_id_ = chat_id, + from_message_id_ = from_message_id, + offset_ = offset or 0, + limit_ = limit + }, dl_cb, cmd) +end + +M.getChatHistory = getChatHistory + +-- Deletes all messages in the chat. +-- Can't be used for channel chats +-- @chat_id Chat identifier +-- @remove_from_chat_list Pass true, if chat should be removed from the chat list +local function deleteChatHistory(chat_id, remove_from_chat_list, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteChatHistory", + chat_id_ = chat_id, + remove_from_chat_list_ = remove_from_chat_list + }, dl_cb, cmd) +end + +M.deleteChatHistory = deleteChatHistory + +-- Searches for messages with given words in the chat. +-- Returns result in reverse chronological order, i. e. in order of decreasimg message_id. +-- Doesn't work in secret chats +-- @chat_id Chat identifier to search in +-- @query Query to search for +-- @from_message_id Identifier of the message from which we need a history, you can use 0 to get results from beginning +-- @limit Maximum number of messages to be returned, can't be greater than 100 +-- @filter Filter for content of searched messages +-- filter = Empty|Animation|Audio|Document|Photo|Video|Voice|PhotoAndVideo|Url|ChatPhoto +local function searchChatMessages(chat_id, query, from_message_id, limit, filter, dl_cb, cmd) + if not limit or limit > 100 then + limit = 100 + end + + tdcli_function ({ + ID = "SearchChatMessages", + chat_id_ = chat_id, + query_ = query, + from_message_id_ = from_message_id, + limit_ = limit, + filter_ = { + ID = 'SearchMessagesFilter' .. filter + }, + }, dl_cb, cmd) +end + +M.searchChatMessages = searchChatMessages + +-- Searches for messages in all chats except secret chats. Returns result in reverse chronological order, i. e. in order of decreasing (date, chat_id, message_id) +-- @query Query to search for +-- @offset_date Date of the message to search from, you can use 0 or any date in the future to get results from the beginning +-- @offset_chat_id Chat identifier of the last found message or 0 for the first request +-- @offset_message_id Message identifier of the last found message or 0 for the first request +-- @limit Maximum number of messages to be returned, can't be greater than 100 +local function searchMessages(query, offset_date, offset_chat_id, offset_message_id, limit, dl_cb, cmd) + if not limit or limit > 100 then + limit = 100 + end + + tdcli_function ({ + ID = "SearchMessages", + query_ = query, + offset_date_ = offset_date, + offset_chat_id_ = offset_chat_id, + offset_message_id_ = offset_message_id, + limit_ = limit + }, dl_cb, cmd) +end + +M.searchMessages = searchMessages + +-- Invites bot to a chat (if it is not in the chat) and send /start to it. +-- Bot can't be invited to a private chat other than chat with the bot. +-- Bots can't be invited to broadcast channel chats and secret chats. +-- Returns sent message. +-- UpdateChatTopMessage will not be sent, so returned message should be used to update chat top message +-- @bot_user_id Identifier of the bot +-- @chat_id Identifier of the chat +-- @parameter Hidden parameter sent to bot for deep linking (https://api.telegram.org/bots#deep-linking) +-- parameter=start|startgroup or custom as defined by bot creator +local function sendBotStartMessage(bot_user_id, chat_id, parameter, dl_cb, cmd) + tdcli_function ({ + ID = "SendBotStartMessage", + bot_user_id_ = bot_user_id, + chat_id_ = chat_id, + parameter_ = parameter + }, dl_cb, cmd) +end + +M.sendBotStartMessage = sendBotStartMessage + +-- Sends result of the inline query as a message. +-- Returns sent message. +-- UpdateChatTopMessage will not be sent, so returned message should be used to update chat top message. +-- Always clears chat draft message +-- @chat_id Chat to send message +-- @reply_to_message_id Identifier of a message to reply to or 0 +-- @disable_notification Pass true, to disable notification about the message, doesn't works in secret chats +-- @from_background Pass true, if the message is sent from background +-- @query_id Identifier of the inline query +-- @result_id Identifier of the inline result +local function sendInlineQueryResultMessage(chat_id, reply_to_message_id, disable_notification, from_background, query_id, result_id, dl_cb, cmd) + tdcli_function ({ + ID = "SendInlineQueryResultMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + query_id_ = query_id, + result_id_ = result_id + }, dl_cb, cmd) +end + +M.sendInlineQueryResultMessage = sendInlineQueryResultMessage + +-- Forwards previously sent messages. +-- Returns forwarded messages in the same order as message identifiers passed in message_ids. +-- If message can't be forwarded, null will be returned instead of the message. +-- UpdateChatTopMessage will not be sent, so returned messages should be used to update chat top message +-- @chat_id Identifier of a chat to forward messages +-- @from_chat_id Identifier of a chat to forward from +-- @message_ids Identifiers of messages to forward +-- @disable_notification Pass true, to disable notification about the message, doesn't works if messages are forwarded to secret chat +-- @from_background Pass true, if the message is sent from background +local function forwardMessages(chat_id, from_chat_id, message_ids, disable_notification, dl_cb, cmd) + tdcli_function ({ + ID = "ForwardMessages", + chat_id_ = chat_id, + from_chat_id_ = from_chat_id, + message_ids_ = message_ids, -- vector + disable_notification_ = disable_notification, + from_background_ = 1 + }, dl_cb, cmd) +end + +M.forwardMessages = forwardMessages + +-- Changes current ttl setting in a secret chat and sends corresponding message +-- @chat_id Chat identifier +-- @ttl New value of ttl in seconds +local function sendChatSetTtlMessage(chat_id, ttl, dl_cb, cmd) + tdcli_function ({ + ID = "SendChatSetTtlMessage", + chat_id_ = chat_id, + ttl_ = ttl + }, dl_cb, cmd) +end + +M.sendChatSetTtlMessage = sendChatSetTtlMessage + +-- Deletes messages. +-- UpdateDeleteMessages will not be sent for messages deleted through that function +-- @chat_id Chat identifier +-- @message_ids Identifiers of messages to delete +local function deleteMessages(chat_id, message_ids, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteMessages", + chat_id_ = chat_id, + message_ids_ = message_ids -- vector + }, dl_cb, cmd) +end + +M.deleteMessages = deleteMessages + +-- Deletes all messages in the chat sent by the specified user. +-- Works only in supergroup channel chats, needs appropriate privileges +-- @chat_id Chat identifier +-- @user_id User identifier +local function deleteMessagesFromUser(chat_id, user_id, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteMessagesFromUser", + chat_id_ = chat_id, + user_id_ = user_id + }, dl_cb, cmd) +end + +M.deleteMessagesFromUser = deleteMessagesFromUser + +-- Edits text of text or game message. +-- Non-bots can edit message in a limited period of time. +-- Returns edited message after edit is complete server side +-- @chat_id Chat the message belongs to +-- @message_id Identifier of the message +-- @reply_markup Bots only. New message reply markup +-- @input_message_content New text content of the message. Should be of type InputMessageText +local function editMessageText(chat_id, message_id, reply_markup, text, disable_web_page_preview, parse_mode, dl_cb, cmd) + local TextParseMode = getParseMode(parse_mode) + + tdcli_function ({ + ID = "EditMessageText", + chat_id_ = chat_id, + message_id_ = message_id, + reply_markup_ = reply_markup, -- reply_markup:ReplyMarkup + input_message_content_ = { + ID = "InputMessageText", + text_ = text, + disable_web_page_preview_ = disable_web_page_preview, + clear_draft_ = 0, + entities_ = {}, + parse_mode_ = TextParseMode, + }, + }, dl_cb, cmd) +end + +M.editMessageText = editMessageText + +-- Edits message content caption. +-- Non-bots can edit message in a limited period of time. +-- Returns edited message after edit is complete server side +-- @chat_id Chat the message belongs to +-- @message_id Identifier of the message +-- @reply_markup Bots only. New message reply markup +-- @caption New message content caption, 0-200 characters +local function editMessageCaption(chat_id, message_id, reply_markup, caption, dl_cb, cmd) + tdcli_function ({ + ID = "EditMessageCaption", + chat_id_ = chat_id, + message_id_ = message_id, + reply_markup_ = reply_markup, -- reply_markup:ReplyMarkup + caption_ = caption + }, dl_cb, cmd) +end + +M.editMessageCaption = editMessageCaption + +-- Bots only. +-- Edits message reply markup. +-- Returns edited message after edit is complete server side +-- @chat_id Chat the message belongs to +-- @message_id Identifier of the message +-- @reply_markup New message reply markup +local function editMessageReplyMarkup(inline_message_id, reply_markup, caption, dl_cb, cmd) + tdcli_function ({ + ID = "EditInlineMessageCaption", + inline_message_id_ = inline_message_id, + reply_markup_ = reply_markup, -- reply_markup:ReplyMarkup + caption_ = caption + }, dl_cb, cmd) +end + +M.editMessageReplyMarkup = editMessageReplyMarkup + +-- Bots only. +-- Edits text of an inline text or game message sent via bot +-- @inline_message_id Inline message identifier +-- @reply_markup New message reply markup +-- @input_message_content New text content of the message. Should be of type InputMessageText +local function editInlineMessageText(inline_message_id, reply_markup, text, disable_web_page_preview, dl_cb, cmd) + tdcli_function ({ + ID = "EditInlineMessageText", + inline_message_id_ = inline_message_id, + reply_markup_ = reply_markup, -- reply_markup:ReplyMarkup + input_message_content_ = { + ID = "InputMessageText", + text_ = text, + disable_web_page_preview_ = disable_web_page_preview, + clear_draft_ = 0, + entities_ = {} + }, + }, dl_cb, cmd) +end + +M.editInlineMessageText = editInlineMessageText + +-- Bots only. +-- Edits caption of an inline message content sent via bot +-- @inline_message_id Inline message identifier +-- @reply_markup New message reply markup +-- @caption New message content caption, 0-200 characters +local function editInlineMessageCaption(inline_message_id, reply_markup, caption, dl_cb, cmd) + tdcli_function ({ + ID = "EditInlineMessageCaption", + inline_message_id_ = inline_message_id, + reply_markup_ = reply_markup, -- reply_markup:ReplyMarkup + caption_ = caption + }, dl_cb, cmd) +end + +M.editInlineMessageCaption = editInlineMessageCaption + +-- Bots only. +-- Edits reply markup of an inline message sent via bot +-- @inline_message_id Inline message identifier +-- @reply_markup New message reply markup +local function editInlineMessageReplyMarkup(inline_message_id, reply_markup, dl_cb, cmd) + tdcli_function ({ + ID = "EditInlineMessageReplyMarkup", + inline_message_id_ = inline_message_id, + reply_markup_ = reply_markup -- reply_markup:ReplyMarkup + }, dl_cb, cmd) +end + +M.editInlineMessageReplyMarkup = editInlineMessageReplyMarkup + + +-- Sends inline query to a bot and returns its results. +-- Unavailable for bots +-- @bot_user_id Identifier of the bot send query to +-- @chat_id Identifier of the chat, where the query is sent +-- @user_location User location, only if needed +-- @query Text of the query +-- @offset Offset of the first entry to return +local function getInlineQueryResults(bot_user_id, chat_id, latitude, longitude, query, offset, dl_cb, cmd) + tdcli_function ({ + ID = "GetInlineQueryResults", + bot_user_id_ = bot_user_id, + chat_id_ = chat_id, + user_location_ = { + ID = "Location", + latitude_ = latitude, + longitude_ = longitude + }, + query_ = query, + offset_ = offset + }, dl_cb, cmd) +end + +M.getInlineQueryResults = getInlineQueryResults + +-- Bots only. +-- Sets result of the inline query +-- @inline_query_id Identifier of the inline query +-- @is_personal Does result of the query can be cached only for specified user +-- @results Results of the query +-- @cache_time Allowed time to cache results of the query in seconds +-- @next_offset Offset for the next inline query, pass empty string if there is no more results +-- @switch_pm_text If non-empty, this text should be shown on the button, which opens private chat with the bot and sends bot start message with parameter switch_pm_parameter +-- @switch_pm_parameter Parameter for the bot start message +local function answerInlineQuery(inline_query_id, is_personal, cache_time, next_offset, switch_pm_text, switch_pm_parameter, dl_cb, cmd) + tdcli_function ({ + ID = "AnswerInlineQuery", + inline_query_id_ = inline_query_id, + is_personal_ = is_personal, + results_ = results, --vector<InputInlineQueryResult>, + cache_time_ = cache_time, + next_offset_ = next_offset, + switch_pm_text_ = switch_pm_text, + switch_pm_parameter_ = switch_pm_parameter + }, dl_cb, cmd) +end + +M.answerInlineQuery = answerInlineQuery + +-- Sends callback query to a bot and returns answer to it. +-- Unavailable for bots +-- @chat_id Identifier of the chat with a message +-- @message_id Identifier of the message, from which the query is originated +-- @payload Query payload +-- @text Text of the answer +-- @show_alert If true, an alert should be shown to the user instead of a toast +-- @url URL to be open +local function getCallbackQueryAnswer(chat_id, message_id, text, show_alert, url, dl_cb, cmd) + tdcli_function ({ + ID = "GetCallbackQueryAnswer", + chat_id_ = chat_id, + message_id_ = message_id, + payload_ = { + ID = "CallbackQueryAnswer", + text_ = text, + show_alert_ = show_alert, + url_ = url + }, + }, dl_cb, cmd) +end + +M.getCallbackQueryAnswer = getCallbackQueryAnswer + +-- Bots only. +-- Sets result of the callback query +-- @callback_query_id Identifier of the callback query +-- @text Text of the answer +-- @show_alert If true, an alert should be shown to the user instead of a toast +-- @url Url to be opened +-- @cache_time Allowed time to cache result of the query in seconds +local function answerCallbackQuery(callback_query_id, text, show_alert, url, cache_time, dl_cb, cmd) + tdcli_function ({ + ID = "AnswerCallbackQuery", + callback_query_id_ = callback_query_id, + text_ = text, + show_alert_ = show_alert, + url_ = url, + cache_time_ = cache_time + }, dl_cb, cmd) +end + +M.answerCallbackQuery = answerCallbackQuery + +-- Bots only. +-- Updates game score of the specified user in the game +-- @chat_id Chat a message with the game belongs to +-- @message_id Identifier of the message +-- @edit_message True, if message should be edited +-- @user_id User identifier +-- @score New score +-- @force Pass True to update the score even if it decreases. If score is 0, user will be deleted from the high scores table +local function setGameScore(chat_id, message_id, edit_message, user_id, score, force, dl_cb, cmd) + tdcli_function ({ + ID = "SetGameScore", + chat_id_ = chat_id, + message_id_ = message_id, + edit_message_ = edit_message, + user_id_ = user_id, + score_ = score, + force_ = force + }, dl_cb, cmd) +end + +M.setGameScore = setGameScore + +-- Bots only. +-- Updates game score of the specified user in the game +-- @inline_message_id Inline message identifier +-- @edit_message True, if message should be edited +-- @user_id User identifier +-- @score New score +-- @force Pass True to update the score even if it decreases. If score is 0, user will be deleted from the high scores table +local function setInlineGameScore(inline_message_id, edit_message, user_id, score, force, dl_cb, cmd) + tdcli_function ({ + ID = "SetInlineGameScore", + inline_message_id_ = inline_message_id, + edit_message_ = edit_message, + user_id_ = user_id, + score_ = score, + force_ = force + }, dl_cb, cmd) +end + +M.setInlineGameScore = setInlineGameScore + +-- Bots only. +-- Returns game high scores and some part of the score table around of the specified user in the game +-- @chat_id Chat a message with the game belongs to +-- @message_id Identifier of the message +-- @user_id User identifie +local function getGameHighScores(chat_id, message_id, user_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetGameHighScores", + chat_id_ = chat_id, + message_id_ = message_id, + user_id_ = user_id + }, dl_cb, cmd) +end + +M.getGameHighScores = getGameHighScores + +-- Bots only. +-- Returns game high scores and some part of the score table around of the specified user in the game +-- @inline_message_id Inline message identifier +-- @user_id User identifier +local function getInlineGameHighScores(inline_message_id, user_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetInlineGameHighScores", + inline_message_id_ = inline_message_id, + user_id_ = user_id + }, dl_cb, cmd) +end + +M.getInlineGameHighScores = getInlineGameHighScores + +-- Deletes default reply markup from chat. +-- This method needs to be called after one-time keyboard or ForceReply reply markup has been used. +-- UpdateChatReplyMarkup will be send if reply markup will be changed +-- @chat_id Chat identifier +-- @message_id Message identifier of used keyboard +local function deleteChatReplyMarkup(chat_id, message_id, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteChatReplyMarkup", + chat_id_ = chat_id, + message_id_ = message_id + }, dl_cb, cmd) +end + +M.deleteChatReplyMarkup = deleteChatReplyMarkup + +-- Sends notification about user activity in a chat +-- @chat_id Chat identifier +-- @action Action description +-- action = Typing|Cancel|RecordVideo|UploadVideo|RecordVoice|UploadVoice|UploadPhoto|UploadDocument|GeoLocation|ChooseContact|StartPlayGame +local function sendChatAction(chat_id, action, progress, dl_cb, cmd) + tdcli_function ({ + ID = "SendChatAction", + chat_id_ = chat_id, + action_ = { + ID = "SendMessage" .. action .. "Action", + progress_ = progress or 100 + } + }, dl_cb, cmd) +end + +M.sendChatAction = sendChatAction + +-- Sends notification about screenshot taken in a chat. +-- Works only in secret chats +-- @chat_id Chat identifier +local function sendChatScreenshotTakenNotification(chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "SendChatScreenshotTakenNotification", + chat_id_ = chat_id + }, dl_cb, cmd) +end + +M.sendChatScreenshotTakenNotification = sendChatScreenshotTakenNotification + +-- Chat is opened by the user. +-- Many useful activities depends on chat being opened or closed. For example, in channels all updates are received only for opened chats +-- @chat_id Chat identifier +local function openChat(chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "OpenChat", + chat_id_ = chat_id + }, dl_cb, cmd) +end + +M.openChat = openChat + +-- Chat is closed by the user. +-- Many useful activities depends on chat being opened or closed. +-- @chat_id Chat identifier +local function closeChat(chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "CloseChat", + chat_id_ = chat_id + }, dl_cb, cmd) +end + +M.closeChat = closeChat + +-- Messages are viewed by the user. +-- Many useful activities depends on message being viewed. For example, marking messages as read, incrementing of view counter, updating of view counter, removing of deleted messages in channels +-- @chat_id Chat identifier +-- @message_ids Identifiers of viewed messages +local function viewMessages(chat_id, message_ids, dl_cb, cmd) + tdcli_function ({ + ID = "ViewMessages", + chat_id_ = chat_id, + message_ids_ = message_ids -- vector + }, dl_cb, cmd) +end + +M.viewMessages = viewMessages + +-- Message content is opened, for example the user has opened a photo, a video, a document, a location or a venue or have listened to an audio or a voice message +-- @chat_id Chat identifier of the message +-- @message_id Identifier of the message with opened content +local function openMessageContent(chat_id, message_id, dl_cb, cmd) + tdcli_function ({ + ID = "OpenMessageContent", + chat_id_ = chat_id, + message_id_ = message_id + }, dl_cb, cmd) +end + +M.openMessageContent = openMessageContent + +-- Returns existing chat corresponding to the given user +-- @user_id User identifier +local function createPrivateChat(user_id, dl_cb, cmd) + tdcli_function ({ + ID = "CreatePrivateChat", + user_id_ = user_id + }, dl_cb, cmd) +end + +M.createPrivateChat = createPrivateChat + +-- Returns existing chat corresponding to the known group +-- @group_id Group identifier +local function createGroupChat(group_id, dl_cb, cmd) + tdcli_function ({ + ID = "CreateGroupChat", + group_id_ = getChatId(group_id).ID + }, dl_cb, cmd) +end + +M.createGroupChat = createGroupChat + +-- Returns existing chat corresponding to the known channel +-- @channel_id Channel identifier +local function createChannelChat(channel_id, dl_cb, cmd) + tdcli_function ({ + ID = "CreateChannelChat", + channel_id_ = getChatId(channel_id).ID + }, dl_cb, cmd) +end + +M.createChannelChat = createChannelChat + +-- Returns existing chat corresponding to the known secret chat +-- @secret_chat_id SecretChat identifier +local function createSecretChat(secret_chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "CreateSecretChat", + secret_chat_id_ = secret_chat_id + }, dl_cb, cmd) +end + +M.createSecretChat = createSecretChat + +-- Creates new group chat and send corresponding messageGroupChatCreate, returns created chat +-- @user_ids Identifiers of users to add to the group +-- @title Title of new group chat, 0-255 characters +local function createNewGroupChat(user_ids, title, dl_cb, cmd) + tdcli_function ({ + ID = "CreateNewGroupChat", + user_ids_ = user_ids, -- vector + title_ = title + }, dl_cb, cmd) +end + +M.createNewGroupChat = createNewGroupChat + +-- Creates new channel chat and send corresponding messageChannelChatCreate, returns created chat +-- @title Title of new channel chat, 0-255 characters +-- @is_supergroup True, if supergroup chat should be created +-- @about Information about the channel, 0-255 characters +local function createNewChannelChat(title, is_supergroup, about, dl_cb, cmd) + tdcli_function ({ + ID = "CreateNewChannelChat", + title_ = title, + is_supergroup_ = is_supergroup, + about_ = about + }, dl_cb, cmd) +end + +M.createNewChannelChat = createNewChannelChat + +-- Creates new secret chat, returns created chat +-- @user_id Identifier of a user to create secret chat with +local function createNewSecretChat(user_id, dl_cb, cmd) + tdcli_function ({ + ID = "CreateNewSecretChat", + user_id_ = user_id + }, dl_cb, cmd) +end + +M.createNewSecretChat = createNewSecretChat + +-- Creates new channel supergroup chat from existing group chat and send corresponding messageChatMigrateTo and messageChatMigrateFrom. Deactivates group +-- @chat_id Group chat identifier +local function migrateGroupChatToChannelChat(chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "MigrateGroupChatToChannelChat", + chat_id_ = chat_id + }, dl_cb, cmd) +end + +M.migrateGroupChatToChannelChat = migrateGroupChatToChannelChat + +-- Changes chat title. +-- Title can't be changed for private chats. +-- Title will not change until change will be synchronized with the server. +-- Title will not be changed if application is killed before it can send request to the server. +-- There will be update about change of the title on success. Otherwise error will be returned +-- @chat_id Chat identifier +-- @title New title of a chat, 0-255 characters +local function changeChatTitle(chat_id, title, dl_cb, cmd) + tdcli_function ({ + ID = "ChangeChatTitle", + chat_id_ = chat_id, + title_ = title + }, dl_cb, cmd) +end + +M.changeChatTitle = changeChatTitle + +-- Changes chat photo. +-- Photo can't be changed for private chats. +-- Photo will not change until change will be synchronized with the server. +-- Photo will not be changed if application is killed before it can send request to the server. +-- There will be update about change of the photo on success. Otherwise error will be returned +-- @chat_id Chat identifier +-- @photo New chat photo. You can use zero InputFileId to delete photo. Files accessible only by HTTP URL are not acceptable +local function changeChatPhoto(chat_id, photo, dl_cb, cmd) + tdcli_function ({ + ID = "ChangeChatPhoto", + chat_id_ = chat_id, + photo_ = getInputFile(photo) + }, dl_cb, cmd) +end + +M.changeChatPhoto = changeChatPhoto + +-- Changes chat draft message +-- @chat_id Chat identifier +-- @draft_message New draft message, nullable +local function changeChatDraftMessage(chat_id, reply_to_message_id, text, disable_web_page_preview, clear_draft, parse_mode, dl_cb, cmd) + local TextParseMode = getParseMode(parse_mode) + + tdcli_function ({ + ID = "ChangeChatDraftMessage", + chat_id_ = chat_id, + draft_message_ = { + ID = "DraftMessage", + reply_to_message_id_ = reply_to_message_id, + input_message_text_ = { + ID = "InputMessageText", + text_ = text, + disable_web_page_preview_ = disable_web_page_preview, + clear_draft_ = clear_draft, + entities_ = {}, + parse_mode_ = TextParseMode, + }, + }, + }, dl_cb, cmd) +end + +M.changeChatDraftMessage = changeChatDraftMessage + +-- Adds new member to chat. +-- Members can't be added to private or secret chats. +-- Member will not be added until chat state will be synchronized with the server. +-- Member will not be added if application is killed before it can send request to the server +-- @chat_id Chat identifier +-- @user_id Identifier of the user to add +-- @forward_limit Number of previous messages from chat to forward to new member, ignored for channel chats +local function addChatMember(chat_id, user_id, forward_limit, dl_cb, cmd) + tdcli_function ({ + ID = "AddChatMember", + chat_id_ = chat_id, + user_id_ = user_id, + forward_limit_ = forward_limit or 50 + }, dl_cb, cmd) +end + +M.addChatMember = addChatMember + +-- Adds many new members to the chat. +-- Currently, available only for channels. +-- Can't be used to join the channel. +-- Member will not be added until chat state will be synchronized with the server. +-- Member will not be added if application is killed before it can send request to the server +-- @chat_id Chat identifier +-- @user_ids Identifiers of the users to add +local function addChatMembers(chat_id, user_ids, dl_cb, cmd) + tdcli_function ({ + ID = "AddChatMembers", + chat_id_ = chat_id, + user_ids_ = user_ids -- vector + }, dl_cb, cmd) +end + +M.addChatMembers = addChatMembers + +-- Changes status of the chat member, need appropriate privileges. +-- In channel chats, user will be added to chat members if he is yet not a member and there is less than 200 members in the channel. +-- Status will not be changed until chat state will be synchronized with the server. +-- Status will not be changed if application is killed before it can send request to the server +-- @chat_id Chat identifier +-- @user_id Identifier of the user to edit status, bots can be editors in the channel chats +-- @status New status of the member in the chat +-- status = Creator|Editor|Moderator|Member|Left|Kicked +local function changeChatMemberStatus(chat_id, user_id, status, dl_cb, cmd) + tdcli_function ({ + ID = "ChangeChatMemberStatus", + chat_id_ = chat_id, + user_id_ = user_id, + status_ = { + ID = "ChatMemberStatus" .. status + }, + }, dl_cb, cmd) +end + +M.changeChatMemberStatus = changeChatMemberStatus + +-- Returns information about one participant of the chat +-- @chat_id Chat identifier +-- @user_id User identifier +local function getChatMember(chat_id, user_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetChatMember", + chat_id_ = chat_id, + user_id_ = user_id + }, dl_cb, cmd) +end + +M.getChatMember = getChatMember + +-- Asynchronously downloads file from cloud. +-- Updates updateFileProgress will notify about download progress. +-- Update updateFile will notify about successful download +-- @file_id Identifier of file to download +local function downloadFile(file_id, dl_cb, cmd) + tdcli_function ({ + ID = "DownloadFile", + file_id_ = file_id + }, dl_cb, cmd) +end + +M.downloadFile = downloadFile + +-- Stops file downloading. +-- If file already downloaded do nothing. +-- @file_id Identifier of file to cancel download +local function cancelDownloadFile(file_id, dl_cb, cmd) + tdcli_function ({ + ID = "CancelDownloadFile", + file_id_ = file_id + }, dl_cb, cmd) +end + +M.cancelDownloadFile = cancelDownloadFile + +-- Next part of a file was generated +-- @generation_id Identifier of the generation process +-- @ready Number of bytes already generated. Negative number means that generation has failed and should be terminated +local function setFileGenerationProgress(generation_id, ready, dl_cb, cmd) + tdcli_function ({ + ID = "SetFileGenerationProgress", + generation_id_ = generation_id, + ready_ = ready + }, dl_cb, cmd) +end + +M.setFileGenerationProgress = setFileGenerationProgress + +-- Finishes file generation +-- @generation_id Identifier of the generation process +local function finishFileGeneration(generation_id, dl_cb, cmd) + tdcli_function ({ + ID = "FinishFileGeneration", + generation_id_ = generation_id + }, dl_cb, cmd) +end + +M.finishFileGeneration = finishFileGeneration + +-- Generates new chat invite link, previously generated link is revoked. +-- Available for group and channel chats. +-- Only creator of the chat can export chat invite link +-- @chat_id Chat identifier +local function exportChatInviteLink(chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "ExportChatInviteLink", + chat_id_ = chat_id + }, dl_cb, cmd) +end + +M.exportChatInviteLink = exportChatInviteLink + +-- Checks chat invite link for validness and returns information about the corresponding chat +-- @invite_link Invite link to check. Should begin with "https://telegram.me/joinchat/" +local function checkChatInviteLink(link, dl_cb, cmd) + tdcli_function ({ + ID = "CheckChatInviteLink", + invite_link_ = link + }, dl_cb, cmd) +end + +M.checkChatInviteLink = checkChatInviteLink + +-- Imports chat invite link, adds current user to a chat if possible. +-- Member will not be added until chat state will be synchronized with the server. +-- Member will not be added if application is killed before it can send request to the server +-- @invite_link Invite link to import. Should begin with "https://telegram.me/joinchat/" +local function importChatInviteLink(invite_link, dl_cb, cmd) + tdcli_function ({ + ID = "ImportChatInviteLink", + invite_link_ = invite_link + }, dl_cb, cmd) +end + +M.importChatInviteLink = importChatInviteLink + +-- Adds user to black list +-- @user_id User identifier +local function blockUser(user_id, dl_cb, cmd) + tdcli_function ({ + ID = "BlockUser", + user_id_ = user_id + }, dl_cb, cmd) +end + +M.blockUser = blockUser + +-- Removes user from black list +-- @user_id User identifier +local function unblockUser(user_id, dl_cb, cmd) + tdcli_function ({ + ID = "UnblockUser", + user_id_ = user_id + }, dl_cb, cmd) +end + +M.unblockUser = unblockUser + +-- Returns users blocked by the current user +-- @offset Number of users to skip in result, must be non-negative +-- @limit Maximum number of users to return, can't be greater than 100 +local function getBlockedUsers(offset, limit, dl_cb, cmd) + tdcli_function ({ + ID = "GetBlockedUsers", + offset_ = offset, + limit_ = limit + }, dl_cb, cmd) +end + +M.getBlockedUsers = getBlockedUsers + +-- Adds new contacts/edits existing contacts, contacts user identifiers are ignored. +-- Returns list of corresponding users in the same order as input contacts. +-- If contact doesn't registered in Telegram, user with id == 0 will be returned +-- @contacts List of contacts to import/edit +local function importContacts(phone_number, first_name, last_name, user_id, dl_cb, cmd) + tdcli_function ({ + ID = "ImportContacts", + contacts_ = {[0] = { + phone_number_ = tostring(phone_number), + first_name_ = tostring(first_name), + last_name_ = tostring(last_name), + user_id_ = user_id + }, + }, + }, dl_cb, cmd) +end + +M.importContacts = importContacts + +-- Searches for specified query in the first name, last name and username of the known user contacts +-- @query Query to search for, can be empty to return all contacts +-- @limit Maximum number of users to be returned +local function searchContacts(query, limit, dl_cb, cmd) + tdcli_function ({ + ID = "SearchContacts", + query_ = query, + limit_ = limit + }, dl_cb, cmd) +end + +M.searchContacts = searchContacts + +-- Deletes users from contacts list +-- @user_ids Identifiers of users to be deleted +local function deleteContacts(user_ids, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteContacts", + user_ids_ = user_ids -- vector + }, dl_cb, cmd) +end + +M.deleteContacts = deleteContacts + +-- Returns profile photos of the user. +-- Result of this query can't be invalidated, so it must be used with care +-- @user_id User identifier +-- @offset Photos to skip, must be non-negative +-- @limit Maximum number of photos to be returned, can't be greater than 100 +local function getUserProfilePhotos(user_id, offset, limit, dl_cb, cmd) + tdcli_function ({ + ID = "GetUserProfilePhotos", + user_id_ = user_id, + offset_ = offset, + limit_ = limit + }, dl_cb, cmd) +end + +M.getUserProfilePhotos = getUserProfilePhotos + +-- Returns stickers corresponding to given emoji +-- @emoji String representation of emoji. If empty, returns all known stickers +local function getStickers(emoji, dl_cb, cmd) + tdcli_function ({ + ID = "GetStickers", + emoji_ = emoji + }, dl_cb, cmd) +end + +M.getStickers = getStickers + +-- Returns list of installed sticker sets without archived sticker sets +-- @is_masks Pass true to return masks, pass false to return stickers +local function getStickerSets(is_masks, dl_cb, cmd) + tdcli_function ({ + ID = "GetStickerSets", + is_masks_ = is_masks + }, dl_cb, cmd) +end + +M.getStickerSets = getStickerSets + +-- Returns list of archived sticker sets +-- @is_masks Pass true to return masks, pass false to return stickers +-- @offset_sticker_set_id Identifier of the sticker set from which return the result +-- @limit Maximum number of sticker sets to return +local function getArchivedStickerSets(is_masks, offset_sticker_set_id, limit, dl_cb, cmd) + tdcli_function ({ + ID = "GetArchivedStickerSets", + is_masks_ = is_masks, + offset_sticker_set_id_ = offset_sticker_set_id, + limit_ = limit + }, dl_cb, cmd) +end + +M.getArchivedStickerSets = getArchivedStickerSets + +-- Returns list of trending sticker sets +local function getTrendingStickerSets(dl_cb, cmd) + tdcli_function ({ + ID = "GetTrendingStickerSets" + }, dl_cb, cmd) +end + +M.getTrendingStickerSets = getTrendingStickerSets + +-- Returns list of sticker sets attached to a file, currently only photos and videos can have attached sticker sets +-- @file_id File identifier +local function getAttachedStickerSets(file_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetAttachedStickerSets", + file_id_ = file_id + }, dl_cb, cmd) +end + +M.getAttachedStickerSets = getAttachedStickerSets + +-- Returns information about sticker set by its identifier +-- @set_id Identifier of the sticker set +local function getStickerSet(set_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetStickerSet", + set_id_ = set_id + }, dl_cb, cmd) +end + +M.getStickerSet = getStickerSet + +-- Searches sticker set by its short name +-- @name Name of the sticker set +local function searchStickerSet(name, dl_cb, cmd) + tdcli_function ({ + ID = "SearchStickerSet", + name_ = name + }, dl_cb, cmd) +end + +M.searchStickerSet = searchStickerSet + +-- Installs/uninstalls or enables/archives sticker set. +-- Official sticker set can't be uninstalled, but it can be archived +-- @set_id Identifier of the sticker set +-- @is_installed New value of is_installed +-- @is_archived New value of is_archived +local function updateStickerSet(set_id, is_installed, is_archived, dl_cb, cmd) + tdcli_function ({ + ID = "UpdateStickerSet", + set_id_ = set_id, + is_installed_ = is_installed, + is_archived_ = is_archived + }, dl_cb, cmd) +end + +M.updateStickerSet = updateStickerSet + +-- Trending sticker sets are viewed by the user +-- @sticker_set_ids Identifiers of viewed trending sticker sets +local function viewTrendingStickerSets(sticker_set_ids, dl_cb, cmd) + tdcli_function ({ + ID = "ViewTrendingStickerSets", + sticker_set_ids_ = sticker_set_ids -- vector + }, dl_cb, cmd) +end + +M.viewTrendingStickerSets = viewTrendingStickerSets + +-- Changes the order of installed sticker sets +-- @is_masks Pass true to change masks order, pass false to change stickers order +-- @sticker_set_ids Identifiers of installed sticker sets in the new right order +local function reorderStickerSets(is_masks, sticker_set_ids, dl_cb, cmd) + tdcli_function ({ + ID = "ReorderStickerSets", + is_masks_ = is_masks, + sticker_set_ids_ = sticker_set_ids -- vector + }, dl_cb, cmd) +end + +M.reorderStickerSets = reorderStickerSets + +-- Returns list of recently used stickers +-- @is_attached Pass true to return stickers and masks recently attached to photo or video files, pass false to return recently sent stickers +local function getRecentStickers(is_attached, dl_cb, cmd) + tdcli_function ({ + ID = "GetRecentStickers", + is_attached_ = is_attached + }, dl_cb, cmd) +end + +M.getRecentStickers = getRecentStickers + +-- Manually adds new sticker to the list of recently used stickers. +-- New sticker is added to the beginning of the list. +-- If the sticker is already in the list, at first it is removed from the list +-- @is_attached Pass true to add the sticker to the list of stickers recently attached to photo or video files, pass false to add the sticker to the list of recently sent stickers +-- @sticker Sticker file to add +local function addRecentSticker(is_attached, sticker, dl_cb, cmd) + tdcli_function ({ + ID = "AddRecentSticker", + is_attached_ = is_attached, + sticker_ = getInputFile(sticker) + }, dl_cb, cmd) +end + +M.addRecentSticker = addRecentSticker + +-- Removes a sticker from the list of recently used stickers +-- @is_attached Pass true to remove the sticker from the list of stickers recently attached to photo or video files, pass false to remove the sticker from the list of recently sent stickers +-- @sticker Sticker file to delete +local function deleteRecentSticker(is_attached, sticker, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteRecentSticker", + is_attached_ = is_attached, + sticker_ = getInputFile(sticker) + }, dl_cb, cmd) +end + +M.deleteRecentSticker = deleteRecentSticker + +-- Clears list of recently used stickers +-- @is_attached Pass true to clear list of stickers recently attached to photo or video files, pass false to clear the list of recently sent stickers +local function clearRecentStickers(is_attached, dl_cb, cmd) + tdcli_function ({ + ID = "ClearRecentStickers", + is_attached_ = is_attached + }, dl_cb, cmd) +end + +M.clearRecentStickers = clearRecentStickers + +-- Returns emojis corresponding to a sticker +-- @sticker Sticker file identifier +local function getStickerEmojis(sticker, dl_cb, cmd) + tdcli_function ({ + ID = "GetStickerEmojis", + sticker_ = getInputFile(sticker) + }, dl_cb, cmd) +end + +M.getStickerEmojis = getStickerEmojis + +-- Returns saved animations +local function getSavedAnimations(dl_cb, cmd) + tdcli_function ({ + ID = "GetSavedAnimations", + }, dl_cb, cmd) +end + +M.getSavedAnimations = getSavedAnimations + +-- Manually adds new animation to the list of saved animations. +-- New animation is added to the beginning of the list. +-- If the animation is already in the list, at first it is removed from the list. +-- Only non-secret video animations with MIME type "video/mp4" can be added to the list +-- @animation Animation file to add. Only known to server animations (i. e. successfully sent via message) can be added to the list +local function addSavedAnimation(animation, dl_cb, cmd) + tdcli_function ({ + ID = "AddSavedAnimation", + animation_ = getInputFile(animation) + }, dl_cb, cmd) +end + +M.addSavedAnimation = addSavedAnimation + +-- Removes animation from the list of saved animations +-- @animation Animation file to delete +local function deleteSavedAnimation(animation, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteSavedAnimation", + animation_ = getInputFile(animation) + }, dl_cb, cmd) +end + +M.deleteSavedAnimation = deleteSavedAnimation + +-- Returns up to 20 recently used inline bots in the order of the last usage +local function getRecentInlineBots(dl_cb, cmd) + tdcli_function ({ + ID = "GetRecentInlineBots", + }, dl_cb, cmd) +end + +M.getRecentInlineBots = getRecentInlineBots + +-- Get web page preview by text of the message. +-- Do not call this function to often +-- @message_text Message text +local function getWebPagePreview(message_text, dl_cb, cmd) + tdcli_function ({ + ID = "GetWebPagePreview", + message_text_ = message_text + }, dl_cb, cmd) +end + +M.getWebPagePreview = getWebPagePreview + +-- Returns notification settings for a given scope +-- @scope Scope to return information about notification settings +-- scope = Chat(chat_id)|PrivateChats|GroupChats|AllChats| +local function getNotificationSettings(scope, chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetNotificationSettings", + scope_ = { + ID = 'NotificationSettingsFor' .. scope, + chat_id_ = chat_id or nil + }, + }, dl_cb, cmd) +end + +M.getNotificationSettings = getNotificationSettings + +-- Changes notification settings for a given scope +-- @scope Scope to change notification settings +-- @notification_settings New notification settings for given scope +-- scope = Chat(chat_id)|PrivateChats|GroupChats|AllChats| +local function setNotificationSettings(scope, chat_id, mute_for, show_preview, dl_cb, cmd) + tdcli_function ({ + ID = "SetNotificationSettings", + scope_ = { + ID = 'NotificationSettingsFor' .. scope, + chat_id_ = chat_id or nil + }, + notification_settings_ = { + ID = "NotificationSettings", + mute_for_ = mute_for, + sound_ = "default", + show_preview_ = show_preview + } + }, dl_cb, cmd) +end + +M.setNotificationSettings = setNotificationSettings + +-- Resets all notification settings to the default value. +-- By default the only muted chats are supergroups, sound is set to 'default' and message previews are showed +local function resetAllNotificationSettings(dl_cb, cmd) + tdcli_function ({ + ID = "ResetAllNotificationSettings" + }, dl_cb, cmd) +end + +M.resetAllNotificationSettings = resetAllNotificationSettings + +-- Uploads new profile photo for logged in user. +-- Photo will not change until change will be synchronized with the server. +-- Photo will not be changed if application is killed before it can send request to the server. +-- If something changes, updateUser will be sent +-- @photo_path Path to new profile photo +local function setProfilePhoto(photo_path, dl_cb, cmd) + tdcli_function ({ + ID = "SetProfilePhoto", + photo_path_ = photo_path + }, dl_cb, cmd) +end + +M.setProfilePhoto = setProfilePhoto + +-- Deletes profile photo. +-- If something changes, updateUser will be sent +-- @profile_photo_id Identifier of profile photo to delete +local function deleteProfilePhoto(profile_photo_id, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteProfilePhoto", + profile_photo_id_ = profile_photo_id + }, dl_cb, cmd) +end + +M.deleteProfilePhoto = deleteProfilePhoto + +-- Changes first and last names of logged in user. +-- If something changes, updateUser will be sent +-- @first_name New value of user first name, 1-255 characters +-- @last_name New value of optional user last name, 0-255 characters +local function changeName(first_name, last_name, dl_cb, cmd) + tdcli_function ({ + ID = "ChangeName", + first_name_ = first_name, + last_name_ = last_name + }, dl_cb, cmd) +end + +M.changeName = changeName + +-- Changes about information of logged in user +-- @about New value of userFull.about, 0-255 characters +local function changeAbout(about, dl_cb, cmd) + tdcli_function ({ + ID = "ChangeAbout", + about_ = about + }, dl_cb, cmd) +end + +M.changeAbout = changeAbout + +-- Changes username of logged in user. +-- If something changes, updateUser will be sent +-- @username New value of username. Use empty string to remove username +local function changeUsername(username, dl_cb, cmd) + tdcli_function ({ + ID = "ChangeUsername", + username_ = username + }, dl_cb, cmd) +end + +M.changeUsername = changeUsername + +-- Changes user's phone number and sends authentication code to the new user's phone number. +-- Returns authStateWaitCode with information about sent code on success +-- @phone_number New user's phone number in any reasonable format +-- @allow_flash_call Pass True, if code can be sent via flash call to the specified phone number +-- @is_current_phone_number Pass true, if the phone number is used on the current device. Ignored if allow_flash_call is False +local function changePhoneNumber(phone_number, allow_flash_call, is_current_phone_number, dl_cb, cmd) + tdcli_function ({ + ID = "ChangePhoneNumber", + phone_number_ = phone_number, + allow_flash_call_ = allow_flash_call, + is_current_phone_number_ = is_current_phone_number + }, dl_cb, cmd) +end + +M.changePhoneNumber = changePhoneNumber + +-- Resends authentication code sent to change user's phone number. +-- Works only if in previously received authStateWaitCode next_code_type was not null. +-- Returns authStateWaitCode on success +local function resendChangePhoneNumberCode(dl_cb, cmd) + tdcli_function ({ + ID = "ResendChangePhoneNumberCode", + }, dl_cb, cmd) +end + +M.resendChangePhoneNumberCode = resendChangePhoneNumberCode + +-- Checks authentication code sent to change user's phone number. +-- Returns authStateOk on success +-- @code Verification code from SMS, voice call or flash call +local function checkChangePhoneNumberCode(code, dl_cb, cmd) + tdcli_function ({ + ID = "CheckChangePhoneNumberCode", + code_ = code + }, dl_cb, cmd) +end + +M.checkChangePhoneNumberCode = checkChangePhoneNumberCode + +-- Returns all active sessions of logged in user +local function getActiveSessions(dl_cb, cmd) + tdcli_function ({ + ID = "GetActiveSessions", + }, dl_cb, cmd) +end + +M.getActiveSessions = getActiveSessions + +-- Terminates another session of logged in user +-- @session_id Session identifier +local function terminateSession(session_id, dl_cb, cmd) + tdcli_function ({ + ID = "TerminateSession", + session_id_ = session_id + }, dl_cb, cmd) +end + +M.terminateSession = terminateSession + +-- Terminates all other sessions of logged in user +local function terminateAllOtherSessions(dl_cb, cmd) + tdcli_function ({ + ID = "TerminateAllOtherSessions", + }, dl_cb, cmd) +end + +M.terminateAllOtherSessions = terminateAllOtherSessions + +-- Gives or revokes all members of the group editor rights. +-- Needs creator privileges in the group +-- @group_id Identifier of the group +-- @anyone_can_edit New value of anyone_can_edit +local function toggleGroupEditors(group_id, anyone_can_edit, dl_cb, cmd) + tdcli_function ({ + ID = "ToggleGroupEditors", + group_id_ = getChatId(group_id).ID, + anyone_can_edit_ = anyone_can_edit + }, dl_cb, cmd) +end + +M.toggleGroupEditors = toggleGroupEditors + +-- Changes username of the channel. +-- Needs creator privileges in the channel +-- @channel_id Identifier of the channel +-- @username New value of username. Use empty string to remove username +local function changeChannelUsername(channel_id, username, dl_cb, cmd) + tdcli_function ({ + ID = "ChangeChannelUsername", + channel_id_ = getChatId(channel_id).ID, + username_ = username + }, dl_cb, cmd) +end + +M.changeChannelUsername = changeChannelUsername + +-- Gives or revokes right to invite new members to all current members of the channel. +-- Needs creator privileges in the channel. +-- Available only for supergroups +-- @channel_id Identifier of the channel +-- @anyone_can_invite New value of anyone_can_invite +local function toggleChannelInvites(channel_id, anyone_can_invite, dl_cb, cmd) + tdcli_function ({ + ID = "ToggleChannelInvites", + channel_id_ = getChatId(channel_id).ID, + anyone_can_invite_ = anyone_can_invite + }, dl_cb, cmd) +end + +M.toggleChannelInvites = toggleChannelInvites + +-- Enables or disables sender signature on sent messages in the channel. +-- Needs creator privileges in the channel. +-- Not available for supergroups +-- @channel_id Identifier of the channel +-- @sign_messages New value of sign_messages +local function toggleChannelSignMessages(channel_id, sign_messages, dl_cb, cmd) + tdcli_function ({ + ID = "ToggleChannelSignMessages", + channel_id_ = getChatId(channel_id).ID, + sign_messages_ = sign_messages + }, dl_cb, cmd) +end + +M.toggleChannelSignMessages = toggleChannelSignMessages + +-- Changes information about the channel. +-- Needs creator privileges in the broadcast channel or editor privileges in the supergroup channel +-- @channel_id Identifier of the channel +-- @about New value of about, 0-255 characters +local function changeChannelAbout(channel_id, about, dl_cb, cmd) + tdcli_function ({ + ID = "ChangeChannelAbout", + channel_id_ = getChatId(channel_id).ID, + about_ = about + }, dl_cb, cmd) +end + +M.changeChannelAbout = changeChannelAbout + +-- Pins a message in a supergroup channel chat. +-- Needs editor privileges in the channel +-- @channel_id Identifier of the channel +-- @message_id Identifier of the new pinned message +-- @disable_notification True, if there should be no notification about the pinned message +local function pinChannelMessage(channel_id, message_id, disable_notification, dl_cb, cmd) + tdcli_function ({ + ID = "PinChannelMessage", + channel_id_ = getChatId(channel_id).ID, + message_id_ = message_id, + disable_notification_ = disable_notification + }, dl_cb, cmd) +end + +M.pinChannelMessage = pinChannelMessage + +-- Removes pinned message in the supergroup channel. +-- Needs editor privileges in the channel +-- @channel_id Identifier of the channel +local function unpinChannelMessage(channel_id, dl_cb, cmd) + tdcli_function ({ + ID = "UnpinChannelMessage", + channel_id_ = getChatId(channel_id).ID + }, dl_cb, cmd) +end + +M.unpinChannelMessage = unpinChannelMessage + +-- Reports some supergroup channel messages from a user as spam messages +-- @channel_id Channel identifier +-- @user_id User identifier +-- @message_ids Identifiers of messages sent in the supergroup by the user, the list should be non-empty +local function reportChannelSpam(channel_id, user_id, message_ids, dl_cb, cmd) + tdcli_function ({ + ID = "ReportChannelSpam", + channel_id_ = getChatId(channel_id).ID, + user_id_ = user_id, + message_ids_ = message_ids -- vector + }, dl_cb, cmd) +end + +M.reportChannelSpam = reportChannelSpam + +-- Returns information about channel members or kicked from channel users. +-- Can be used only if channel_full->can_get_members == true +-- @channel_id Identifier of the channel +-- @filter Kind of channel users to return, defaults to channelMembersRecent +-- @offset Number of channel users to skip +-- @limit Maximum number of users be returned, can't be greater than 200 +-- filter = Recent|Administrators|Kicked|Bots +local function getChannelMembers(channel_id, offset, filter, limit, dl_cb, cmd) + if not limit or limit > 200 then + limit = 200 + end + + tdcli_function ({ + ID = "GetChannelMembers", + channel_id_ = getChatId(channel_id).ID, + filter_ = { + ID = "ChannelMembers" .. filter + }, + offset_ = offset, + limit_ = limit + }, dl_cb, cmd) +end + +M.getChannelMembers = getChannelMembers + +-- Deletes channel along with all messages in corresponding chat. +-- Releases channel username and removes all members. +-- Needs creator privileges in the channel. +-- Channels with more than 1000 members can't be deleted +-- @channel_id Identifier of the channel +local function deleteChannel(channel_id, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteChannel", + channel_id_ = getChatId(channel_id).ID + }, dl_cb, cmd) +end + +M.deleteChannel = deleteChannel + +-- Returns list of created public channels +local function getCreatedPublicChannels(dl_cb, cmd) + tdcli_function ({ + ID = "GetCreatedPublicChannels" + }, dl_cb, cmd) +end + +M.getCreatedPublicChannels = getCreatedPublicChannels + +-- Closes secret chat +-- @secret_chat_id Secret chat identifier +local function closeSecretChat(secret_chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "CloseSecretChat", + secret_chat_id_ = secret_chat_id + }, dl_cb, cmd) +end + +M.closeSecretChat = closeSecretChat + +-- Returns user that can be contacted to get support +local function getSupportUser(dl_cb, cmd) + tdcli_function ({ + ID = "GetSupportUser", + }, dl_cb, cmd) +end + +M.getSupportUser = getSupportUser + +-- Returns background wallpapers +local function getWallpapers(dl_cb, cmd) + tdcli_function ({ + ID = "GetWallpapers", + }, dl_cb, cmd) +end + +M.getWallpapers = getWallpapers + +-- Registers current used device for receiving push notifications +-- @device_token Device token +-- device_token = apns|gcm|mpns|simplePush|ubuntuPhone|blackberry +local function registerDevice(device_token, token, device_token_set, dl_cb, cmd) + local dToken = {ID = device_token .. 'DeviceToken', token_ = token} + + if device_token_set then + dToken = {ID = "DeviceTokenSet", token_ = device_token_set} -- tokens:vector<DeviceToken> + end + + tdcli_function ({ + ID = "RegisterDevice", + device_token_ = dToken + }, dl_cb, cmd) +end + +M.registerDevice = registerDevice + +-- Returns list of used device tokens +local function getDeviceTokens(dl_cb, cmd) + tdcli_function ({ + ID = "GetDeviceTokens", + }, dl_cb, cmd) +end + +M.getDeviceTokens = getDeviceTokens + +-- Changes privacy settings +-- @key Privacy key +-- @rules New privacy rules +-- @privacyKeyUserStatus Privacy key for managing visibility of the user status +-- @privacyKeyChatInvite Privacy key for managing ability of invitation of the user to chats +-- @privacyRuleAllowAll Rule to allow all users +-- @privacyRuleAllowContacts Rule to allow all user contacts +-- @privacyRuleAllowUsers Rule to allow specified users +-- @user_ids User identifiers +-- @privacyRuleDisallowAll Rule to disallow all users +-- @privacyRuleDisallowContacts Rule to disallow all user contacts +-- @privacyRuleDisallowUsers Rule to disallow all specified users +-- key = UserStatus|ChatInvite +-- rules = AllowAll|AllowContacts|AllowUsers(user_ids)|DisallowAll|DisallowContacts|DisallowUsers(user_ids) +local function setPrivacy(key, rule, allowed_user_ids, disallowed_user_ids, dl_cb, cmd) + local rules = {[0] = {ID = 'PrivacyRule' .. rule}} + + if allowed_user_ids then + rules = { + { + ID = 'PrivacyRule' .. rule + }, + [0] = { + ID = "PrivacyRuleAllowUsers", + user_ids_ = allowed_user_ids -- vector + }, + } + end + if disallowed_user_ids then + rules = { + { + ID = 'PrivacyRule' .. rule + }, + [0] = { + ID = "PrivacyRuleDisallowUsers", + user_ids_ = disallowed_user_ids -- vector + }, + } + end + if allowed_user_ids and disallowed_user_ids then + rules = { + { + ID = 'PrivacyRule' .. rule + }, + { + ID = "PrivacyRuleAllowUsers", + user_ids_ = allowed_user_ids + }, + [0] = { + ID = "PrivacyRuleDisallowUsers", + user_ids_ = disallowed_user_ids + }, + } + end + tdcli_function ({ + ID = "SetPrivacy", + key_ = { + ID = 'PrivacyKey' .. key + }, + rules_ = { + ID = "PrivacyRules", + rules_ = rules + }, + }, dl_cb, cmd) +end + +M.setPrivacy = setPrivacy + +-- Returns current privacy settings +-- @key Privacy key +-- key = UserStatus|ChatInvite +local function getPrivacy(key, dl_cb, cmd) + tdcli_function ({ + ID = "GetPrivacy", + key_ = { + ID = "PrivacyKey" .. key + }, + }, dl_cb, cmd) +end + +M.getPrivacy = getPrivacy + +-- Returns value of an option by its name. +-- See list of available options on https://core.telegram.org/tdlib/options +-- @name Name of the option +local function getOption(name, dl_cb, cmd) + tdcli_function ({ + ID = "GetOption", + name_ = name + }, dl_cb, cmd) +end + +M.getOption = getOption + +-- Sets value of an option. +-- See list of available options on https://core.telegram.org/tdlib/options. +-- Only writable options can be set +-- @name Name of the option +-- @value New value of the option +local function setOption(name, option, value, dl_cb, cmd) + tdcli_function ({ + ID = "SetOption", + name_ = name, + value_ = { + ID = 'Option' .. option, + value_ = value + }, + }, dl_cb, cmd) +end + +M.setOption = setOption + +-- Changes period of inactivity, after which the account of currently logged in user will be automatically deleted +-- @ttl New account TTL +local function changeAccountTtl(days, dl_cb, cmd) + tdcli_function ({ + ID = "ChangeAccountTtl", + ttl_ = { + ID = "AccountTtl", + days_ = days + }, + }, dl_cb, cmd) +end + +M.changeAccountTtl = changeAccountTtl + +-- Returns period of inactivity, after which the account of currently logged in user will be automatically deleted +local function getAccountTtl(dl_cb, cmd) + tdcli_function ({ + ID = "GetAccountTtl", + }, dl_cb, cmd) +end + +M.getAccountTtl = getAccountTtl + +-- Deletes the account of currently logged in user, deleting from the server all information associated with it. +-- Account's phone number can be used to create new account, but only once in two weeks +-- @reason Optional reason of account deletion +local function deleteAccount(reason, dl_cb, cmd) + tdcli_function ({ + ID = "DeleteAccount", + reason_ = reason + }, dl_cb, cmd) +end + +M.deleteAccount = deleteAccount + +-- Returns current chat report spam state +-- @chat_id Chat identifier +local function getChatReportSpamState(chat_id, dl_cb, cmd) + tdcli_function ({ + ID = "GetChatReportSpamState", + chat_id_ = chat_id + }, dl_cb, cmd) +end + +M.getChatReportSpamState = getChatReportSpamState + +-- Reports chat as a spam chat or as not a spam chat. +-- Can be used only if ChatReportSpamState.can_report_spam is true. +-- After this request ChatReportSpamState.can_report_spam became false forever +-- @chat_id Chat identifier +-- @is_spam_chat If true, chat will be reported as a spam chat, otherwise it will be marked as not a spam chat +local function changeChatReportSpamState(chat_id, is_spam_chat, dl_cb, cmd) + tdcli_function ({ + ID = "ChangeChatReportSpamState", + chat_id_ = chat_id, + is_spam_chat_ = is_spam_chat + }, dl_cb, cmd) +end + +M.changeChatReportSpamState = changeChatReportSpamState + +-- Bots only. +-- Informs server about number of pending bot updates if they aren't processed for a long time +-- @pending_update_count Number of pending updates +-- @error_message Last error's message +local function setBotUpdatesStatus(pending_update_count, error_message, dl_cb, cmd) + tdcli_function ({ + ID = "SetBotUpdatesStatus", + pending_update_count_ = pending_update_count, + error_message_ = error_message + }, dl_cb, cmd) +end + +M.setBotUpdatesStatus = setBotUpdatesStatus + +-- Returns Ok after specified amount of the time passed +-- @seconds Number of seconds before that function returns +local function setAlarm(seconds, dl_cb, cmd) + tdcli_function ({ + ID = "SetAlarm", + seconds_ = seconds + }, dl_cb, cmd) +end + +M.setAlarm = setAlarm + +-- Text message +-- @text Text to send +-- @disable_notification Pass true, to disable notification about the message, doesn't works in secret chats +-- @from_background Pass true, if the message is sent from background +-- @reply_markup Bots only. Markup for replying to message +-- @disable_web_page_preview Pass true to disable rich preview for link in the message text +-- @clear_draft Pass true if chat draft message should be deleted +-- @entities Bold, Italic, Code, Pre, PreCode and TextUrl entities contained in the text. Non-bot users can't use TextUrl entities. Can't be used with non-null parse_mode +-- @parse_mode Text parse mode, nullable. Can't be used along with enitities +local function sendMessage(chat_id, reply_to_message_id, disable_notification, text, disable_web_page_preview, parse_mode) + local TextParseMode = getParseMode(parse_mode) + + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = 1, + reply_markup_ = nil, + input_message_content_ = { + ID = "InputMessageText", + text_ = text, + disable_web_page_preview_ = disable_web_page_preview, + clear_draft_ = 0, + entities_ = {}, + parse_mode_ = TextParseMode, + }, + }, dl_cb, nil) +end + +M.sendMessage = sendMessage + +-- Animation message +-- @animation Animation file to send +-- @thumb Animation thumb, if available +-- @width Width of the animation, may be replaced by the server +-- @height Height of the animation, may be replaced by the server +-- @caption Animation caption, 0-200 characters +local function sendAnimation(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, animation, width, height, caption, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageAnimation", + animation_ = getInputFile(animation), + --thumb_ = { + --ID = "InputThumb", + --path_ = path, + --width_ = width, + --height_ = height + --}, + width_ = width or '', + height_ = height or '', + caption_ = caption or '' + }, + }, dl_cb, cmd) +end + +M.sendAnimation = sendAnimation + +-- Audio message +-- @audio Audio file to send +-- @album_cover_thumb Thumb of the album's cover, if available +-- @duration Duration of audio in seconds, may be replaced by the server +-- @title Title of the audio, 0-64 characters, may be replaced by the server +-- @performer Performer of the audio, 0-64 characters, may be replaced by the server +-- @caption Audio caption, 0-200 characters +local function sendAudio(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, audio, duration, title, performer, caption, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageAudio", + audio_ = getInputFile(audio), + --album_cover_thumb_ = { + --ID = "InputThumb", + --path_ = path, + --width_ = width, + --height_ = height + --}, + duration_ = duration or '', + title_ = title or '', + performer_ = performer or '', + caption_ = caption or '' + }, + }, dl_cb, cmd) +end + +M.sendAudio = sendAudio + +-- Document message +-- @document Document to send +-- @thumb Document thumb, if available +-- @caption Document caption, 0-200 characters +local function sendDocument(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, document, caption, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageDocument", + document_ = getInputFile(document), + --thumb_ = { + --ID = "InputThumb", + --path_ = path, + --width_ = width, + --height_ = height + --}, + caption_ = caption + }, + }, dl_cb, cmd) +end + +M.sendDocument = sendDocument + +-- Photo message +-- @photo Photo to send +-- @caption Photo caption, 0-200 characters +local function sendPhoto(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, photo, caption, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessagePhoto", + photo_ = getInputFile(photo), + added_sticker_file_ids_ = {}, + width_ = 0, + height_ = 0, + caption_ = caption + }, + }, dl_cb, cmd) +end + +M.sendPhoto = sendPhoto + +-- Sticker message +-- @sticker Sticker to send +-- @thumb Sticker thumb, if available +local function sendSticker(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, sticker, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageSticker", + sticker_ = getInputFile(sticker), + --thumb_ = { + --ID = "InputThumb", + --path_ = path, + --width_ = width, + --height_ = height + --}, + }, + }, dl_cb, cmd) +end + +M.sendSticker = sendSticker + +-- Video message +-- @video Video to send +-- @thumb Video thumb, if available +-- @duration Duration of video in seconds +-- @width Video width +-- @height Video height +-- @caption Video caption, 0-200 characters +local function sendVideo(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, video, duration, width, height, caption, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageVideo", + video_ = getInputFile(video), + --thumb_ = { + --ID = "InputThumb", + --path_ = path, + --width_ = width, + --height_ = height + --}, + added_sticker_file_ids_ = {}, + duration_ = duration or '', + width_ = width or '', + height_ = height or '', + caption_ = caption or '' + }, + }, dl_cb, cmd) +end + +M.sendVideo = sendVideo + +-- Voice message +-- @voice Voice file to send +-- @duration Duration of voice in seconds +-- @waveform Waveform representation of the voice in 5-bit format +-- @caption Voice caption, 0-200 characters +local function sendVoice(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, voice, duration, waveform, caption, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageVoice", + voice_ = getInputFile(voice), + duration_ = duration or '', + waveform_ = waveform or '', + caption_ = caption or '' + }, + }, dl_cb, cmd) +end + +M.sendVoice = sendVoice + +-- Message with location +-- @latitude Latitude of location in degrees as defined by sender +-- @longitude Longitude of location in degrees as defined by sender +local function sendLocation(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, latitude, longitude, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageLocation", + location_ = { + ID = "Location", + latitude_ = latitude, + longitude_ = longitude + }, + }, + }, dl_cb, cmd) +end + +M.sendLocation = sendLocation + +-- Message with information about venue +-- @venue Venue to send +-- @latitude Latitude of location in degrees as defined by sender +-- @longitude Longitude of location in degrees as defined by sender +-- @title Venue name as defined by sender +-- @address Venue address as defined by sender +-- @provider Provider of venue database as defined by sender. Only "foursquare" need to be supported currently +-- @id Identifier of the venue in provider database as defined by sender +local function sendVenue(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, latitude, longitude, title, address, id, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageVenue", + venue_ = { + ID = "Venue", + location_ = { + ID = "Location", + latitude_ = latitude, + longitude_ = longitude + }, + title_ = title, + address_ = address, + provider_ = 'foursquare', + id_ = id + }, + }, + }, dl_cb, cmd) +end + +M.sendVenue = sendVenue + +-- User contact message +-- @contact Contact to send +-- @phone_number User's phone number +-- @first_name User first name, 1-255 characters +-- @last_name User last name +-- @user_id User identifier if known, 0 otherwise +local function sendContact(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, phone_number, first_name, last_name, user_id, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageContact", + contact_ = { + ID = "Contact", + phone_number_ = phone_number, + first_name_ = first_name, + last_name_ = last_name, + user_id_ = user_id + }, + }, + }, dl_cb, cmd) +end + +M.sendContact = sendContact + +-- Message with a game +-- @bot_user_id User identifier of a bot owned the game +-- @game_short_name Game short name +local function sendGame(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, bot_user_id, game_short_name, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageGame", + bot_user_id_ = bot_user_id, + game_short_name_ = game_short_name + }, + }, dl_cb, cmd) +end + +M.sendGame = sendGame + +-- Forwarded message +-- @from_chat_id Chat identifier of the message to forward +-- @message_id Identifier of the message to forward +local function sendForwarded(chat_id, reply_to_message_id, disable_notification, from_background, reply_markup, from_chat_id, message_id, dl_cb, cmd) + tdcli_function ({ + ID = "SendMessage", + chat_id_ = chat_id, + reply_to_message_id_ = reply_to_message_id, + disable_notification_ = disable_notification, + from_background_ = from_background, + reply_markup_ = reply_markup, + input_message_content_ = { + ID = "InputMessageForwarded", + from_chat_id_ = from_chat_id, + message_id_ = message_id + }, + }, dl_cb, cmd) +end + +M.sendForwarded = sendForwarded + +return M cli/tg/tgcli (Binary file not shown.) 0 comments on commit 3233fdf Comment on 3233fdf Leave a comment Comment Desktop version