- Create your bot with botfather
- Make you bot an admin of your channel
Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path
https://web.telegram.org/k/#-9999999999999
/* | |
Before Septemper 15 2018, Vietnam has phone number start with 09*, 01(2|6|8|9). | |
After that, the phone number can start with 03, 05, 07 or 08. | |
So this function provide a way to validate the input number is a Vietnamese phone number | |
*/ | |
function isVietnamesePhoneNumber(number) { | |
return /(03|05|07|08|09|01[2|6|8|9])+([0-9]{8})\b/.test(number); | |
} |
//// | |
// Slugify | |
// A String extension that converts a text string into a valid URL | |
// Derived from https://github.com/paulyoung/Slugify/blob/master/Slugify/Slugify.swift | |
// By Jeff Algera - jeffalgera.com | |
//// | |
extension String { | |
private static let allowedCharacters = NSCharacterSet(charactersIn: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-") | |
/** | |
* Cryptography Functions | |
* | |
* Forked from AndiDittrich/AesUtil.js | |
* https://gist.github.com/AndiDittrich/4629e7db04819244e843 | |
*/ | |
import crypto, { CipherGCM, CipherGCMTypes, DecipherGCM } from 'crypto'; | |
import { Password } from './types'; |
package com.example.android.texttospeech | |
import android.os.Build | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.speech.tts.TextToSpeech | |
import android.util.Log | |
import kotlinx.android.synthetic.main.activity_main.* | |
import java.util.* |
This is the example code from my video about using async/await with Cloud Functions. I've placed it here in a gist so it's easier to compare the "before" and "after" states for each case.
The code in this project is licensed under the Apache License 2.0.
Copyright 2018 Google LLC
This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
# Use this script to test that your Telegram bot works. | |
# | |
# Install the dependency | |
# | |
# $ gem install telegram_bot | |
# | |
# Run the bot | |
# | |
# $ ruby bot.rb | |
# |
# When using RN in combination with Cocoapods, a lot of | |
# things are broken. These are the fixes we had to append | |
# to our Podfile when upgrading to ReactNative@0.55.3. | |
# | |
# WARNING: Check those line numbers when you're on a different version! | |
def change_lines_in_file(file_path, &change) | |
print "Fixing #{file_path}...\n" | |
contents = [] |
package es.cityride.mantapp | |
import android.content.Context | |
import android.graphics.PorterDuff | |
import android.graphics.drawable.Drawable | |
import android.support.design.widget.TabLayout | |
import android.util.AttributeSet | |
import android.util.SparseArray | |
import android.view.LayoutInflater | |
import android.view.View |