List of commits:
Subject Hash Author Date (UTC)
prefix & help 3ab322a4f857dc01e2ce2b5d8e5dcb506f46b408 wyb33 2017-11-16 23:29:07
config template d54bbcc4f485be38265a4f2f676c2bed25290d9c wyb33 2017-11-16 18:02:03
Initial commit 3835964a66a46224223eb793535e181dc5336bad wyb33 2017-11-16 13:44:15
Initial commit cfa6c5c0a4a856102a39a84ac40e59fe92ea5349 wyb33 2017-11-16 13:41:57
Commit 3ab322a4f857dc01e2ce2b5d8e5dcb506f46b408 - prefix & help
Author: wyb33
Author date (UTC): 2017-11-16 23:29
Committer name: wyb33
Committer date (UTC): 2017-11-16 23:29
Parent(s): d54bbcc4f485be38265a4f2f676c2bed25290d9c
Signing key:
Tree: c9efdca246c968cb1aa9c4ba110e3f5d62aea712
File Lines added Lines deleted
bot/bot.go 4 23
File bot/bot.go changed (mode: 100644) (index 15e0118..57ebd73)
... ... import (
14 14 log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
15 15 ) )
16 16
17 const (
18 //Help string lists all discord chat commands for this bot
19 discordHelp string = "***LIST OF BOT COMMANDS***\n" +
20 "Fields in [] are optional\n" +
21 "Fields in <> are mandatory\n\n" +
22 "```" +
23 "!help [bot] (Lists all bot commands)\n" +
24 "!uptime [bot](Prints current bot uptime)\n" +
25 "!sub <id> (Subscribe to anime and get notified when a new episode is released)\n" +
26 "!unsub <id> (Unsubscribe from anime)\n" +
27 "!mysubs (List all the anime you are subscribed to)\n" +
28 "!w <location> (Prints current weather)\n" +
29 "!info [bot] (Prints bot information)" +
30 "```\n" +
31 "Full anime list at http://axolotl-422.rhcloud.com/ \n" +
32 "For issues and suggestions go to https://github.com/gagizagi/Axolotl-GO"
33
34 helpList string = "to be done"
35 )
36
37 17 var ( var (
38 18 BotID string BotID string
39 19 cmdCount uint64 cmdCount uint64
 
... ... func messageHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
84 64
85 65 // Message Handling // Message Handling
86 66 // Change slice if Prefix > 1 // Change slice if Prefix > 1
87 if m.Content[:len(config.BotPrefix)] == config.BotPrefix {
67 Prefix := config.BotPrefix
68 if m.Content[:len(Prefix)] == Prefix {
88 69 //channel, _ := s.Channel(m.ChannelID) //channel, _ := s.Channel(m.ChannelID)
89 70 //serverID := channel.GuildID //serverID := channel.GuildID
90 71 cmdCount++ cmdCount++
91 method := strings.Split(m.Content, " ")[0][len(config.BotPrefix):]
72 method := strings.Split(m.Content, " ")[0][len(Prefix):]
92 73
93 74 if method == "help" { if method == "help" {
94 s.ChannelMessageSend(m.ChannelID, helpList)
75 s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("**mummybot commands**\n```%sloveumate (try it)\n%squote (random quote)\n%sstatus (bot status)```", Prefix, Prefix, Prefix))
95 76 } }
96 77
97 78 if method == "loveumate" { if method == "loveumate" {
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/bbs/mummybot

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/bbs/mummybot

Clone this repository using git:
git clone git://git.rocketgit.com/user/bbs/mummybot

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main