-
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
1 parent
a690e32
commit b79fb58
Showing
2 changed files
with
41 additions
and
20 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
from discord import app_commands | ||
|
||
import discord | ||
|
||
def register_commands( | ||
tree: discord.app_commands.CommandTree, | ||
guilds_dict: dict, | ||
): | ||
guilds = [ # TW and Baltics server | ||
discord.Object(id=int(server_id)) | ||
for server_id in guilds_dict.keys() | ||
] | ||
@tree.command( | ||
name="website", | ||
description="Responds with the placeTW website link", | ||
guilds=guilds, | ||
) | ||
async def website(interaction: discord.Interaction): | ||
await interaction.response.send_message("https://placetw.com/") | ||
|
||
|
||
@tree.command( | ||
name="invite", | ||
description="Invite this bot to your server!", | ||
guilds=guilds, | ||
) | ||
async def invite_link(interaction: discord.Interaction): | ||
await interaction.response.send_message("https://discord.com/oauth2/authorize?client_id=1134650883637006407&&permissions=2147484672&scope=bot") | ||
|
||
@tree.command( | ||
name="echo", | ||
description="Echoes whatever string is fed", | ||
guilds=guilds, | ||
) | ||
@app_commands.describe(given_str="The string you want echoed backed") | ||
async def echo(interaction: discord.Interaction, given_str: str): | ||
await interaction.response.send_message(f"You sent this: `{given_str}`") |
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