blob: 4a2a3527396b125a91f4b518a745045205127217 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import json
import logging
import random
from pathlib import Path
from discord.ext import commands
log = logging.getLogger(__name__)
with open(Path('bot', 'resources', 'easter', 'starter.json'), 'r', encoding="utf8") as f:
starters = json.load(f)
class ConvoStarters(commands.Cog):
"""Easter conversation topics."""
def __init__(self, bot):
self.bot = bot
@commands.command(aliases=('conversation_starters', 'convo_starters'))
async def convo_starter(self, ctx):
"""Responds with a random topic to start a conversation."""
await ctx.send(random.choice(starters['starters']))
def setup(bot):
"""Conversation starters Cog load."""
bot.add_cog(ConvoStarters(bot))
log.info("ConvoStarters cog loaded")
|