This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import numpy as np | |
import pandas as pd | |
import cv2 | |
import keras | |
from tensorflow.keras.applications.vgg16 import VGG16,preprocess_input | |
from tensorflow.keras.applications import ResNet50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
discord==1.0.1 | |
discord.py==1.6.0 | |
python-dotenv==0.15.0 | |
youtube-dl==2021.2.10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@bot.command(help = "Prints details of Server") | |
async def where_am_i(ctx): | |
owner=str(ctx.guild.owner) | |
region = str(ctx.guild.region) | |
guild_id = str(ctx.guild.id) | |
memberCount = str(ctx.guild.member_count) | |
icon = str(ctx.guild.icon_url) | |
desc=ctx.guild.description | |
embed = discord.Embed( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@bot.event | |
async def on_ready(): | |
for guild in bot.guilds: | |
for channel in guild.text_channels : | |
if str(channel) == "general" : | |
await channel.send('Bot Activated..') | |
await channel.send(file=discord.File('add_gif_file_name_here.png')) | |
print('Active in {}\n Member Count : {}'.format(guild.name,guild.member_count)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__" : | |
bot.run(DISCORD_TOKEN) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@bot.command(name='play_song', help='To play song') | |
async def play(ctx,url): | |
try : | |
server = ctx.message.guild | |
voice_channel = server.voice_client | |
async with ctx.typing(): | |
filename = await YTDLSource.from_url(url, loop=bot.loop) | |
voice_channel.play(discord.FFmpegPCMAudio(executable="ffmpeg.exe", source=filename)) | |
await ctx.send('**Now playing:** {}'.format(filename)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@bot.command(name='play_song', help='To play song') | |
async def play(ctx,url): | |
if not ctx.message.author.name=="Rohan Krishna" : | |
await ctx.send('NOT AUTHORISED!') | |
return | |
try : | |
server = ctx.message.guild | |
voice_channel = server.voice_client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@bot.command(name='join', help='Tells the bot to join the voice channel') | |
async def join(ctx): | |
if not ctx.message.author.voice: | |
await ctx.send("{} is not connected to a voice channel".format(ctx.message.author.name)) | |
return | |
else: | |
channel = ctx.message.author.voice.channel | |
await channel.connect() | |
@bot.command(name='leave', help='To make the bot leave the voice channel') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
youtube_dl.utils.bug_reports_message = lambda: '' | |
ytdl_format_options = { | |
'format': 'bestaudio/best', | |
'restrictfilenames': True, | |
'noplaylist': True, | |
'nocheckcertificate': True, | |
'ignoreerrors': False, | |
'logtostderr': False, | |
'quiet': True, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
youtube_dl.utils.bug_reports_message = lambda: '' | |
ytdl_format_options = { | |
'format': 'bestaudio/best', | |
'restrictfilenames': True, | |
'noplaylist': True, | |
'nocheckcertificate': True, | |
'ignoreerrors': False, | |
'logtostderr': False, | |
'quiet': True, |