-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix user settings available for omitLeadingSlash (#198)
- Loading branch information
1 parent
d4221c9
commit 35d2d8a
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package migrations | ||
|
||
import ( | ||
"database/sql" | ||
"log" | ||
) | ||
|
||
func v12(db *sql.Tx) { | ||
v12AddLeadingSlashSetting(db) | ||
} | ||
|
||
func v12AddLeadingSlashSetting(db *sql.Tx) { | ||
sqlStatement := ` | ||
INSERT INTO "bot::userSettingTypes" ("setting", "description") VALUES | ||
('user.omitCommandSlash', 'make leading slash for commands optional'); | ||
` | ||
_, err := db.Exec(sqlStatement) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Feature: config user settings | ||
|
||
Scenario: test config command handling | ||
Given I have a bot | ||
When I send the message "/config omit_slash on" | ||
Then 1 messages should be sent back | ||
And the response should include the message "has successfully been turned on" |