mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2025-08-04 08:31:21 +00:00
playing: Add playing
Also this commit includes DRAM optimization (aka I sneakily cleaned tomGER's code a bit)~
This commit is contained in:
parent
b67ddda4f1
commit
5d54ac7aec
|
@ -31,7 +31,7 @@ Based on https://gitlab.com/ao/dpybotbase
|
||||||
- [ ] Moderation: timelock (channel lockdown with time)
|
- [ ] Moderation: timelock (channel lockdown with time)
|
||||||
- [ ] Moderation: mute-unmute
|
- [ ] Moderation: mute-unmute
|
||||||
- [ ] Moderation: mutetime
|
- [ ] Moderation: mutetime
|
||||||
- [ ] Moderation: playing
|
- [x] Moderation: playing
|
||||||
- [ ] Moderation: botnickname
|
- [ ] Moderation: botnickname
|
||||||
- [ ] Moderation: nickname
|
- [ ] Moderation: nickname
|
||||||
- [ ] Moderation: clear/purge
|
- [ ] Moderation: clear/purge
|
||||||
|
|
|
@ -47,7 +47,7 @@ initial_extensions = ['cogs.common',
|
||||||
'cogs.meme']
|
'cogs.meme']
|
||||||
|
|
||||||
bot = commands.Bot(command_prefix=get_prefix,
|
bot = commands.Bot(command_prefix=get_prefix,
|
||||||
description=config.bot_description, pm_help=None)
|
description=config.bot_description, pm_help=True)
|
||||||
|
|
||||||
bot.log = log
|
bot.log = log
|
||||||
bot.config = config
|
bot.config = config
|
||||||
|
|
10
cogs/err.py
10
cogs/err.py
|
@ -4,6 +4,7 @@ import discord
|
||||||
from discord.ext import commands
|
from discord.ext import commands
|
||||||
from data.errcodes import *
|
from data.errcodes import *
|
||||||
|
|
||||||
|
|
||||||
class Err:
|
class Err:
|
||||||
"Everything related to Nintendo 3DS, Wii U and Switch error codes"
|
"Everything related to Nintendo 3DS, Wii U and Switch error codes"
|
||||||
|
|
||||||
|
@ -12,7 +13,6 @@ class Err:
|
||||||
self.dds_re = re.compile(r'0\d{2}\-\d{4}')
|
self.dds_re = re.compile(r'0\d{2}\-\d{4}')
|
||||||
self.wiiu_re = re.compile(r'1\d{2}\-\d{4}')
|
self.wiiu_re = re.compile(r'1\d{2}\-\d{4}')
|
||||||
self.switch_re = re.compile(r'2\d{3}\-\d{4}')
|
self.switch_re = re.compile(r'2\d{3}\-\d{4}')
|
||||||
print("Err has been loaded!")
|
|
||||||
|
|
||||||
@commands.command(aliases=["nxerr", "serr", "nin_err"])
|
@commands.command(aliases=["nxerr", "serr", "nin_err"])
|
||||||
async def err(self, ctx, err: str):
|
async def err(self, ctx, err: str):
|
||||||
|
@ -23,9 +23,11 @@ class Err:
|
||||||
if err in dds_errcodes:
|
if err in dds_errcodes:
|
||||||
err_description = dds_errcodes[err]
|
err_description = dds_errcodes[err]
|
||||||
else:
|
else:
|
||||||
err_description = "It seems like your error code is unknown. You should report relevant details to <@141532589725974528> so it can be added to the bot."
|
err_description = "It seems like your error code is unknown. You should report relevant details to <@141532589725974528> (tomGER) so it can be added to the bot."
|
||||||
# Make a nice Embed out of it
|
# Make a nice Embed out of it
|
||||||
embed = discord.Embed(title=err, url="https://www.youtube.com/watch?v=x3yXlomPCmU", description=err_description)
|
embed = discord.Embed(title=err,
|
||||||
|
url="https://www.youtube.com/watch?v=x3yXlomPCmU",
|
||||||
|
description=err_description)
|
||||||
embed.set_footer(text="Console: 3DS")
|
embed.set_footer(text="Console: 3DS")
|
||||||
|
|
||||||
# Send message, crazy
|
# Send message, crazy
|
||||||
|
@ -110,7 +112,7 @@ class Err:
|
||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
|
|
||||||
elif err in switch_game_err: # Special Case Handling because Nintendo feels like its required to break their format lol
|
elif err in switch_game_err: # Special Case Handling because Nintendo feels like its required to break their format lol
|
||||||
game,desc = switch_game_err[err].split(":")
|
game, desc = switch_game_err[err].split(":")
|
||||||
|
|
||||||
embed = discord.Embed(title=err, url="https://www.youtube.com/watch?v=x3yXlomPCmU", description=desc)
|
embed = discord.Embed(title=err, url="https://www.youtube.com/watch?v=x3yXlomPCmU", description=desc)
|
||||||
embed.set_footer(text="Console: Switch")
|
embed.set_footer(text="Console: Switch")
|
||||||
|
|
14
cogs/mod.py
14
cogs/mod.py
|
@ -92,6 +92,7 @@ class ModCog:
|
||||||
await modlog_channel.send(chan_message)
|
await modlog_channel.send(chan_message)
|
||||||
await ctx.send(f"{safe_name} is now b&. 👍")
|
await ctx.send(f"{safe_name} is now b&. 👍")
|
||||||
|
|
||||||
|
@commands.guild_only()
|
||||||
@commands.bot_has_permissions(ban_members=True)
|
@commands.bot_has_permissions(ban_members=True)
|
||||||
@commands.check(check_if_staff)
|
@commands.check(check_if_staff)
|
||||||
@commands.command()
|
@commands.command()
|
||||||
|
@ -118,6 +119,7 @@ class ModCog:
|
||||||
modlog_channel = self.bot.get_channel(config.modlog_channel)
|
modlog_channel = self.bot.get_channel(config.modlog_channel)
|
||||||
await modlog_channel.send(chan_message)
|
await modlog_channel.send(chan_message)
|
||||||
|
|
||||||
|
@commands.guild_only()
|
||||||
@commands.check(check_if_staff)
|
@commands.check(check_if_staff)
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def userinfo(self, ctx, *, user: discord.Member):
|
async def userinfo(self, ctx, *, user: discord.Member):
|
||||||
|
@ -136,6 +138,18 @@ class ModCog:
|
||||||
f"color = {user.colour}\n"
|
f"color = {user.colour}\n"
|
||||||
f"top_role = {role}\n")
|
f"top_role = {role}\n")
|
||||||
|
|
||||||
|
@commands.guild_only()
|
||||||
|
@commands.check(check_if_staff)
|
||||||
|
@commands.command(aliases=["setplaying", "setgame"])
|
||||||
|
async def playing(self, ctx, *, game: str = ""):
|
||||||
|
"""Sets the currently played game name, staff only.
|
||||||
|
|
||||||
|
Just send .playing to wipe the playing state."""
|
||||||
|
if game:
|
||||||
|
await self.bot.change_presence(activity=discord.Game(name=game))
|
||||||
|
else:
|
||||||
|
await self.bot.change_presence(activity=None)
|
||||||
|
|
||||||
|
|
||||||
def setup(bot):
|
def setup(bot):
|
||||||
bot.add_cog(ModCog(bot))
|
bot.add_cog(ModCog(bot))
|
||||||
|
|
Loading…
Reference in a new issue