Created
July 19, 2020 12:27
-
-
Save Lulzx/bcc662dd9dd26dba13ac2647afe0133d to your computer and use it in GitHub Desktop.
discord lyrics
This file contains 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 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