mirror of
https://github.com/thewesker/Video-Archive-Discord-Bot.git
synced 2025-12-20 04:11:05 -05:00
Fix some brain farts
This commit is contained in:
6
main.py
6
main.py
@@ -14,12 +14,16 @@ async def on_ready():
|
|||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
async def on_message(message):
|
async def on_message(message):
|
||||||
|
if(not message.channel.name.startswith("tik-tok")):
|
||||||
|
return
|
||||||
|
|
||||||
if message.author == client.user:
|
if message.author == client.user:
|
||||||
return
|
return
|
||||||
|
|
||||||
if message.content.startswith('$hello'):
|
if message.content.startswith('$hello'):
|
||||||
await message.channel.send('Hello!')
|
await message.channel.send('Hello!')
|
||||||
|
|
||||||
|
downloadResult = ""
|
||||||
if message.content.startswith('https'):
|
if message.content.startswith('https'):
|
||||||
await message.channel.send('TikBot downloading video now!')
|
await message.channel.send('TikBot downloading video now!')
|
||||||
downloadResult = download(message.content)
|
downloadResult = download(message.content)
|
||||||
@@ -28,6 +32,8 @@ async def on_message(message):
|
|||||||
if(downloadResult.startswith("Error")):
|
if(downloadResult.startswith("Error")):
|
||||||
await message.channel.send('TikBot has failed you. Consider berating my human if this was not expected.')
|
await message.channel.send('TikBot has failed you. Consider berating my human if this was not expected.')
|
||||||
return
|
return
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
|
||||||
# Check file size, if it's small enough just send it!
|
# Check file size, if it's small enough just send it!
|
||||||
fileSize = os.stat(downloadResult).st_size
|
fileSize = os.stat(downloadResult).st_size
|
||||||
|
|||||||
Reference in New Issue
Block a user