WIP: Refactor Aurora (3.0.0) #29
5 changed files with 25 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
||||||
from discord import ButtonStyle, Interaction, Message, ui
|
from discord import ButtonStyle, Interaction, Message, ui
|
||||||
|
from discord.errors import NotFound
|
||||||
from redbot.core import commands
|
from redbot.core import commands
|
||||||
from redbot.core.utils.chat_formatting import error
|
from redbot.core.utils.chat_formatting import error
|
||||||
|
|
||||||
|
@ -14,7 +15,10 @@ class Addrole(ui.View):
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
|
|
||||||
async def on_timeout(self):
|
async def on_timeout(self):
|
||||||
|
try:
|
||||||
await self.message.edit(view=None)
|
await self.message.edit(view=None)
|
||||||
|
except NotFound:
|
||||||
|
pass
|
||||||
|
|
||||||
@ui.select(cls=ui.RoleSelect, placeholder="Select a role", min_values=0, max_values=25)
|
@ui.select(cls=ui.RoleSelect, placeholder="Select a role", min_values=0, max_values=25)
|
||||||
async def addrole_select(self, interaction: Interaction, select: ui.RoleSelect):
|
async def addrole_select(self, interaction: Interaction, select: ui.RoleSelect):
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from discord import ButtonStyle, Interaction, Message, ui
|
from discord import ButtonStyle, Interaction, Message, ui
|
||||||
|
from discord.errors import NotFound
|
||||||
from redbot.core import commands
|
from redbot.core import commands
|
||||||
|
|
||||||
from ..utilities.config import config
|
from ..utilities.config import config
|
||||||
|
@ -14,7 +15,10 @@ class Guild(ui.View):
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
|
|
||||||
async def on_timeout(self):
|
async def on_timeout(self):
|
||||||
|
try:
|
||||||
await self.message.edit(view=None)
|
await self.message.edit(view=None)
|
||||||
|
except NotFound:
|
||||||
|
pass
|
||||||
|
|
||||||
@ui.button(label="Show Moderator", style=ButtonStyle.green, row=0)
|
@ui.button(label="Show Moderator", style=ButtonStyle.green, row=0)
|
||||||
async def show_moderator(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
async def show_moderator(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from discord import ButtonStyle, Interaction, Message, ui
|
from discord import ButtonStyle, Interaction, Message, ui
|
||||||
|
from discord.errors import NotFound
|
||||||
from redbot.core import commands
|
from redbot.core import commands
|
||||||
from redbot.core.utils.chat_formatting import error
|
from redbot.core.utils.chat_formatting import error
|
||||||
|
|
||||||
|
@ -14,7 +15,10 @@ class Immune(ui.View):
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
|
|
||||||
async def on_timeout(self):
|
async def on_timeout(self):
|
||||||
|
try:
|
||||||
await self.message.edit(view=None)
|
await self.message.edit(view=None)
|
||||||
|
except NotFound:
|
||||||
|
pass
|
||||||
|
|
||||||
@ui.select(cls=ui.RoleSelect, placeholder="Select a role", min_values=0, max_values=25)
|
@ui.select(cls=ui.RoleSelect, placeholder="Select a role", min_values=0, max_values=25)
|
||||||
async def immune_select(self, interaction: Interaction, select: ui.RoleSelect):
|
async def immune_select(self, interaction: Interaction, select: ui.RoleSelect):
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from discord import ButtonStyle, Interaction, Message, ui
|
from discord import ButtonStyle, Interaction, Message, ui
|
||||||
|
from discord.errors import NotFound
|
||||||
from redbot.core import commands
|
from redbot.core import commands
|
||||||
|
|
||||||
from ..utilities.config import config
|
from ..utilities.config import config
|
||||||
|
@ -14,7 +15,10 @@ class Overrides(ui.View):
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
|
|
||||||
async def on_timeout(self):
|
async def on_timeout(self):
|
||||||
|
try:
|
||||||
await self.message.edit(view=None)
|
await self.message.edit(view=None)
|
||||||
|
except NotFound:
|
||||||
|
pass
|
||||||
|
|
||||||
@ui.button(label="Auto Evidence Format", style=ButtonStyle.green, row=0)
|
@ui.button(label="Auto Evidence Format", style=ButtonStyle.green, row=0)
|
||||||
async def auto_evidenceformat(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
async def auto_evidenceformat(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
from discord import ButtonStyle, Interaction, Message, ui
|
from discord import ButtonStyle, Interaction, Message, ui
|
||||||
|
from discord.errors import NotFound
|
||||||
from redbot.core import commands
|
from redbot.core import commands
|
||||||
|
|
||||||
from ..models.type import Type
|
from ..models.type import Type
|
||||||
|
@ -15,7 +16,10 @@ class Types(ui.View):
|
||||||
self.timeout = timeout
|
self.timeout = timeout
|
||||||
|
|
||||||
async def on_timeout(self):
|
async def on_timeout(self):
|
||||||
|
try:
|
||||||
await self.message.edit(view=None)
|
await self.message.edit(view=None)
|
||||||
|
except NotFound:
|
||||||
|
pass
|
||||||
|
|
||||||
@ui.button(label="Show in History", style=ButtonStyle.green, row=0)
|
@ui.button(label="Show in History", style=ButtonStyle.green, row=0)
|
||||||
async def show_in_history(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
async def show_in_history(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument
|
||||||
|
|
Loading…
Reference in a new issue