Skip to content

Instantly share code, notes, and snippets.

View Kakarot-2000's full-sized avatar
💭
studying graphql

Rohan Krishna Ullas Kakarot-2000

💭
studying graphql
  • India
View GitHub Profile
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
discord==1.0.1
discord.py==1.6.0
python-dotenv==0.15.0
youtube-dl==2021.2.10
@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(
@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))
if __name__ == "__main__" :
bot.run(DISCORD_TOKEN)
@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))
@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
@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')
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,
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,