Skip to content

Commit

Permalink
fix: change API for bot
Browse files Browse the repository at this point in the history
  • Loading branch information
yjane99 committed Apr 12, 2024
1 parent 3af2adc commit 55a06fa
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def on_trash(self):
if self.scheduler_event_id:
frappe.db.delete('Server Script', self.scheduler_event_id)


def create_scheduler_event(self):
"""
Create a Server Script of type 'Scheduler Event' and set the 'scheduler_event_id' to the name of the Server Script.
Expand All @@ -81,9 +81,8 @@ def get_scheduler_event_script(self):
# bot = frappe.get_doc('Raven Bot', self.bot)
# bot.send_message(self.channel, {'text': self.content})
# return code snippet with bot & content as values
message = {"text": self.content}
script = f"""
bot = frappe.get_doc('Raven Bot', '{self.bot}')\n
bot.send_message('{self.channel}', {message})
bot.send_message('{self.channel}', '{self.content}')
"""
return script

0 comments on commit 55a06fa

Please sign in to comment.