Some small improvements

This commit is contained in:
Marco Thomas
2020-10-08 10:05:58 +02:00
parent 24c416a80b
commit 4a5933729b
12 changed files with 48 additions and 71 deletions

View File

@@ -2,23 +2,20 @@
Fetch pictures from subreddits
"""
# IMPORTS - external
import discord
from discord.ext import commands
import random
import praw
# IMPORTS - internal
from __main__ import REDDIT_CLIENT_ID
from __main__ import REDDIT_CLIENT_SECRET
from __main__ import REDDIT_CLIENT_USERAGENT
# COG INIT
class Reddit(commands.Cog):
def __init__(self, bot):
self.bot = bot
# COG BODY
@commands.command(name="reddit")
async def reddit(self, ctx, sub: str):
"""
@@ -37,6 +34,6 @@ class Reddit(commands.Cog):
await ctx.send(f"> '{post.title}' by {post.author.name}")
await ctx.send(post.url)
# COG ENDING
def setup(bot):
bot.add_cog(Reddit(bot))