Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 896 Bytes

Bot.md

File metadata and controls

47 lines (33 loc) · 896 Bytes

Bot App Examples

Display Existing Servers (Guilds)

DSBot new
	token: 'BOT-TOKEN';
	servers.

Bot example

Send Message

DSBot new
	token: 'BOT-TOKEN';
	with: [ :bot | bot message
		content: 'Hi! I am a bot :-)';
		sendToServer: 'Pharo' channel: 'general' ].

Bot example

Expertise

There is an example of a bot, that listen to incoming messages and answer the question Who is expert in ...?

bot := DSBot new.
bot token: 'BOT-TOKEN'.
bot connect.

answer := DSExpertiseAnswer new bot: bot; yourself.

bot announcer 
	when: DSGatewayMessageAnnouncement 
	do: [ :ann | 
		DSExpertiseQuestion 
			message: ann message
			answer: answer ].

Bot example

For more examples see DSBot and DSClientPostBuilder classes.