-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,3 +161,5 @@ cython_debug/ | |
|
||
|
||
marlow-bot/ | ||
|
||
config.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from nextcord import SlashOption, TextChannel, slash_command | ||
from nextcord.ext.commands import Bot, Cog | ||
import nextcord | ||
import json | ||
|
||
with open("config.json", "r") as config_file: | ||
config = json.load(config_file) | ||
|
||
|
||
class Ticket(Cog): | ||
def __init__(self, bot: Bot) -> None: | ||
self.bot = bot | ||
|
||
@slash_command(name="config", description="set bot config") | ||
async def set_log_channel( | ||
self, | ||
inter: nextcord.Interaction, | ||
channel: TextChannel = SlashOption( | ||
description="channel to recieve requests", | ||
required=True, | ||
), | ||
): | ||
config["request_channel"] = channel.id | ||
with open("config.json", "w") as config_file: | ||
json.dump(config, config_file, indent=4) | ||
|
||
await inter.send(f"Request channel set to <#{channel.id}>.", ephemeral=True) | ||
|
||
|
||
def setup(bot: Bot) -> None: | ||
bot.add_cog(Ticket(bot)) |
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