Skip to content

Commit

Permalink
Merge pull request SpEcHiDe#24 from zakaryan2004/pr-branch
Browse files Browse the repository at this point in the history
Added typewriter to memes
  • Loading branch information
baalajimaestro authored Jan 25, 2019
2 parents 406f7d3 + 52fcdeb commit 32f66bf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions userbot/modules/memes.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,28 @@ async def bluetext(e):
await e.edit(
"`BLUETEXT MUST CLICK.\nAre you a stupid animal which is attracted to colours?`"
)


@bot.on(events.NewMessage(pattern='^(?i).type'))
async def typewriter(e):
if not e.text[0].isalpha() and e.text[0] not in ("/", "#", "@", "!"):
textx = await e.get_reply_message()
message = e.text

if message[6:]:
message = str(message[6:])
elif textx:
message = textx
message = str(message.message)
sleep_time = 0.1
index = 1
old_text = ''
msg = await e.edit('|')
await asyncio.sleep(sleep_time)
while old_text != message:
old_text = message[:index]
index += 1
await msg.edit('`%s`' % (old_text + '|'))
await asyncio.sleep(sleep_time)
await msg.edit('`%s`' % (old_text.strip()))
await asyncio.sleep(sleep_time)
2 changes: 1 addition & 1 deletion userbot/modules/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def install_package(package_manager):
shell=True)

try:
if not 'heroku' in os.environ['PATH']:
if not 'heroku' in os.environ['PATH'] and not os.uname().sysname.lower == 'windows':
_start_instalation()
except:
_start_instalation()

0 comments on commit 32f66bf

Please sign in to comment.