rubydium 0.3.10 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubydium/mixins/command_macros.rb +10 -8
- data/lib/rubydium/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97bb8b30d554f87adf1e78fc3e61b361f23d6b04beadec34e5a8bf94b935369b
|
4
|
+
data.tar.gz: a80100d0d54f07010ace0069d2717a7323d4cd9096d1ea23f8c39f62d142dfec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c33b975ed62c70b6d345317b707fbd3c1921b91d285dc198675c88154e6a8a07fbdaea03f09b3676651297c38306ea208316048ad3651a5de4fa16a31461e285
|
7
|
+
data.tar.gz: a60d1697e0f9b83d27432301447b77432907fa6a242f5acd90249baf6d8e9a8b89b35d3a88336efabc8c2591745db2944dbe1384cd15d756a6d00855f954651a
|
@@ -74,19 +74,21 @@ module Rubydium
|
|
74
74
|
@registered_on_every_message ||= []
|
75
75
|
end
|
76
76
|
|
77
|
-
def on_command(command, method_name=nil, description: nil, ignore_forwarded: true, &block)
|
77
|
+
def on_command(command, method_name=nil, aliases: [], description: nil, ignore_forwarded: true, &block)
|
78
78
|
@registered_commands ||= {}
|
79
79
|
action = (method_name || block)
|
80
80
|
raise ArgumentError, "Provide either method name or a block" unless action
|
81
81
|
|
82
|
+
parameters = {
|
83
|
+
action: action,
|
84
|
+
description: description,
|
85
|
+
ignore_forwarded: ignore_forwarded
|
86
|
+
}
|
87
|
+
|
82
88
|
@registered_commands.merge!(
|
83
|
-
{
|
84
|
-
|
85
|
-
|
86
|
-
description: description,
|
87
|
-
ignore_forwarded: ignore_forwarded
|
88
|
-
}
|
89
|
-
}
|
89
|
+
[command, *aliases].map { |comm|
|
90
|
+
[comm, parameters]
|
91
|
+
}.to_h
|
90
92
|
)
|
91
93
|
end
|
92
94
|
|
data/lib/rubydium/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubydium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bulgakke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: telegram-bot-ruby
|