utils.py 547 B

12345678910111213141516171819
  1. def on_ready_print(self):
  2. print("---------")
  3. print("Logged as")
  4. print(self.user.name)
  5. print(self.user.id)
  6. print("---------")
  7. async def receive_message_then_send(message, received: str, to_send="") -> None:
  8. if message.content == received:
  9. if to_send:
  10. await message.channel.send(to_send)
  11. return True
  12. def get_commands_from_file(filename: str) -> tuple:
  13. with open(filename, 'r') as file:
  14. _help_commands = tuple((command.split('\n')[0] for command in file))
  15. return _help_commands