Skip to content

Commit

Permalink
Added a button to launch a telegram session
Browse files Browse the repository at this point in the history
  • Loading branch information
olekscode committed Sep 12, 2024
1 parent 4d5686e commit c4ae824
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions src/Cormas-Telegram/CMTelegramCommand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Class {
#name : 'CMTelegramCommand',
#superclass : 'CMSpacePresenterToggleCommand',
#instVars : [
'bot'
],
#category : 'Cormas-Telegram',
#package : 'Cormas-Telegram'
}

{ #category : 'accessing' }
CMTelegramCommand >> actionWhenOff [

bot stopBot.
]

{ #category : 'accessing' }
CMTelegramCommand >> actionWhenOn [

| simulation |
simulation := owner owner owner simulation.

bot := (CormasBot new: '5865451037:AAFrVyYdHK57vk8p3OMVqc_uABLdno8C3N4')
whenActionPerformedDo: [ owner updateDiagram ];
createSessionFor: simulation titled: simulation modelClass name;
yourself.

bot startBotPulling: 0.5.
]

{ #category : 'as yet unclassified' }
CMTelegramCommand >> iconWhenOff [

^ self telegramIcon
]

{ #category : 'as yet unclassified' }
CMTelegramCommand >> iconWhenOn [

^ self telegramIconDisable
]

{ #category : 'as yet unclassified' }
CMTelegramCommand >> nameWhenOff [

^ 'Telegram'
]

{ #category : 'as yet unclassified' }
CMTelegramCommand >> nameWhenOn [

^ 'Stop'
]

{ #category : 'as yet unclassified' }
CMTelegramCommand >> telegramIcon [
<script: 'self new telegramIcon inspect'>

^ (Form fromBinaryStream: self telegramIconBase64 base64Decoded asByteArray readStream)
scaledToSize: 20@20
]

{ #category : 'as yet unclassified' }
CMTelegramCommand >> telegramIconBase64 [

^ 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfoCQwIOhPeASCZAAAImHpUWHRS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QyLWI1MmMtYzQyZTcyMzYzNGNhaM6nrQAAAEV0RVh0eG1wTU06T3JpZ2luYWxEb2N1bWVudElEAHhtcC5kaWQ6ZmZlN2RlZWMtZjQxNS1hMDQyLWIyNmItMTI3ODk2N2MxM2QyAakZuwAAAABJRU5ErkJggg=='
]

{ #category : 'as yet unclassified' }
CMTelegramCommand >> telegramIconDisable [
<script: 'self new telegramIconDisable inspect'>

^ self telegramIcon darker darker
]

0 comments on commit c4ae824

Please sign in to comment.