forked from viveksantayana/geas-bot
Changed file structure.
Moved code to main bot and cog files.
This commit is contained in:
.gitignoreTODO.md
app
bot.py
cogs
GameManagement.pyHelpNotifier.pyMembershipRestriction.pyMembershipVerification.pyPitchMenu.py
botcommands
dev
events
on_connect.pyon_guild_channel_delete.pyon_guild_join.pyon_guild_remove.pyon_guild_role_create.pyon_guild_role_delete.pyon_guild_role_update.pyon_guild_update.pyon_ready.py
slashcommands
debug
dev.pydev_old.py
35
app/cogs/slashcommands/config.py
Normal file
35
app/cogs/slashcommands/config.py
Normal file
@ -0,0 +1,35 @@
|
||||
import os # OS Locations
|
||||
import yaml # YAML parser for Bot config files
|
||||
import asyncio # Discord Py Dependency
|
||||
import discord # Main Lib
|
||||
from discord.ext import commands # Commands module
|
||||
from discord_slash import SlashCommand, SlashContext, cog_ext, utils # Slash Command Library
|
||||
from discord_slash.utils.manage_commands import create_choice, create_option # Slash Command features
|
||||
|
||||
##### Configuration Cog
|
||||
class Configuration(commands.Cog):
|
||||
def __init__(self, client):
|
||||
self.client = client
|
||||
|
||||
@cog_ext.cog_slash(
|
||||
# base='botrole',
|
||||
# subcommand_group='configure',
|
||||
name='configure',
|
||||
description='Parameter to define the role assigned to the dice bots.',
|
||||
# base_description='Command to configure the various guild parameters.',
|
||||
# subcommand_group_description='These are configuration commands to set up the various guild parameters.',
|
||||
guild_ids=guild_ids
|
||||
# options=[
|
||||
# create_option(
|
||||
# name='botrole',
|
||||
# description='The role that the dice bots are assigned in order to access the text channels.'
|
||||
# type=8,
|
||||
# required=True
|
||||
# )
|
||||
# ]
|
||||
)
|
||||
async def _configure(self, ctx:SlashContext, option):
|
||||
await ctx.send(f'The `botrole` for the guild `{ctx.guild.name}` has been set to `{option}`.')
|
||||
|
||||
def setup(client):
|
||||
client.add_cog(Configuration(client))
|
Reference in New Issue
Block a user