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
@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='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))
if __name__ == "__main__" :
bot.run(DISCORD_TOKEN)
@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))
@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(
discord==1.0.1
discord.py==1.6.0
python-dotenv==0.15.0
youtube-dl==2021.2.10
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
df1 = pd.read_csv("fer2013.csv") #make sure the file is in the root location
# Preprocessing
x_train=[]
x_test=[]
y_train=[]
y_test=[]
for i,row in df1.iterrows():
k=row['pixels'].split(" ")
if(row['Usage']=='Training'):
#data augmentation
x_train=x_train.reshape((x_train.shape[0],48,48,1))
x_test=x_test.reshape((x_test.shape[0],48,48,1))
from keras.preprocessing.image import ImageDataGenerator
train_datagen = ImageDataGenerator(rescale=1./255,
rotation_range=60,
shear_range=0.5,
zoom_range=0.5,
width_shift_range=0.5,
height_shift_range=0.5,
model1=keras.models.Sequential()
# Block-1
model1.add(keras.layers.Conv2D(filters=32, kernel_size=(3,3), padding='same',
kernel_initializer='he_normal',
activation="elu",
input_shape=(48,48,1)))
model1.add(keras.layers.BatchNormalization())
model1.add(keras.layers.Conv2D(filters=32, kernel_size=(3,3), padding='same',