Skip to content

Instantly share code, notes, and snippets.

@Lulzx
Created July 19, 2020 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lulzx/bcc662dd9dd26dba13ac2647afe0133d to your computer and use it in GitHub Desktop.
Save Lulzx/bcc662dd9dd26dba13ac2647afe0133d to your computer and use it in GitHub Desktop.
discord lyrics
import requests
from discord.ext import commands
prefix = "?"
bot = commands.Bot(command_prefix=prefix)
@bot.event
async def on_ready():
print("Ready to rock..!")
@bot.event
async def on_message(message):
print(message.content)
await bot.process_commands(message)
@bot.command()
async def ping(ctx):
latency = bot.latency
await ctx.send(latency)
@bot.command()
async def lyrics(ctx, *, content:str):
info = content.split(' ')
artist = info[0]
title[1]
url = f"https://api.lyrics.ovh/v1/{artist}/{title}"
fetch = requests.get(url).json()
await ctx.send(fetch['lyrics'])
TOKEN = ""
bot.run(TOKEN)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment