Skip to content

Commit

Permalink
change project name to siahe
Browse files Browse the repository at this point in the history
  • Loading branch information
DearRude committed Mar 7, 2024
1 parent 845737a commit 0aedf15
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 32 deletions.
27 changes: 13 additions & 14 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#+title: fumCommunityBot
#+title: siahe

=fumCommunityBot= is designed to help university clubs sell tickets for their events through the Telegram messaging platform. The bot provides a seamless ticket purchasing experience for users, allowing them to easily browse available events, select tickets, and sign up directly within the Telegram app.
=siahe= is designed to help university clubs sell tickets for their events through the Telegram messaging platform. The bot provides a seamless ticket purchasing experience for users, allowing them to easily browse available events, select tickets, and sign up directly within the Telegram app.

** Build
1. Have the latest version of =go= installed in you path.
Expand All @@ -11,7 +11,7 @@ go build .
#+end_src

** Run
=fumCommunityBot= inputs a set of configuration entries. This entries can either be passed by environment variables, argument flags or =.env= file. To see the full list of flags either do =fumCommunityBot --help= or check out [file:config.go] directly.
=siahe= inputs a set of configuration entries. This entries can either be passed by environment variables, argument flags or =.env= file. To see the full list of flags either do =siahe --help= or check out [file:config.go] directly.

Here is an example usage of an =.env= file.
Generate the env file.
Expand All @@ -24,37 +24,36 @@ $EDITOR .env
#+end_src
Run the program.
#+begin_src bash
fumCommunityBot
siahe
#+end_src

*** Run by Docker
=fumCommunityBot= [[https://github.com/TopSelectOrg/toucanet/pkgs/container/toucanet][images]] are built upon each commit on Github container registry (ghcr) with =latest= tag.
=siahe= [[https://github.com/TopSelectOrg/toucanet/pkgs/container/toucanet][images]] are built upon each commit on Github container registry (ghcr) with =latest= tag.

Authorize to GHCR by [[https://github.com/settings/tokens][making a PAT]] that has =read:packages= permission. ([[https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic][info]])

Make fumCommunityBot assets directory and grant nonroot permission to it.
Make siahe assets directory and grant nonroot permission to it.
#+begin_src bash
mkdir fumCommunityBot_assets
sudo chown 65532 fumCommunityBot_assets
sudo chmod a+w fumCommunityBot_assets
mkdir siahe_assets
sudo chown 65532 siahe_assets
sudo chmod a+w siahe_assets
#+end_src

Generate the following =docker-compose.yml= file.
#+begin_src yaml
version: '3'
services:
fumCommunityBot:
image: ghcr.io/dearrude/fumCommunityBot:latest
container_name: fumCommunityBot
siahe:
image: ghcr.io/dearrude/siahe:latest
container_name: siahe
volumes:
- ./fumCommunityBot_assets:/home/nonroot/assets
- ./siahe_assets:/home/nonroot/assets
environment:
APPID: -
APPHASH: -
BOTTOKEN: -
ADMINPASSWORD: -
VARIFICATIONCHAT: -
BACKUPCHAT: -

#+end_src

Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Config struct {

func GenConfig() Config {
log.Println("Read configurations.")
fs := flag.NewFlagSet("fumCommunityBot", flag.ContinueOnError)
fs := flag.NewFlagSet("siahe", flag.ContinueOnError)
var (
appId = fs.Int("appId", 0, "AppID in Telegram API")
appHash = fs.String("appHash", "", "AppHash in Telegram API")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/DearRude/fumCommunityBot
module github.com/DearRude/siahe

go 1.21

Expand Down
4 changes: 2 additions & 2 deletions handlers/handle_callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"bytes"
"fmt"

"github.com/DearRude/fumCommunityBot/database"
in "github.com/DearRude/fumCommunityBot/internals"
"github.com/DearRude/siahe/database"
in "github.com/DearRude/siahe/internals"
)

func signUpAskGender(u in.UpdateCallback) error {
Expand Down
4 changes: 2 additions & 2 deletions handlers/handle_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strconv"
"strings"

"github.com/DearRude/fumCommunityBot/database"
in "github.com/DearRude/fumCommunityBot/internals"
"github.com/DearRude/siahe/database"
in "github.com/DearRude/siahe/internals"
)

func handleCommands(u in.UpdateMessage) error {
Expand Down
4 changes: 2 additions & 2 deletions handlers/handle_deeplinks.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strconv"
"strings"

"github.com/DearRude/fumCommunityBot/database"
in "github.com/DearRude/fumCommunityBot/internals"
"github.com/DearRude/siahe/database"
in "github.com/DearRude/siahe/internals"
)

// parameter: eventID
Expand Down
4 changes: 2 additions & 2 deletions handlers/handle_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package handlers
import (
"strconv"

"github.com/DearRude/fumCommunityBot/database"
in "github.com/DearRude/fumCommunityBot/internals"
"github.com/DearRude/siahe/database"
in "github.com/DearRude/siahe/internals"
)

func handleMessageStates(u in.UpdateMessage) error {
Expand Down
2 changes: 1 addition & 1 deletion handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/gotd/td/telegram/message"
"github.com/gotd/td/tg"

in "github.com/DearRude/fumCommunityBot/internals"
in "github.com/DearRude/siahe/internals"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions handlers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"github.com/gotd/td/tg"

"github.com/DearRude/fumCommunityBot/database"
in "github.com/DearRude/fumCommunityBot/internals"
"github.com/DearRude/siahe/database"
in "github.com/DearRude/siahe/internals"
)

func getCommandName(u in.UpdateMessage) string {
Expand Down
2 changes: 1 addition & 1 deletion handlers/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package handlers
import (
"regexp"

in "github.com/DearRude/fumCommunityBot/internals"
in "github.com/DearRude/siahe/internals"
)

func IsStringPersian(text string) bool {
Expand Down
2 changes: 1 addition & 1 deletion internals/internals.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/gotd/td/tg"

db "github.com/DearRude/fumCommunityBot/database"
db "github.com/DearRude/siahe/database"
)

type UserState uint
Expand Down
2 changes: 1 addition & 1 deletion internals/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/gotd/td/telegram/message/styling"
"github.com/gotd/td/tg"

db "github.com/DearRude/fumCommunityBot/database"
db "github.com/DearRude/siahe/database"
)

func MessageYouAlreadySignedUp(name string) []message.StyledTextOption {
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/gotd/td/telegram/message"
"github.com/gotd/td/tg"

db "github.com/DearRude/fumCommunityBot/database"
"github.com/DearRude/fumCommunityBot/handlers"
db "github.com/DearRude/siahe/database"
"github.com/DearRude/siahe/handlers"
)

func main() {
Expand Down

0 comments on commit 0aedf15

Please sign in to comment.