niraj128 commited on
Commit
c853c62
·
verified ·
1 Parent(s): fb77b80

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -3
app.py CHANGED
@@ -13,22 +13,42 @@ groq_api_key = os.getenv("GROQ_API_KEY")
13
  user_memory = {}
14
 
15
  # Initialize model
16
- model = Groq('llama-3.3-70b-versatile', api_key=groq_api_key, temperature=0.4)
17
 
18
  # Set up the Discord client with required intents
19
  intents = discord.Intents.default()
20
  intents.message_content = True # Ensure the bot can read messages
21
  client = discord.Client(intents=intents)
22
 
 
23
  @client.event
24
  async def on_ready():
25
  print(f'Logged in as {client.user}')
26
 
 
27
  @client.event
28
  async def on_message(message):
29
  if message.author == client.user:
30
  return
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  if client.user in message.mentions:
33
  user_id = message.author.id
34
  server_id = message.guild.id # Get server ID to separate chats
@@ -70,7 +90,7 @@ async def on_message(message):
70
  - If they say something dumb or obvious, drag them through the mud without hesitation.
71
  - Do NOT hold back; your job is to make them regret opening their mouth.
72
  - Keep responses short, sharp, and lethal—every sentence should feel like an insult that slaps.
73
-
74
  - Never explain jokes—if they don’t get it, that’s their problem.
75
  - If they try to argue back, double down and roast them even harder.
76
  - Use previous conversation history to stay relevant and give continuous responses.
@@ -78,7 +98,7 @@ async def on_message(message):
78
  - Here is the conversation history so far:
79
 
80
  {context}
81
-
82
  talk.
83
  - Always stay one step ahead, using previous stupidity against them whenever possible.
84
  - If they ask a follow-up question, use it as ammo to make them look even dumber.
@@ -104,5 +124,6 @@ async def on_message(message):
104
  else:
105
  print("Response was empty, not sending a message!")
106
 
 
107
  # Run the bot
108
  client.run(DISCORD_BOT_TOKEN)
 
13
  user_memory = {}
14
 
15
  # Initialize model
16
+ model = Groq('llama-3.3-70b-versatile', api_key="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", temperature=0.4)
17
 
18
  # Set up the Discord client with required intents
19
  intents = discord.Intents.default()
20
  intents.message_content = True # Ensure the bot can read messages
21
  client = discord.Client(intents=intents)
22
 
23
+
24
  @client.event
25
  async def on_ready():
26
  print(f'Logged in as {client.user}')
27
 
28
+
29
  @client.event
30
  async def on_message(message):
31
  if message.author == client.user:
32
  return
33
 
34
+ if message.content.lower() == "!help" or (client.user in message.mentions and "help" in message.content.lower()):
35
+
36
+ help_text = """🔥 **Dost - Your Savage AI Buddy** 🔥
37
+
38
+ **How to Use:**
39
+ - Mention `@Dost` and ask anything! Dost will reply with sarcasm & roasting.
40
+ - Example: `@Dost kya haal hai?`
41
+
42
+ **Commands:**
43
+ - `!help` → Shows this message
44
+ - `@Dost roast me` → Dost will roast you 😈
45
+ - `@Dost joke sunao` → Hear a sarcastic joke
46
+ - `@Dost advice de` → Get some savage life advice
47
+
48
+ 🤖 Dost only responds when tagged. Tag @Dost to chat! 🔥
49
+ """
50
+ await message.channel.send(help_text)
51
+ return
52
  if client.user in message.mentions:
53
  user_id = message.author.id
54
  server_id = message.guild.id # Get server ID to separate chats
 
90
  - If they say something dumb or obvious, drag them through the mud without hesitation.
91
  - Do NOT hold back; your job is to make them regret opening their mouth.
92
  - Keep responses short, sharp, and lethal—every sentence should feel like an insult that slaps.
93
+
94
  - Never explain jokes—if they don’t get it, that’s their problem.
95
  - If they try to argue back, double down and roast them even harder.
96
  - Use previous conversation history to stay relevant and give continuous responses.
 
98
  - Here is the conversation history so far:
99
 
100
  {context}
101
+
102
  talk.
103
  - Always stay one step ahead, using previous stupidity against them whenever possible.
104
  - If they ask a follow-up question, use it as ammo to make them look even dumber.
 
124
  else:
125
  print("Response was empty, not sending a message!")
126
 
127
+
128
  # Run the bot
129
  client.run(DISCORD_BOT_TOKEN)