Update grammar for some user-facing strings
This commit is contained in:
@@ -13,13 +13,13 @@ tree = app_commands.CommandTree(client)
|
|||||||
|
|
||||||
token = os.getenv('TOKEN')
|
token = os.getenv('TOKEN')
|
||||||
|
|
||||||
@tree.command(name="register_channel", description="sets up a checkout ledger in the current channel")
|
@tree.command(name="register_channel", description="Sets up a checkout ledger in the current channel")
|
||||||
async def register_channel(interaction: discord.Interaction) -> None:
|
async def register_channel(interaction: discord.Interaction) -> None:
|
||||||
db_init(interaction.channel_id)
|
db_init(interaction.channel_id)
|
||||||
await interaction.response.send_message("database initialised, bot is ready for use in this channel", ephemeral=True)
|
await interaction.response.send_message("Database initialised, commands are now ready for use in this channel", ephemeral=True)
|
||||||
|
|
||||||
@tree.command(name="checkout", description="marks the specified file as being 'checked out'")
|
@tree.command(name="checkout", description="Marks the specified file as being 'checked out'")
|
||||||
@app_commands.describe(file="the file to check out")
|
@app_commands.describe(file="The file to check out")
|
||||||
async def checkout(interaction: discord.Interaction, file: str) -> None:
|
async def checkout(interaction: discord.Interaction, file: str) -> None:
|
||||||
if db_table_exists(interaction.channel_id):
|
if db_table_exists(interaction.channel_id):
|
||||||
if db_file_exists(interaction.channel_id, file=file) != True:
|
if db_file_exists(interaction.channel_id, file=file) != True:
|
||||||
@@ -28,11 +28,11 @@ async def checkout(interaction: discord.Interaction, file: str) -> None:
|
|||||||
db_add_row(channel_id=interaction.channel_id,file=file,message_id=message.id,user=interaction.user)
|
db_add_row(channel_id=interaction.channel_id,file=file,message_id=message.id,user=interaction.user)
|
||||||
else:
|
else:
|
||||||
message_id = db_get_message_id_by_file(channel_id=interaction.channel_id, file=file)
|
message_id = db_get_message_id_by_file(channel_id=interaction.channel_id, file=file)
|
||||||
await interaction.response.send_message(f"the requested file has already been checked out by another user [here](https://discordapp.com/channels/{interaction.guild_id}/{interaction.channel_id}/{message_id})...", ephemeral=True)
|
await interaction.response.send_message(f"The requested file has already been checked out by another user [here](https://discordapp.com/channels/{interaction.guild_id}/{interaction.channel_id}/{message_id})...", ephemeral=True)
|
||||||
else:
|
else:
|
||||||
await interaction.response.send_message("the current channel does not have a ledger, either run `/register_channel` or move to a different channel and try again...", ephemeral=True)
|
await interaction.response.send_message("The current channel does not have a ledger, either run `/register_channel` or move to a different channel and try again...", ephemeral=True)
|
||||||
|
|
||||||
@tree.command(name="checkin", description="allows the user to select a checked out file to check back in")
|
@tree.command(name="checkin", description="Allows the user to select a file to check back in")
|
||||||
async def checkin(interaction: discord.Interaction) -> None:
|
async def checkin(interaction: discord.Interaction) -> None:
|
||||||
if db_table_exists(interaction.channel_id):
|
if db_table_exists(interaction.channel_id):
|
||||||
if db_user_exists(interaction.channel_id, interaction.user):
|
if db_user_exists(interaction.channel_id, interaction.user):
|
||||||
@@ -42,9 +42,9 @@ async def checkin(interaction: discord.Interaction) -> None:
|
|||||||
else:
|
else:
|
||||||
await interaction.response.send_modal(CheckinModal(channel_id=interaction.channel_id,user=interaction.user))
|
await interaction.response.send_modal(CheckinModal(channel_id=interaction.channel_id,user=interaction.user))
|
||||||
else:
|
else:
|
||||||
await interaction.response.send_message("you haven't checked out any files in this channel yet!", ephemeral=True)
|
await interaction.response.send_message("You haven't checked out any files in this channel yet!", ephemeral=True)
|
||||||
else:
|
else:
|
||||||
await interaction.response.send_message("the current channel does not have a ledger, either run `/register_channel` or move to a different channel and try again...", ephemeral=True)
|
await interaction.response.send_message("The current channel does not have a ledger, either run `/register_channel` or move to a different channel and try again...", ephemeral=True)
|
||||||
|
|
||||||
@client.event
|
@client.event
|
||||||
async def on_ready():
|
async def on_ready():
|
||||||
@@ -178,7 +178,7 @@ class CheckinModal(discord.ui.Modal, title='Check a file back in!'):
|
|||||||
message = await channel.fetch_message(db_get_message_id_by_file(channel_id=self.channel_id,file=self.select.component.values[0]))
|
message = await channel.fetch_message(db_get_message_id_by_file(channel_id=self.channel_id,file=self.select.component.values[0]))
|
||||||
await message.delete()
|
await message.delete()
|
||||||
db_delete_row_by_file(channel_id=self.channel_id,file=self.select.component.values[0])
|
db_delete_row_by_file(channel_id=self.channel_id,file=self.select.component.values[0])
|
||||||
return await interaction.response.send_message(f"Successfully checked in file '{self.select.component.values[0]}'!", ephemeral=True)
|
return await interaction.response.send_message(f"Successfully checked in the file '{self.select.component.values[0]}'!", ephemeral=True)
|
||||||
|
|
||||||
class CheckinConfirmationModal(discord.ui.Modal, title='Please confirm this is correct...'):
|
class CheckinConfirmationModal(discord.ui.Modal, title='Please confirm this is correct...'):
|
||||||
text = discord.ui.TextDisplay("hello world")
|
text = discord.ui.TextDisplay("hello world")
|
||||||
|
|||||||
Reference in New Issue
Block a user