Skip to content

Commit

Permalink
Merge pull request #106 from codigoencasa/master
Browse files Browse the repository at this point in the history
stuff
  • Loading branch information
leifermendez authored Apr 3, 2024
2 parents 74f2509 + f6cda1d commit 7a01ea9
Show file tree
Hide file tree
Showing 18 changed files with 8,664 additions and 250 deletions.
1,401 changes: 1,337 additions & 64 deletions package-lock.json

Large diffs are not rendered by default.

Binary file added public/assets/examples/api_call.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/examples/blocked_users.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/examples/onWhatsapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/og-image-v4-blank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions src/components/Navigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export const navigation = [
links: [
{ title: 'Meta', href: '/providers/meta' },
{ title: 'Twilio', href: '/providers/twilio' },
{ title: 'Baileys', href: '/providers#baileys' },
{ title: 'Baileys', href: '/providers/baileys' },
{ title: 'Venom', href: '/providers#venom' },
{ title: 'WPPConnect', href: '/providers#wpp-connect' },
]
Expand Down Expand Up @@ -254,8 +254,7 @@ export const navigation = [
links: [
{ title: 'API Rest', href: '/tutorials/api-use' },
{ title: 'Gemini', href: '/tutorials/chatbot-with-gemini' },
{ title: 'Meta', href: '/tutorials/tricks-meta' },
{ title: 'Langchain', href: '/tutorials/langchain' },
{ title: 'Langchain', href: '/tutorials/langchain' }
]
},
{
Expand All @@ -271,7 +270,7 @@ export const navigation = [
{ title: 'Telegram', href: '/plugins/telegram' },
{ title: 'Shopify', href: '/plugins/shopify' },
{ title: 'Agents', href: '/plugins/agents' },
{ title: 'langchain', href: '/plugins/langchain' }
{ title: 'Langchain', href: '/plugins/langchain' }
],
},
]
Expand Down
22 changes: 18 additions & 4 deletions src/pages/_app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,34 @@ export default function App({ Component, pageProps }) {
return (
<>
<Head>
{router.pathname === '/' ? (
{router.pathname === '/en' || router.pathname === '/es' || router.pathname === '/pt' ? (
<title>BuilderBot.app Create a WhatsApp Chatbot, Without Limit</title>
) : (
<>
{(pageProps?.title) ? <>
<meta
property="og:image"
content={'https://builderbot.vercel.app/api/og?title='+pageProps?.title }
/>
<meta property="og:image:secure_url" content={'https://builderbot.vercel.app/api/og?title='+pageProps?.title } />
<meta name="twitter:image" content={'https://builderbot.vercel.app/api/og?title='+pageProps?.title }/>

</> : <></>}

<title>{`${pageProps?.title || 'Documentation'} - BuilderBot.app Chatbot for Whatsapp, Telegram and more`}</title>
<meta property="og:image" content={pageProps?.ogImage ?? 'https://builderbot.vercel.app/assets/og-image-v4.png'}/>
<meta property="og:image:secure_url" content="https://builderbot.vercel.app/assets/og-image-v4.png" />
<meta name="twitter:image" content="https://builderbot.vercel.app/assets/og-image-v4.png"/>

</>
)}

<link rel="icon" href="/favicon.ico" sizes="any" />
<meta name="description" content={pageProps.description} />
<meta property="og:url" content="https://builderbot.app/"/>
<meta property="og:type" content="website"/>
<meta property="og:title" content={pageProps?.title} />
<meta property="og:description" content={pageProps.description}/>
<meta property="og:image" content={pageProps?.ogImage ?? 'https://builderbot.vercel.app/assets/og-image-v4.png'}/>
<meta property="og:image:secure_url" content="https://builderbot.vercel.app/assets/og-image-v4.png" />
<meta property="og:image:width" content="1200"></meta>
<meta property="og:image:height" content="630"></meta>
<meta property="og:image:type" content="image/png"></meta>
Expand All @@ -43,7 +58,6 @@ export default function App({ Component, pageProps }) {
<meta property="twitter:url" content="https://builderbot.app/"/>
<meta name="twitter:title" content="builderbot.app - a powerful workflow automation tool"/>
<meta name="twitter:description" content="Get started with BuilderBot - a free and open source framework with an intuitive and extensible way to create chatbot and smart apps that connect to different communication channels like Whatsapp, Telegram and others. We have made an intuitive framework so you can have your first chatbot in minutes"/>
<meta name="twitter:image" content="https://builderbot.vercel.app/assets/og-image-v4.png"/>

</Head>
<MDXProvider components={mdxComponents}>
Expand Down
64 changes: 64 additions & 0 deletions src/pages/api/og.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { ImageResponse } from '@vercel/og';
export const config = {
runtime: 'edge',
};

export default async function handler(request) {
const { searchParams } = new URL(request.url);
const hasTitle = searchParams.has('title');
const title = hasTitle
? searchParams.get('title')?.slice(0, 100)
: '';

const imageData = await fetch(new URL('../../../public/assets/og-image-v4-blank.png', import.meta.url)).then(
(res) => res.arrayBuffer(),
);

const fontData = await fetch(
new URL('../../../public/fonts/DMSans-SemiBold.ttf', import.meta.url),
).then((res) => res.arrayBuffer());

return new ImageResponse(
(
<div
style={{
display: 'flex',
background: '#f6f6f6',
width: '100%',
height: '100%',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
}}
>
<img style={{position:'absolute',zIndex:10}} width="1200" height="630" src={imageData} />
<div style={{
position:'absolute',
zIndex:99,
right:10,
color:'white',
lineHeight:.8,
textAlign:'center',
display:'flex',
justifyContent:'flex-start',
fontFamily: '"Coolvetica"',
fontSize: 80,
width:680
}}>
{title}
</div>
</div>
),
{
width: 1200,
height: 630,
fonts: [
{
name: 'Coolvetica',
data: fontData,
style: 'bold',
},
],
},
);
}
106 changes: 0 additions & 106 deletions src/pages/en/providers/baileys.mdx

This file was deleted.

64 changes: 64 additions & 0 deletions src/pages/en/providers/baileys/blocked-users.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { Contributors } from '@/components/Contributors'
import { Resources } from '@/components/Resources'
import { Guides } from '@/components/Guides'


# Blocked Users on BOT

To check the blocked users on the BOT, you should use the 'fetchBlocklist()' method of the provider.
This method has the following signature:

```
(property) fetchBlocklist: () => Promise<string[]>
```

<Contributors mode users={['jorgechavarriaga']} />

```ts {{ title: 'app.ts' }}
import { createBot, createProvider, createFlow, addKeyword, EVENTS } from '@builderbot/bot'
import { MemoryDB as Database } from '@builderbot/bot'
import { BaileysProvider as Provider } from '@builderbot/provider-baileys'
import { config } from 'dotenv'
config()

const PHONE_NUMBER = process.env.PHONE_NUMBER

const welcomeFlow = addKeyword<Provider, Database>(EVENTS.WELCOME)
.addAnswer(`💡 Example *List Blocked Users on BOT:*`)
.addAction(
async (_, { provider, flowDynamic }) => {
const blocked = await provider.vendor.fetchBlocklist()
const result = blocked.map((id, index) => `id ${index + 1}: ${id}`).join('\n');
await flowDynamic(`*Blocked:*\n${result}`)
}
)

const main = async () => {
const adapterFlow = createFlow([welcomeFlow])

const adapterProvider = createProvider(Provider, { usePairingCode: true, phoneNumber: PHONE_NUMBER })
const adapterDB = new Database()

const botResult = await createBot(
{
flow: adapterFlow,
provider: adapterProvider,
database: adapterDB,
}
)
}

main()


```

<img style={{minHeight:'450px'}} className="rounded-2xl bg-zinc-900 w-full shadow-md dark:ring-1 dark:ring-white/10" src="/assets/examples/blocked_users.png" alt="API Call Example" />


----

<Guides />

<Resources />

Loading

0 comments on commit 7a01ea9

Please sign in to comment.