예제 #1
0
파일: main.go 프로젝트: Xe/flurryheart
func main() {
	flag.Parse()

	f := finch.NewFinch(*apiToken)

	f.Start()
}
예제 #2
0
파일: bot.go 프로젝트: Syfaro/selectionsbot
func main() {
	db := sqlx.MustOpen("sqlite3", os.Getenv("DATABASE_PATH"))
	database.DB = db

	db.MustExec(`
		create table if not exists user (
			id integer primary key,
			telegram_id integer not null,
			name text
		);

		create table if not exists selection (
			id integer primary key,
			user_id integer not null,
			chat_id integer not null,
			title text,
			active integer
		);

		create table if not exists selection_item (
			id integer primary key,
			selection_id integer not null,
			item text not null
		);

		create table if not exists selection_vote (
			id integer primary key,
			user_id integer not null,
			selection_id integer not null,
			selection_item_id integer not null
		);
	`)

	f := finch.NewFinch(os.Getenv("TELEGRAM_APITOKEN"))

	f.API.Debug = os.Getenv("DEBUG") == "true"

	f.Start()
}
예제 #3
0
파일: bot.go 프로젝트: Syfaro/finch-example
func main() {
	f := finch.NewFinch(os.Getenv("TELEGRAM_APITOKEN"))

	f.Start()
}