buildbot / buildbot

@@ -133,6 +133,8 @@
Loading
133 133
134 134
    @defer.inlineCallbacks
135 135
    def command_START(self, args, **kwargs):
136 +
        self.bot.post('/setChatMenuButton', json={'chat_id': self.channel.id,
137 +
                                                  'menu_button': {'type': 'commands'}})
136 138
        yield self.command_HELLO(args)
137 139
        reactor.callLater(0.2, self.command_HELP, '')
138 140
@@ -150,7 +152,7 @@
Loading
150 152
    command_NAY.usage = "nay - never mind the command we are currently discussing"
151 153
152 154
    @classmethod
153 -
    def describe_commands(cls):
155 +
    def get_commands(cls):
154 156
        commands = cls.build_commands()
155 157
        response = []
156 158
        for command in commands:
@@ -160,9 +162,13 @@
Loading
160 162
            doc = getattr(meth, '__doc__', None)
161 163
            if not doc:
162 164
                doc = command
163 -
            response.append(f"{command} - {doc}")
165 +
            response.append((command, doc))
164 166
        return response
165 167
168 +
    @classmethod
169 +
    def describe_commands(cls):
170 +
        return [f"{command} - {doc}" for command, doc in cls.get_commands()]
171 +
166 172
    @Contact.overrideCommand
167 173
    def command_COMMANDS(self, args, **kwargs):
168 174
        if args.lower() == 'botfather':
@@ -177,10 +183,10 @@
Loading
177 183
    def command_GETID(self, args, **kwargs):
178 184
        """get user and chat ID"""
179 185
        if self.is_private_chat:
180 -
            self.send(f"Your ID is {self.user_id}.")
186 +
            self.send(f"Your ID is `{self.user_id}`.")
181 187
        else:
182 -
            yield self.send(f"{self.user_name}, your ID is {self.user_id}.")
183 -
            self.send(f'This {self.channel.chat_info.get("type", "group")} ID is {self.chat_id}.')
188 +
            yield self.send(f"{self.user_name}, your ID is `{self.user_id}`.")
189 +
            self.send(f'This {self.channel.chat_info.get("type", "group")} ID is `{self.chat_id}`.')
184 190
    command_GETID.usage = "getid - get user and chat ID that can be put in the master " \
185 191
                          "configuration file"
186 192
@@ -608,6 +614,9 @@
Loading
608 614
            channel = self.getChannel(c)
609 615
            channel.add_notification_events(self.notify_events)
610 616
        yield self.loadState()
617 +
        commands = [{'command': command, 'description': doc}
618 +
                    for command, doc in TelegramContact.get_commands()]
619 +
        self.post('/setMyCommands', json={'commands': commands})
611 620
612 621
    results_emoji = {
613 622
        SUCCESS: ' ✅',
Files Coverage
master/buildbot 92.52%
worker/buildbot_worker 86.38%
Project Totals (345 files) 92.07%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading