information message concept
This commit is contained in:
parent
65034ced1c
commit
344c72857f
34
main.py
34
main.py
@ -5,22 +5,44 @@ from dotenv import load_dotenv
|
|||||||
BOT_NAME = "Dumb Bitch"
|
BOT_NAME = "Dumb Bitch"
|
||||||
|
|
||||||
|
|
||||||
def start_computer():
|
class ComputerManager:
|
||||||
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def start_computer(self):
|
||||||
|
print("Starting Computer")
|
||||||
|
|
||||||
|
|
||||||
class MyClient(discord.Client):
|
class MyClient(discord.Client):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.computer_manager = ComputerManager()
|
||||||
|
self.information_message = None
|
||||||
|
|
||||||
|
async def send_information_message(self, channel: discord.TextChannel):
|
||||||
|
self.information_message = await channel.send(
|
||||||
|
"Placeholder message for server information\n"
|
||||||
|
"react with :arrow_forward: to start the server"
|
||||||
|
)
|
||||||
|
await self.information_message.add_reaction("▶")
|
||||||
|
|
||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
print(f"Logged on as {self.user}.")
|
print(f"Logged on as {self.user}.")
|
||||||
|
|
||||||
async def on_message(self, message):
|
async def on_message(self, message):
|
||||||
print(f"Message from {message.author}: {message.content}")
|
|
||||||
if message.author == self.user:
|
if message.author == self.user:
|
||||||
return
|
return
|
||||||
if message.content == "hello":
|
print(f"Message from {message.author}: {message.content}")
|
||||||
await message.channel.send(f"Hey {message.author}")
|
if message.content == "!information_message":
|
||||||
if message.content == "goodbye":
|
await self.send_information_message(message.channel)
|
||||||
await message.channel.send(f"Goodbye {message.author}")
|
|
||||||
|
async def on_reaction_add(self, reaction, user):
|
||||||
|
if user == self.user:
|
||||||
|
return
|
||||||
|
print(f"User {user} reacted to message {reaction.message.id} with {reaction}")
|
||||||
|
if reaction.message == self.information_message:
|
||||||
|
if reaction.emoji == "▶":
|
||||||
|
self.computer_manager.start_computer()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user