All Projects → boterostg → botBasicoGlitch

boterostg / botBasicoGlitch

Licence: MIT license
Bot básico hecho mediante www.glitch.com y con Python3 , el cual irá creciendo conforme hagamos tutoriales/clases/dudas/llamadas en discord. Grupo de Telegram: http://t.me/boterostg

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to botBasicoGlitch

Rastreiobot
Telegram Bot @RastreioBot
Stars: ✭ 196 (+752.17%)
Mutual labels:  telegram-bot-api
telegram-bot-dumper
🔪 Dumper & ripper for Telegram bots by token
Stars: ✭ 82 (+256.52%)
Mutual labels:  telegram-bot-api
python-telegram-bot-calendar
Python inline calendar for Telegram bots
Stars: ✭ 71 (+208.7%)
Mutual labels:  telegram-bot-api
Python Telegram
Python client for the Telegram's tdlib
Stars: ✭ 246 (+969.57%)
Mutual labels:  telegram-bot-api
hyouka
Um bot open-source com dashboard incluída
Stars: ✭ 12 (-47.83%)
Mutual labels:  glitch
wptelegram
Integrate your WordPress site perfectly with Telegram with full control.
Stars: ✭ 31 (+34.78%)
Mutual labels:  telegram-bot-api
Java Telegram Bot Tutorial
Java Telegram Bot Tutorial. Feel free to submit issue if you found a mistake.
Stars: ✭ 165 (+617.39%)
Mutual labels:  telegram-bot-api
nestjs-telegraf
🤖 Powerful Nest module for easy and fast creation Telegram bots
Stars: ✭ 300 (+1204.35%)
Mutual labels:  telegram-bot-api
jpg-glitch-electron
desktop app for glitching images
Stars: ✭ 24 (+4.35%)
Mutual labels:  glitch
gotgbot
Autogenerated Go wrapper for the telegram API. Inspired by the python-telegram-bot library.
Stars: ✭ 178 (+673.91%)
Mutual labels:  telegram-bot-api
Telegrammer
Telegram Bot - written with Swift 5.2 / NIO, supports Linux, macOS
Stars: ✭ 248 (+978.26%)
Mutual labels:  telegram-bot-api
python-telegram-bot-seed
Skeleton project for implementing bots in Python using the module python-telegram-bot
Stars: ✭ 25 (+8.7%)
Mutual labels:  telegram-bot-api
snail-cli
a CLI for Glitch
Stars: ✭ 20 (-13.04%)
Mutual labels:  glitch
Fosswebsite
A club management system that handles student details, progress, events, achievements, attendance, status updates, teams and workshop registrations. This is the official [email protected] website
Stars: ✭ 242 (+952.17%)
Mutual labels:  telegram-bot-api
glitch-api
Library for using Glitch API ⚙️
Stars: ✭ 16 (-30.43%)
Mutual labels:  glitch
Haskell Telegram Api
Telegram Bot API for Haskell
Stars: ✭ 184 (+700%)
Mutual labels:  telegram-bot-api
theimagebot
Blog.TheOstrich.Eu.Org
Stars: ✭ 15 (-34.78%)
Mutual labels:  telegram-bot-api
ZEGBot
Build your Telegram Bot with Swift! (works on macOS / Ubuntu)
Stars: ✭ 52 (+126.09%)
Mutual labels:  telegram-bot-api
PixelGlitch
Image glitch visualization using various Pixel Sorting methods for Processing
Stars: ✭ 25 (+8.7%)
Mutual labels:  glitch
react-glitch-effect
React Glitch effects
Stars: ✭ 52 (+126.09%)
Mutual labels:  glitch

BOT BÁSICO PARA TELEGRAM

GRUPO DE TELEGRAM

COMUNIDAD DE GITHUB

CLASES

Este bot esta creado con Python3 con el fin de mostrar ejemplos de funciones de bots de Telegram. A continuación sigue las indicaciones:

1.- Primero de todo leed el tutorial que está explicado aquí -> http://telegra.ph/Creando-Bots-en-Telegram-06-09

2.- Si habéis leído la explicación y habéis seguido todos los pasos ya podéis mirar el glitch del bot, entrad en este enlace https://glitch.com/~botbasico y luego pinchad en View Source para ver el proyecto del bot. Podéis mirar funciones que hay de ejemplo y adaptarlas a vuestro bot :D

3.- Documentación: TELEGRAM BOT API (aquí está toda la información que se necesita para añadir funcionalidades a un bot): https://core.telegram.org/bots/api y aquí: https://github.com/eternnoir/pyTelegramBotAPI teneís el wrapper que se utilizará para programar este bot.

4.- Las funcionalidades del bot están en bot.py -> https://github.com/boterostg/botBasicoGlitch/blob/master/bot.py y en https://glitch.com/~botbasico

*Este proyecto surge del grupo de Telegram http://t.me/boterostg . Dado que hay mucha gente con ganas de aprender, hemos decidido crear un bot desde cero con https://glitch.com/ y Python3. Se utilizará el bot como ejemplo mientras se dan clases/charlas y poco a poco irá aumentando el código de dicho bot. Cualquier duda sobre el código o gente interesada en colaborar solo tiene que entrar al grupo http://t.me/boterostg :)

*Esto es posible gracias a https://github.com/sanguchi que creó toda la estructura del proyecto y el siguiente tutorial de como utilizarlo: http://telegra.ph/Creando-Bots-en-Telegram-06-09

[1] Primera clase 19/07/2018 Explicación de como utilizar glitch, comando de un bot y bot send message:

Cómo crear tu bot y empezar con glitch:

http://telegra.ph/Creando-Bots-en-Telegram-06-09

Ejemplo creación de un comando

@bot.message_handler(commands=['start'])
def nombreComando(message):
  bot.reply_to(message, 'Has iniciado el bot')

Ejemplo respuestas bot

@bot.message_handler(func=lambda message: True)
def echo_message(message):
  cid = message.chat.id
  if message.text.lower() == "hola":
    bot.send_message( cid, 'hola amigo')

[2] Segunda clase 31/07/2018 Explicación de como utilizar split, comando de saludo, despedida y comando de la ruleta rusa en el cual se aplica random y expulsión de usuarios de un grupo.

Ejemplo de como utilizar split

@bot.message_handler(func=lambda message: True)
def echo_message(message):
  cid = message.chat.id
  if  message.text.lower().startswith('bot di'):                 
    mensaje=message.text                              
    respuesta = ' '.join(mensaje.split(" ")[2:])   
    bot.send_message(cid, respuesta)  

Respuesta a la entrada de un usuario al grupo

@bot.message_handler(func=lambda message: True, content_types=['new_chat_members'])
def command_bienvenida(m):
    cid = m.chat.id                                   
    cname = m.chat.title                              
    bienvenida = ""                                    
    
    if (m.new_chat_member.username is None):          
        nun = m.new_chat_member.first_name            
        
        if (m.new_chat_member.last_name is not None): 
            nun += " "                        
            nun += m.new_chat_member.last_name         
            
        else:                                          
            bienvenida = "Bienvenido al grupo"         
            bienvenida += str(cname)                   
            bienvenida += " "
    else:                                              
        nun = m.new_chat_member.username               
        bienvenida = "Bienvenido al grupo "            
        bienvenida += str(cname)                      
        bienvenida += " @"

    bot.send_message(cid, str(bienvenida) + str(nun))

Respuesta a la salida de un usuario del grupo

@bot.message_handler(func=lambda message: True, content_types=['left_chat_member'])
def command_bye(m):
    cid = m.chat.id                                    
    despedida = ""                                     
    
    if (m.left_chat_member.username is None):         
        nun = m.left_chat_member.first_name           
        
        if (m.left_chat_member.last_name is not None): 
            nun += " "
            nun += m.left_chat_member.last_name       
            
    else:                                              
        nun = m.left_chat_member.username             
        despedida = "Hasta luego "                    
        despedida += " @"

    bot.send_message(cid, str(despedida) + str(nun))   

Comando para simular una ruleta rusa en grupos de Telegram

@bot.message_handler(commands=['ruleta'])
def ruleta(message):

  cid = message.chat.id					
  nombreUsuario = message.from_user.username		
  idUsuario = message.from_user.id			
  rnd = randrange(0, int(5))				
  if rnd == 4:						
	
    bot.send_message(cid, "Pummmm estas muerto @" + nombreUsuario )	
    bot.kick_chat_member(cid,idUsuario)					
    bot.unban_chat_member(cid, idUsuario)				

  else:								

    bot.send_message(cid, "Te has salvado amigo @" + nombreUsuario)	

[3] Tercera clase 08/08/2018 Explicación de como utilizar split y random para simular un sorteo.

@bot.message_handler(func=lambda message: True)		# Respuestas del bot
def echo_message(message):
    if message.text.lower().startswith('participo con el numero'):

      cid = message.chat.id
      mensaje=message.text
      rnd = randrange(0, int(9))
      respuesta = ' '.join(mensaje.split(" ")[4:])

      #bot.send_message(cid, "la respuesta es: " + respuesta)
      #bot.send_message(cid, str(rnd))

      if int(respuesta) == rnd:
	bot.send_message(cid, "Has acertado")

    else:
      bot.send_message(cid, "Has fallado, el número era " + str(rnd))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].