changed extensions to cogs, removed mentions of plugins/extensions
This commit is contained in:
parent
bdcdd87348
commit
0e5cb9dd0f
17 changed files with 6 additions and 6 deletions
51
cogs/donate.py
Normal file
51
cogs/donate.py
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import logging
|
||||
import os
|
||||
import time
|
||||
import matplotlib.pyplot as plt
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
|
||||
|
||||
class Donate(commands.Cog):
|
||||
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self.donation_link = "https://patreon.com/soullesssurvival"
|
||||
self.data_dir = "data/donate/"
|
||||
self.donor_file = "data/donate/supporters.txt"
|
||||
self.folder_setup()
|
||||
self.logger = logging.getLogger("bot")
|
||||
|
||||
def folder_setup(self):
|
||||
try:
|
||||
if not os.path.exists(self.data_dir):
|
||||
os.mkdir(self.data_dir)
|
||||
except:
|
||||
self.logger.exception("Donate failed to make directories")
|
||||
|
||||
@commands.command(
|
||||
description="Donate",
|
||||
help="Get information on how to donate to support this bot.",
|
||||
brief="Donation info",
|
||||
)
|
||||
async def donate(self, ctx):
|
||||
await ctx.send(f"If you would like to support the future of this bot please consider donating here: {self.donation_link}")
|
||||
|
||||
@commands.command(
|
||||
description="Supporters",
|
||||
help="Get information on who supports this bot.",
|
||||
brief="Supporter info",
|
||||
aliases = ["supporter"]
|
||||
)
|
||||
async def supporters(self, ctx):
|
||||
with open(self.donor_file, 'r') as f:
|
||||
supporters = f.readlines()
|
||||
message = "Thank you to the following supporters:\n"
|
||||
for line in supporters:
|
||||
message += line
|
||||
|
||||
await ctx.send(message)
|
||||
|
||||
|
||||
async def setup(bot):
|
||||
await bot.add_cog(Donate(bot))
|
||||
Loading…
Add table
Add a link
Reference in a new issue