-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from fabriguespe/updates_v4
Updates v4
- Loading branch information
Showing
46 changed files
with
3,341 additions
and
768 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { HandlerContext } from "@xmtp/botkit"; | ||
|
||
export async function handler(context: HandlerContext) { | ||
const { content } = context.message; | ||
const { content: text, command, params } = content; | ||
switch (command) { | ||
case "block": | ||
// context.addMember(params.username); | ||
context.reply("❌ you are not an admin"); | ||
break; | ||
case "unblock": | ||
// context.removeMember(params.username); | ||
context.reply("❌ you are not an admin"); | ||
break; | ||
default: | ||
// Inform the user about unrecognized commands and provide available options | ||
context.reply( | ||
"Command not recognized. Available commands: block, unblock.", | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { HandlerContext } from "@xmtp/botkit"; | ||
|
||
// Handler function to process game-related commands | ||
export async function handler(context: HandlerContext) { | ||
const { content } = context.message; | ||
const { params } = content; | ||
// URLs for each game type | ||
const gameUrls: { [key: string]: string } = { | ||
wordle: "https://openframedl.vercel.app/", | ||
slot: "https://slot-machine-frame.vercel.app/", | ||
guess: "https://farguessr.vercel.app/", | ||
}; | ||
|
||
// Respond with the appropriate game URL or an error message | ||
switch (params.type) { | ||
case "wordle": | ||
case "slot": | ||
case "guess": | ||
// Retrieve the URL for the requested game using a simplified variable assignment | ||
const gameUrl = gameUrls[params.type]; | ||
// Send the URL for the requested game | ||
context.reply(gameUrl); | ||
break; | ||
default: | ||
// Inform the user about unrecognized commands and provide available options | ||
context.reply( | ||
"Command not recognized. Available games: wordle, slot, guess, or help.", | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { HandlerContext } from "@xmtp/botkit"; | ||
import { commands } from "../commands.js"; // Assuming commands.ts is in the same directory | ||
|
||
export async function handler(context: HandlerContext) { | ||
const { content } = context.message; | ||
const { content: command } = content; | ||
switch (command.trim().replace("/", "")) { | ||
case "tx": | ||
context.reply("Send 1 ETH tx:0xf0490b45884803924Ca84C2051ef435991D7350D"); | ||
break; | ||
case "dm": | ||
context.reply("dm:/0x1CB3649469546D10b7fa4fd1d1c63e8aA3a0E667"); | ||
break; | ||
case "help": | ||
const intro = | ||
"Available experiences:\n" + | ||
commands | ||
.flatMap((bot: any) => bot.commands) | ||
.map((command: any) => `${command.command} - ${command.description}`) | ||
.join("\n") + | ||
"\nUse these commands to interact with specific bots."; | ||
context.reply(intro); | ||
break; | ||
default: | ||
context.reply("Command not found. Use /help to see available commands."); | ||
break; | ||
} | ||
} |
Oops, something went wrong.