Create a bot
tip
We have the world's shortest lines code of chatbot in all programming languages!
- TypeScript
- JavaScript
- Python
- Go
- Java
- PHP
- Scala
- C#
- Rust
import { Wechaty } from 'wechaty'
async function main () {
const bot = new Wechaty()
// TODO: init your bot at here...
// bot.on('scan', console.info)
await bot.start()
}
main()
.catch(console.error)
import { Wechaty } from 'wechaty'
async function main () {
const bot = new Wechaty()
// TODO: init your bot at here...
// bot.on('scan', console.info)
await bot.start()
}
main()
.catch(console.error)
from wechaty import Wechaty
import asyncio
async def main():
bot = Wechaty()
# TODO: init your bot at here
await bot.start()
asyncio.run(main())
package main
import (
"fmt"
"github.com/wechaty/go-wechaty/wechaty"
)
func main() {
bot = wechaty.NewWechaty()
// TODO: init your bot at here...
bot.Start()
}
package io.github.wechaty;
class Bot{
public static void main(String args[]){
Wechaty bot = new Wechaty()
// TODO: init your bot at here...
bot.start(true);
}
}
$bot = \IO\Github\Wechaty\Wechaty::getInstance();
// TODO: init your bot at here...
$bot->start();
package wechaty
object DingDongBot {
def main(args: Array[String]): Unit = {
bot = new Wechaty()
// TODO: init your bot at here
bot.start()
Thread.currentThread().join()
}
}
var bot = new Wechaty()
// TODO: init your bot at here...
bot.Start();
use std::env;
use wechaty::prelude::*;
use wechaty_puppet_service::PuppetService;
let bot = Wechaty::new();
// TODO: init your bot at here...
bot
.start()
.await;