async def change_playing(self, ctx, *, playing: str): """playing stats chang8r for whatever reason""" if self.config.status_type == "idle": status_type = discord.Status.idle elif self.config.status_type == "dnd": status_type = discord.Status.dnd else: status_type = discord.Status.online if self.config.playing_type == "listening": playing_type = 2 elif self.config.playing_type == "watching": playing_type = 3 else: playing_type = 0 try: await self.bot.change_presence(activity=discord.Activity( type=playing_type, name=playing), status=status_type) dataIO.change_value(self.config, "playing", playing) await ctx.send("changed gamer status to " + f'**{playing}**.') except discord.InvalidArgument as err: await ctx.send(err) except Exception as e: await ctx.send(e)
async def change_playing(self, ctx, *, playing: str): """ Change playing status. """ if self.config.status_type == "idle": status_type = discord.Status.idle elif self.config.status_type == "dnd": status_type = discord.Status.dnd else: status_type = discord.Status.online if self.config.playing_type == "listening": playing_type = 2 elif self.config.playing_type == "watching": playing_type = 3 else: playing_type = 0 try: await self.bot.change_presence( activity=discord.Activity(type=playing_type, name=playing), status=status_type ) dataIO.change_value("config.json", "playing", playing) await ctx.send(f"Successfully changed playing status to **{playing}**") except discord.InvalidArgument as err: await ctx.send(err) except Exception as e: await ctx.send(e)
async def change_status(self, ctx, *, playing: str): """ 幫機器人換其他顯示狀態。 """ if self.config.status_type == "閒置": status_type = discord.Status.idle elif self.config.status_type == "請勿打擾": status_type = discord.Status.dnd else: status_type = discord.Status.online if self.config.playing_type == "收聽中": playing_type = 2 elif self.config.playing_type == "觀看中": playing_type = 3 else: playing_type = 0 try: await self.bot.change_presence( activity=discord.Activity(type=playing_type, name=playing), status=status_type ) dataIO.change_value("config.json", "正在玩", playing) await ctx.send(f"我把自己的狀態換成了「**{playing}**」哦汪 (`・ω・´)") except discord.InvalidArgument as err: await ctx.send(err) except Exception as e: await ctx.send(e)
async def change_playing(self, ctx, *, playing: str): """ Change playing status. """ try: await self.bot.change_presence( activity=discord.Game(type=0, name=playing), status=discord.Status.online ) dataIO.change_value("config.json", "playing", playing) await ctx.send(f"Successfully changed playing status to **{playing}**") except discord.InvalidArgument as err: await ctx.send(err) except Exception as e: await ctx.send(e)
async def change_playing(self, ctx, *, playing: str): """ Change playing status. """ status = self.config.status_type.lower() status_type = {"idle": discord.Status.idle, "dnd": discord.Status.dnd} activity = self.config.activity_type.lower() activity_type = {"listening": 2, "watching": 3, "competing": 5} try: await self.bot.change_presence( activity=discord.Game(type=activity_type.get(activity, 0), name=playing), status=status_type.get(status, discord.Status.online)) dataIO.change_value("config.json", "playing", playing) await ctx.send( f"Successfully changed playing status to **{playing}**") except discord.InvalidArgument as err: await ctx.send(err) except Exception as e: await ctx.send(e)
async def _change_playing(self, ctx, *, playing: str): if self.config.playing_type == "listening": playing_type = 2 elif self.config.playing_type == "watching": playing_type = 3 else: playing_type = 0 try: await self.bot.change_presence(activity=discord.Activity( type=playing_type, name=str(playing)) # todo remove cast ) dataIO.change_value("config.json", "playing", playing) await ctx.send( f"Successfully changed playing status to **{playing}**") except discord.InvalidArgument as err: await ctx.send(err) except Exception as e: await ctx.send(e)
async def _change_status(self, ctx, status: str): if status == "idle": status_type = discord.Status.idle elif status == "dnd": status_type = discord.Status.dnd elif status == "offline": status_type = discord.Status.offline elif status == "invisible": status_type = discord.Status.invisible else: status_type = discord.Status.online try: await self.bot.change_presence(status=status_type) dataIO.change_value("config.json", "status_type", status) await ctx.send(f"Successfully changed status to **{status}**") except discord.InvalidArgument as err: await ctx.send(err) except Exception as e: await ctx.send(e)