Compare commits
No commits in common. "08ad1fe902720ed02a12705efece91303d90a85e" and "223b915d2d48f66e863cc1c6d9ac4193794e8add" have entirely different histories.
08ad1fe902
...
223b915d2d
6 changed files with 16 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
|||
import discord
|
||||
import asyncio
|
||||
import os
|
||||
import discord
|
||||
from redbot.core import Config, checks, commands, data_manager
|
||||
|
||||
class ExportChannels(commands.Cog):
|
||||
|
|
|
@ -148,7 +148,7 @@ class MusicDownloader(commands.Cog):
|
|||
msg = ctx.send
|
||||
message = await msg("YouTube Downloader started!")
|
||||
try:
|
||||
ytdlp_output = youtube_download(self, url, data_path)
|
||||
ytdlp_output = youtube_download(self, url, data_path, message)
|
||||
except (utils.DownloadError, utils.ExtractorError):
|
||||
await message.edit(content="Please provide a link to YouTube and not another site.\nThe site you've linked to is known for using DRM protection, so MusicDownloader cannot download from it.")
|
||||
return
|
||||
|
|
|
@ -124,7 +124,7 @@ class Shortmute(commands.Cog):
|
|||
self.config = Config.get_conf(None, cog_name='Shortmute', identifier=25781647388294)
|
||||
|
||||
@ui.button(label="Yes", style=discord.ButtonStyle.success)
|
||||
async def shortmute_button_yes(self, button: ui.Button, interaction: discord.Interaction): # pylint: disable=unused-argument
|
||||
async def shortmute_button_yes(self, button: ui.Button, interaction: discord.Interaction): # pylint: disable=arguments-differ
|
||||
disable_dateutil()
|
||||
target: discord.Member = self.passed_info['target']
|
||||
readable_duration = self.passed_info['readable_duration']
|
||||
|
@ -159,7 +159,7 @@ class Shortmute(commands.Cog):
|
|||
await channel_obj.send(embed=logging_embed)
|
||||
|
||||
@ui.button(label="No", style=discord.ButtonStyle.danger)
|
||||
async def shortmute_button_no(self, button: ui.Button, interaction: discord.Interaction): # pylint: disable=unused-argument
|
||||
async def shortmute_button_no(self, button: ui.Button, interaction: discord.Interaction): # pylint: disable=arguments-differ
|
||||
message: discord.Message = await self.passed_info['interaction'].edit_original_response(content="Command cancelled.", view=None, embed=None)
|
||||
await message.delete(delay=3)
|
||||
|
||||
|
@ -267,7 +267,7 @@ class Shortmute(commands.Cog):
|
|||
current_list = await self.config.guild(ctx.guild).blacklisted_users()
|
||||
already_in_list = []
|
||||
for user_id in current_list:
|
||||
user_obj = await Bot.fetch_user(user_id) # pylint: disable=no-value-for-parameter
|
||||
user_obj = await Bot.fetch_user(user_id)
|
||||
if user_obj:
|
||||
already_in_list.append(user_obj.mention)
|
||||
if already_in_list:
|
||||
|
|
|
@ -8,5 +8,5 @@ async def setup(bot):
|
|||
|
||||
async def teardown(bot):
|
||||
# We're removing the commands here to ensure they get unloaded properly when the cog is unloaded.
|
||||
bot.tree.remove_command("approve_context", type=discord.AppCommandType.message) # pylint: disable=undefined-variable
|
||||
bot.tree.remove_command("deny_context", type=discord.AppCommandType.message) # pylint: disable=undefined-variable
|
||||
bot.tree.remove_command("approve_context", type=discord.AppCommandType.message)
|
||||
bot.tree.remove_command("deny_context", type=discord.AppCommandType.message)
|
||||
|
|
|
@ -44,6 +44,7 @@ class Suggestions(commands.Cog):
|
|||
def check_discrim(self, user: discord.User):
|
||||
if user.discriminator == "0":
|
||||
return user.name
|
||||
else:
|
||||
return f"{user.name}#{user.discriminator}"
|
||||
|
||||
async def red_delete_data_for_user(self, *, requester, user_id: discord.User.id):
|
||||
|
@ -610,7 +611,6 @@ class Suggestions(commands.Cog):
|
|||
)
|
||||
return nmsg
|
||||
|
||||
# pylint: disable=protected-access
|
||||
class SuggestionApproveModal(discord.ui.Modal, title="Approving suggestion..."):
|
||||
def __init__(self, message):
|
||||
super().__init__()
|
||||
|
|
|
@ -16,14 +16,14 @@ class SugonCredit(commands.Cog):
|
|||
"""Checks an account's balance."""
|
||||
bank_name = await bank.get_bank_name(ctx.guild)
|
||||
currency_name = await bank.get_currency_name(ctx.guild)
|
||||
if user is None:
|
||||
if user == None:
|
||||
bal = await bank.get_balance(ctx.author)
|
||||
target = ctx.author
|
||||
else:
|
||||
bal = await bank.get_balance(user)
|
||||
target = user
|
||||
output_bal = (f'{bal:,}')
|
||||
if bal in (1, -1):
|
||||
if bal == 1 or bal == -1:
|
||||
embed=discord.Embed(title=f"{bank_name} - Balance", color=await self.bot.get_embed_color(None), description=f"{target.mention} has {output_bal} {currency_name}.")
|
||||
else:
|
||||
embed=discord.Embed(title=f"{bank_name} - Balance", color=await self.bot.get_embed_color(None), description=f"{target.mention} has {output_bal} {currency_name}s.")
|
||||
|
@ -49,13 +49,15 @@ class SugonCredit(commands.Cog):
|
|||
output_max_bal = (f'{max_bal:,}')
|
||||
if new_bal > max_bal:
|
||||
await ctx.send(content=f"You are attempting to set {target.mention}'s balance to above {output_max_bal}. Please try again!")
|
||||
return
|
||||
elif new_bal < 0:
|
||||
await ctx.send(content=f"You are attempting to set {target.mention}'s balance to below 0. Please try again!")
|
||||
return
|
||||
elif ctx.guild.id == 204965774618656769:
|
||||
logging_channel: discord.TextChannel = self.bot.get_channel(1082495815878189076)
|
||||
await bank.deposit_credits(target, amount=amount)
|
||||
await ctx.send(content=f"{target.mention} now has {output_amount} more SugonCredit, with a total of {output_new_bal}!")
|
||||
if amount in (1, -1):
|
||||
if amount == 1 or amount == -1:
|
||||
await target.send(content=f"You gained {output_amount} SugonCredit! Good work community member! You now have {output_new_bal} SugonCredits.", file=image)
|
||||
else:
|
||||
await target.send(content=f"You gained {output_amount} SugonCredits! Good work community member! You now have {output_new_bal} SugonCredits.", file=image)
|
||||
|
@ -84,11 +86,12 @@ class SugonCredit(commands.Cog):
|
|||
output_new_bal = (f'{new_bal:,}')
|
||||
if new_bal < 0:
|
||||
await ctx.send(content=f"You are attempting to set {target.mention}'s balance to below 0. Please try again!")
|
||||
return
|
||||
elif ctx.guild.id == 204965774618656769:
|
||||
await bank.withdraw_credits(target, amount=amount)
|
||||
logging_channel: discord.TextChannel = self.bot.get_channel(1082495815878189076)
|
||||
await ctx.send(content=f"{target.mention} now has {output_amount} less SugonCredit, with a total of {output_new_bal}!\nIf this is a punishment, do better Galaxy Player! Re-education mods will be sent to your DM's if your SugonCredit drops to a substantially low amount!")
|
||||
if amount in (1, -1):
|
||||
if amount == 1 or amount == -1:
|
||||
await target.send(content=f"__MESSAGE FROM THE MINISTRY OF THE MEGA BASE__\n\n(我们的) {output_amount} SugonCredit has been taken from your account. Citizen, do not continue to preform bad actions! Glory to the Galaxy Communist Party!", file=image)
|
||||
else:
|
||||
await target.send(content=f"__MESSAGE FROM THE MINISTRY OF THE MEGA BASE__\n\n(我们的) {output_amount} SugonCredits have been taken from your account. Citizen, do not continue to preform bad actions! Glory to the Galaxy Communist Party!", file=image)
|
||||
|
|
Loading…
Reference in a new issue