import discord
from discord.ext import commands
from discord.app import Option # alpha
bot = commands.Bot()
@bot.user_command(name="Wow these can have spaces", description="This created a global user command")
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 discord | |
from discord.ext import commands | |
import aiosqlite, asyncio | |
async def setup(): | |
bot.db = await aiosqlite.connect("storage/bot.db") | |
await bot.db.execute("CREATE TABLE IF NOT EXISTS mytable (column1, column2)") | |
await bot.db.commit() |
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 | |
class Bible: | |
def get(self, book, chapter, verse, **kwargs): | |
base = f'https://bible-api.com/{book}+{chapter}:{verse}' | |
translation = kwargs.get('translation') or 'web' | |
response = requests.get(f"{base}", params={'translation': translation}) | |
return response.json() |
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
API_KEY=[YOUR RANDOM STUFF API KEY HERE! https://api-info.pgamerx.com/register] |